Print Page | Close Window

ON_UPDATE_COMMAND_UI Prob using SetCheck

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=202
Printed Date: 05 May 2024 at 1:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ON_UPDATE_COMMAND_UI Prob using SetCheck
Posted By: stuebing
Subject: ON_UPDATE_COMMAND_UI Prob using SetCheck
Date 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



Replies:
Posted By: Oleg
Date Posted: 30 October 2003 at 8:58am

Hi, Andreas

Don't understand how do you use handler. Give me please piece of code.



Posted By: stuebing
Date Posted: 30 October 2003 at 10:03am
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


Posted By: Oleg
Date Posted: 03 November 2003 at 11:50pm

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.



Posted By: bmaurice
Date Posted: 29 November 2005 at 8:11pm
Originally posted by oleg oleg wrote:

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.

We have 9600 resource how are we supposed to avoid conflicts?



Posted By: Oleg
Date Posted: 30 November 2005 at 1:35am

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


Posted By: bmaurice
Date Posted: 30 November 2005 at 5:38pm

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.



Posted By: Oleg
Date Posted: 01 December 2005 at 5:20am

You can manually edit all Resource.h from Source directory

f.e

Source\CommandBars\Resource.h



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net