ON_UPDATE_COMMAND_UI Prob using SetCheck |
Post Reply |
Author | |
stuebing
Newbie Joined: 29 October 2003 Location: Germany Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 30 October 2003 at 8:02am |
Hi,
currently I'm trying to get a pressed button in my toolbars using the "normal" ON_UPDATE_COMMAND_UI mechanism. However, it seems as all handlers are called for checking only, i.e. with a CTextCmdUI object. For this class a SetCheck is (silently) ignored.... Using the XTP FAQ Chapter 5 does not help either, because pCmdUI->m_pOther == 0 Any help where to look at? Ciao, Andreas |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Andreas Don't understand how do you use handler. Give me please piece of code. |
|
stuebing
Newbie Joined: 29 October 2003 Location: Germany Status: Offline Points: 14 |
Post Options
Thanks(0)
|
Hi Oleg,
ok, now I tried different things using two different buttons: an ID_EDIT_UNDO (MFC predefined ID 0xe12b) button and an ID_OWN (32771) button. The ID_EDIT_UNDO button has its handler in my CDocument derived class and is working as expected, e.g I used pCmd->SetCheck and pCmd->Enable. For my ID_OWN button I once tried a handler in my CDocument derived class and once in my CView derived class (only one active at a time). Inside the handler I tried once with SetCheck, once with SetPressed (a'la FAQ chapter 5). This button is working as expected if it is contained in my first toolbar and even the second toolbar. If it was contained my third toolbar (I'm using three toolbars) it only got enabled/disabled, but no longer checked. The ID_EDIT_UNDO button was working in all three toolbars. You noticed the change from present to past? I'm not quite sure what happened on testing for this reply, but somehow now it is working. The handler is currently in my CView derived class. Hopefully it keeps on working. Ciao, Andreas |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Please use SetCheck instead SetPressed. The last is internal method. Recommended to use identifiers from 130 to 9000 range to avoid conflicts with MFC values and XTreme resources. |
|
bmaurice
Newbie Joined: 29 November 2005 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
We have 9600 resource how are we supposed to avoid conflicts? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Better change it to 8600 f.e. and rebuild your application... Now we have now resource with id = 9600, but may be it will added in future.
We use id range from 9000 to 10000 |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
bmaurice
Newbie Joined: 29 November 2005 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
we are using resources from 101 to 9600 inclusive.. Could you add an offset base to your resources so we can shift them away from our range? P.S.: our resource range can not be shifted due to technical specs. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
You can manually edit all Resource.h from Source directory f.e Source\CommandBars\Resource.h |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |