Hi all.
First, let me say this framework is very very cool and useful! (I'm using it through wxPython).
I've a question: How can I change the font for the caption in a given pane ? I can't realize how to do it by SetArtProvider.
Thank you in advance !
Kirix Support Forums
Changing font properties
9 posts
• Page 1 of 1
Try
Please let me know if this works for you.
Thanks,
Ben
- Code: Select all
m_mgr.GetArtProvider()->SetFont(font);
Please let me know if this works for you.
Thanks,
Ben
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
bwilliams wrote:Try
- Code: Select all
m_mgr.GetArtProvider()->SetFont(font);
Please let me know if this works for you.
Thanks,
Ben
Hi, thank You for the answer...
I've tried it, but:
1- In 'SetFont' (and in each other AuiDockArt methods), the first parameter is 'id', which I don't know what it must be... ?
2 - Just to see if it works, I've tried to do this (Python code) :
ap = self.mgr.GetArtProvider()
self.mgr.SetArtProvider(ap)
but sometimes a system error pops up when closing my application, and sometimes the frame doesn't show at all...
Is there a way to clear up my mind ? Thanks again!
- Diego
- Registered User
- Posts: 5
- Joined: Sun Jan 07, 2007 8:31 pm
Hi,
Sorry, I missed a parameter:
It should be
Regarding your other question, I'm not sure if that will work because, when SetArtProvider() is called, the old art provider is destroyed, which in this case is the one you wish to set. So I would expect in this case some spurious behavior.
Best,
Ben
Sorry, I missed a parameter:
It should be
- Code: Select all
m_mgr.GetArtProvider()->SetFont(wxAUI_DOCKART_CAPTION_FONT, font);
Regarding your other question, I'm not sure if that will work because, when SetArtProvider() is called, the old art provider is destroyed, which in this case is the one you wish to set. So I would expect in this case some spurious behavior.
Best,
Ben
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Thanks a lot ! It works!
(About the 'SetArtProvider' issue: indeed, I suspected that was a 'dead pointer' problem... just a trivial point )
Your tool is very great! (It will be AWESOME when you'll integrate the AuiManager and AuiNotebook's behavior to cooperate in a transparent way )
Regards, Diego.
(About the 'SetArtProvider' issue: indeed, I suspected that was a 'dead pointer' problem... just a trivial point )
Your tool is very great! (It will be AWESOME when you'll integrate the AuiManager and AuiNotebook's behavior to cooperate in a transparent way )
Regards, Diego.
- Diego
- Registered User
- Posts: 5
- Joined: Sun Jan 07, 2007 8:31 pm
Re: Changing font properties
With that command all panes managed by that manager will be modfied, isn't it?
Is there a way to change the font for a single pane, like the pane with the name _("Dif_Font")?
Is there a way to change the font for a single pane, like the pane with the name _("Dif_Font")?
- tncalucard
- Registered User
- Posts: 14
- Joined: Mon Oct 08, 2007 9:30 am
Re: Changing font properties
Yes, there is. You must create an art provider that is custom-tailored to implement pane-specific drawing routines. This might sound involved, but it's really not that bad. Just derive an art provider from the default art provider which looks for a specific pane.
Best,
Ben
Best,
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Re: Changing font properties
Could you give me an exemple, because every time I try to change the font, the manager change in all panes.
- tncalucard
- Registered User
- Posts: 14
- Joined: Mon Oct 08, 2007 9:30 am
Re: Changing font properties
Hello,
I'm sorry, right now I don't have time to program this for you. What you need to do is quite straightforward. You need to create a class derived from wxAuiDefaultDockArt (which is in aui). Override the following method:
Next you need to look for the pane you want to have the custom font. If the pane matches, use your drawing code, otherwise call the base class version of DrawCaption.
I hope this helps, and wish you luck.
Ben
I'm sorry, right now I don't have time to program this for you. What you need to do is quite straightforward. You need to create a class derived from wxAuiDefaultDockArt (which is in aui). Override the following method:
- Code: Select all
void wxAuiDefaultDockArt::DrawCaption(wxDC& dc, wxWindow *WXUNUSED(window),
const wxString& text,
const wxRect& rect,
wxAuiPaneInfo& pane)
Next you need to look for the pane you want to have the custom font. If the pane matches, use your drawing code, otherwise call the base class version of DrawCaption.
I hope this helps, and wish you luck.
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
9 posts
· Page 1 of 1
Return to wxAUI Questions, Thoughts & Feedback