Change border of wxPanel Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Change border of wxPanel

Post by Elmi » Thu Sep 03, 2009 7:59 am

When I construct a wxPanel newly I can set a style ID that is responsible for drawing a border around that panel.

But is there also a possibility to change that border on an existing panel? If yes: how can I modify these style flags during runtime?

Thx

Elmi

ilovasz
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 10, 2007 6:56 pm

Post by ilovasz » Thu Sep 03, 2009 8:06 am

Hi,

did You try to use
void wxWindow::SetWindowStyle(long style)
to change the border or any other style for that matter?

LI

Muetdhiver
Super wx Problem Solver
Super wx Problem Solver
Posts: 323
Joined: Sun Jun 08, 2008 11:59 am
Location: Bordeaux, France

Re: Change border of wxPanel

Post by Muetdhiver » Thu Sep 03, 2009 12:34 pm

Elmi wrote:When I construct a wxPanel newly I can set a style ID that is responsible for drawing a border around that panel.

But is there also a possibility to change that border on an existing panel? If yes: how can I modify these style flags during runtime?

Thx

Elmi
Hello,

I think changing the border of a panel is a matter of window decoration, and it depends on your OS. For example under ubuntu, emerald is a specific window decorator that let you change the appearance of your panel. So you can only control it under wxWidgets in a specific way (normal, tool window, ...) via panel flags. In the same way, changing the border dimension is not possible to my mind, or I did not understand your needs.

Regards,
Alexandre.
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3

Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Post by Elmi » Mon Sep 07, 2009 5:24 pm

SetWindowStyle() works ... somehow. When I set the border flags wxSIMPLE_BORDER, wxDOUBLE_BORDER etc. this function applies the new border style to the panel - but it does not remove the old border. So the result looks really ugly. Also an Update() does not help.

So what could I do here? Removing the wxPanel and creating it new with other style flags is not an option...

Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Post by Elmi » Tue Sep 08, 2009 7:45 am

OK, also if the manual doesn't points tothat fact: these border-flags seem to be OS specific and it seems that they can'T be updated/modified during runtime. When testing under GTK none of the borders wordked that did something under MSW, so I implemented my own drawing functions.

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Tue Sep 08, 2009 3:30 pm

Elmi wrote:OK, also if the manual doesn't points tothat fact: these border-flags seem to be OS specific and it seems that they can'T be updated/modified during runtime. When testing under GTK none of the borders wordked that did something under MSW, so I implemented my own drawing functions.
If you got wx SVN checked out, you can update the Doxygen doc for this method and submit a patch :)
"Keyboard not detected. Press F1 to continue"
-- Windows

Post Reply