Redraw pane-toolbar? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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...
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Why aren't you using ON_UPDATE_COMMAND_UI handle for this?
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Just tried that. The update-handler is never called (perhaps because the toolbar is inside a pane?). |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I've probably screwed up my command-routing. Anyway, there should be a function that explicitly redraws the toolbar. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Try to call RecalcLayout for it. Toolbar width can changed so you need handle it too.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Sure, this would be nice:
m_wndToolBar.GetCommandBars()->RecalcFrameLayout()
but... GetCommandBars() returns NULL...
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Yes! Works :)
Thanks!
|
|
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 |