So I've been sitting here pulling my hair out for the last few hours
trying to figure out how to resize the CaptionBar of a FoldPanelBar? I
have used SetCaptionFont() to change the font to one that has a point
size of 16, problem I keep running into is that the FoldPanelBar does
not seem to update the caption's height to fit the new font size and
only the tol half of the text is showing.
Any ideas how I may resize the CaptionBar? Or maybe how I can override
the default CaptionBar with a custom one?
I agree with your logic but the problem I have is I can’t figure out how to obtain the CaptionBar from the control to set it’s size
The only way I have been able to obtain the bar (somewhat) is during and EVT_CAPTION, using event.GetBar(). Problem is that I would like to init the size before creating the control,
So I’ve been sitting here pulling my hair out for the last few hours
trying to figure out how to resize the CaptionBar of a FoldPanelBar? I
have used SetCaptionFont() to change the font to one that has a point
size of 16, problem I keep running into is that the FoldPanelBar does
not seem to update the caption’s height to fit the new font size and
only the tol half of the text is showing.
Any ideas how I may resize the CaptionBar? Or maybe how I can override
the default CaptionBar with a custom one?
Any help would be greatly appreciated
From reading the FoldPanelBar code it seems you have to do something like captionBar.SetSize( captionBar.DoGetBestSize() ) after you’ve changed the font. There are probably better ways to cause the layout to refresh though.
It's all in the source code. When you call AddFoldPanel an instance of the FoldPanelItem class is returned. The item has a _captionBar attribute.
···
On 7/20/10 10:55 AM, A Wain wrote:
Thanks for the reply Matthias,
I agree with your logic but the problem I have is I can't figure out how
to obtain the CaptionBar from the control to set it's size
The only way I have been able to obtain the bar (somewhat) is during and
EVT_CAPTION, using event.GetBar(). Problem is that I would like to init
the size before creating the control,