Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Redraw pane-toolbar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redraw pane-toolbar?

 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: Redraw pane-toolbar?
    Posted: 03 September 2009 at 10:53am
In my pane:
 
m_wndToolBar.GetControls()->GetAt(0)->SetCaption("New title");
 
How do I redraw the toolbar? Usually, I would call GetCommandBars()->RedrawCommandBars(), but my pane has no commandbars...
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2009 at 11:51am
Why aren't you using ON_UPDATE_COMMAND_UI handle for this?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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: 04 September 2009 at 6:43am

Just tried that. The update-handler is never called (perhaps because the toolbar is inside a pane?).

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2009 at 6:54am
Hi;

I don't know your structure, but in my case it works as expected.

Pane contains
   CWnd derived object, that contains
       command bar object
       toolbar
       other CWnd derived objects

The message map of CWnd derived pane child handles ON_UPDATE_COMMAND_UI messages without further programming.

HTH
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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: 04 September 2009 at 9:20am

I've probably screwed up my command-routing. Anyway, there should be a function that explicitly redraws the toolbar.

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: 04 September 2009 at 11:11am

Hi,

Try to call RecalcLayout for it.  Toolbar width can changed so you need handle it too.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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: 07 September 2009 at 3:16am
Sure, this would be nice:
m_wndToolBar.GetCommandBars()->RecalcFrameLayout()
 
but... GetCommandBars() returns NULL...
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: 07 September 2009 at 6:42am
Hi,
 
You have single toolbar, so it doesn't have CommandBars.
 
Think, bet way is to move code you have in OnSize handler to separate funciton and call it when you need recalculate layout.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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: 07 September 2009 at 8:17am
Yes! Works :)
 
Thanks!
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.187 seconds.