How do you get the CaptionBar from a FoldPanelBar?

Hello all,

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 :smiley:

So um… I’m feeling a bit left out here guys :frowning:

···

On Fri, Jul 16, 2010 at 7:12 PM, PyNo1 awainb@gmail.com wrote:

Hello all,

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 :smiley:

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

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 :stuck_out_tongue:

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,

Thanks,

···

On Tue, Jul 20, 2010 at 1:42 PM, Matthias nitrogenycs@googlemail.com wrote:

Am 20.07.2010, 19:18 Uhr, schrieb A Wain awainb@gmail.com:

Hello all,

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 :smiley:

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.

-Matthias

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

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 :stuck_out_tongue:

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,

--
Robin Dunn
Software Craftsman

So I’m feelin foolish, I was so busy looking for a function, I must have overlooked it.

I will give it a shot when i get home, ty Robin & Matthias

···

On Wed, Jul 21, 2010 at 1:19 PM, Robin Dunn robin@alldunn.com wrote:

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 :stuck_out_tongue:

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,

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.

Robin Dunn

Software Craftsman

http://wxPython.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

There probably should be an accessor function if modifying the caption bar is intended to be possible.

···

On 7/21/10 10:28 AM, A Wain wrote:

So I'm feelin foolish, I was so busy looking for a function, I must have
overlooked it.

--
Robin Dunn
Software Craftsman