![]() |
Updating toolbar button state |
Post Reply ![]() |
Author | |
dearvivekkumar ![]() Newbie ![]() Joined: 13 June 2012 Location: New Delhi Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() Posted: 06 July 2012 at 4:22am |
Hi, I have a dialog in MFC application, which was having menu-bar. Now I have created a toolbar (CXTPToolBar) in that dialog using the same command which is in the menu-bar. I use to update the menu-item's state(enable/disable) as
per some check in My doubt is when the ON_UPDATE_COMMAND_UI is only coming when I click on the toolbar button.
What is the correct way for doing this? Is there some alternative for doing this? Thanks |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
Hi;
Take a look at Samples\CommandBars\DialogSample It shows how to get the ON_UPDATE_COMMAND_UI handlers to work. |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
sharky ![]() Newbie ![]() Joined: 07 January 2009 Location: Czech Republic Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
You can force update your toolbar from WM_KICKIDLE message handler
for example: ON_MESSAGE(WM_KICKIDLE, &CDlg::OnKickIdle) LRESULT CDlg::OnKickIdle(WPARAM, LPARAM) { SendMessageToDescendants(WM_IDLEUPDATECMDUI); return 0; } |
|
![]() |
|
dearvivekkumar ![]() Newbie ![]() Joined: 13 June 2012 Location: New Delhi Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
I have tried WM_KICKIDLE, still I'm not getting call on the update handler for the toolbar.
One more thing, the toolbar is on modaless dialog in fact in docking pane. And i'm getting call to Update handler only when I click on the toolbar button. And after that on command event handler. |
|
![]() |
|
dearvivekkumar ![]() Newbie ![]() Joined: 13 June 2012 Location: New Delhi Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Even I am not getting call to WM_KICKIDLE handler?
is there some thing I am missing?? |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |