R: [wx-dev] How to make Transparent sizers?
Baldassarre Cesarano
baldassarre.cesarano at eunics.it
Thu Aug 30 07:18:12 PDT 2007
I have tried:
..............
void OnPaintNothing (wxPaintEvent &WXUNUSED(event) ){};
void OnEraseBackgroundNothing (wxEraseEvent &WXUNUSED(event)){};
..............
wxStaticBox *item11 =3D new wxStaticBox( this, ID_Test_Sizer, wxT("Center")
);
wxStaticBoxSizer *item10 =3D new wxStaticBoxSizer( item11, wxVERTICAL );
=
item11->Connect( ID_Test_Sizer, wxEVT_ERASE_BACKGROUND,
wxEraseEventHandler(Frm_StartProcess::OnEraseBackgroundNothing) );
item11->Connect( ID_Test_Sizer, wxEVT_PAINT,
wxPaintEventHandler(Frm_StartProcess::OnPaintNothing));
..............
=
but not work: simply the box (and the text) is not displayed but the panel
remain opaque!
=
Ciao
Baldo
_____ =
Da: Kit Bishop [mailto:misc at bishop.net.nz] =
Inviato: gioved=EC 30 agosto 2007 13.06
A: wx-dev at lists.wxwidgets.org
Oggetto: Re: [wx-dev] R: [wx-dev] R: [wx-dev] How to make Transparent
sizers?
Baldassarre Cesarano wrote: =
My platform is wxMSW-2.8.5-rc3 - XP
Your work around does not work for me because I has a bitmap as background!
My impression is that wxStaticBox it has an own surface, and is not simply a
frame!
=
Ciao
Baldo
No, it wouldn't work for your case - presumably you handle the erase
background event (or paint event) for the parent panel to draw the bitmap in
the background. I wonder if in your case, you could handle the erase
background event for the static box to do nothing and hence make it
transparent - don't know if it will work but it might be worth a try.
wxStaticBoxSizer is an odd thing - it's used like a sizer but has a static
box. The main issue from my perspective is that the behaviour is different
between MSW and Linux with respect to inheriting the background colour.
Best regards,
Kit
=
_____ =
Da: Kit Bishop [mailto:misc at bishop.net.nz] =
Inviato: mercoled=EC 29 agosto 2007 22.04
A: wx-dev at lists.wxwidgets.org
Oggetto: Re: [wx-dev] R: [wx-dev] How to make Transparent sizers?
Baldassarre Cesarano wrote: =
Self-answer!
With wxBoxSizer the background image is visible, then ok.
The problem is with wxStaticBoxSizer (then wxStaticBox)...
_____ =
Da: Baldassarre Cesarano [mailto:baldassarre.cesarano at eunics.it] =
Inviato: mercoled=EC 29 agosto 2007 13.02
A: wx-dev at lists.wxwidgets.org
Oggetto: [wx-dev] How to make Transparent sizers?
Hi to all,
I have a wxFrame with a tiled background bitmap. =
With controls and sizers creation this image disappear!
The image is re-painted in the EVT_ERASE_BACKGROUND event =
=
How to make a transparent sizer showing background image of the parent
window?
=
Tnx!
Baldo
=
This sounds very much like an issue I asked about on wx-users recently.
What platform are you on? I am having the same problem with wx 2.8.4 under
openSuSE Linux 10.2. The same code works fine under MSW. It appears as if
the wxStaticBox is getting the default background rather than inheriting it
from the parent. I am currently using a work around that sets the
wxStaticBox background colour to the same colour as the parent background.
Best regard,
Kit Bishop
=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20070830/5fc4b=
b6a/attachment.htm
More information about the wx-dev
mailing list