Print Page | Close Window

Redraw pane-toolbar?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=15112
Printed Date: 15 May 2024 at 1:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Redraw pane-toolbar?
Posted By: znakeeye
Subject: Redraw pane-toolbar?
Date 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...



Replies:
Posted By: mgampi
Date 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


Posted By: znakeeye
Date Posted: 04 September 2009 at 6:43am

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



Posted By: mgampi
Date 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


Posted By: znakeeye
Date 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.



Posted By: Oleg
Date 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


Posted By: znakeeye
Date Posted: 07 September 2009 at 3:16am
Sure, this would be nice:
m_wndToolBar.GetCommandBars()->RecalcFrameLayout()
 
but... GetCommandBars() returns NULL...


Posted By: Oleg
Date 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


Posted By: znakeeye
Date Posted: 07 September 2009 at 8:17am
Yes! Works :)
 
Thanks!



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