Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toolbar reset makes SetCaption() undone?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar reset makes SetCaption() undone?

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar reset makes SetCaption() undone?
    Posted: 17 January 2008 at 10:05am

I have a toolbar which is loaded from a resource IDR_TOOL. Then I replace certain strings using FindControl(...)->SetCaption(...). Now, if the user clicks "Reset toolbar" in the application my custom caption strings seem to be reset.

Is this the right behavior? I guess I have to catch a "reset" event and call SetCaption again... am I right?
 
Thanks!
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2008 at 11:11am
ON_MESSAGE(WM_XTP_CUSTOMIZATION_RESETTOOLBAR, OnResetToolBar)
 
Then update the toolbar captions in OnResetToolBar. In case somebody encounters the same problem...
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2008 at 2:15am

Hi,

Better in OnCreate after you modifyed all buttons and before you call  LoadCommandBars add
 
pToolBar->GetControls()->CreateOriginalControls(); - it will create "original" version to reset.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.