how to make a wxPanel like Layer

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
ifvimy
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 16, 2019 6:29 am

how to make a wxPanel like Layer

Post by ifvimy » Tue Dec 03, 2019 8:50 am

Code: Select all

panel1 = new wxPanel(this, wxID_ANY);
panel2 = new wxPanel(this, wxID_ANY);

wxButton *btn1 = new wxButton(panel1, 10000, "Btn1", wxPoint(50, 100) );
wxButton *btn2 = new wxButton(panel1, 10001, "Btn2", wxPoint(150, 100) );
Bind wxSizeEvent, and in OnSize

Code: Select all

panel1->SetSize(event.GetSize());
panel2->SetSize(event.GetSize());
However, the two buttons don't hide, it seems like the panel1 isn't covered by panel2.What should I do?

User avatar
doublemax
Moderator
Moderator
Posts: 14285
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: how to make a wxPanel like Layer

Post by doublemax » Tue Dec 03, 2019 12:04 pm

wxWidgets doesn't support overlapping siblings. What exactly do you want to achieve?
Use the source, Luke!

ifvimy
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 16, 2019 6:29 am

Re: how to make a wxPanel like Layer

Post by ifvimy » Thu Dec 05, 2019 3:15 am

Thanks for your reply. I want to overlap some wxPanels, each wxPanel I want to place different content, and the top wxPanel only show other wxPanel's content.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2088
Joined: Sun Jan 03, 2010 5:45 pm

Re: how to make a wxPanel like Layer

Post by PB » Thu Dec 05, 2019 7:17 am

I am not sure what exactly do you need. If what you need is to switch visible panels based on some action/context, there is wxSimpleBook, which is basically a wxBookCtrl without visible tabs.

Another type of layout is supported by 3rd party control wxAccordion, where several panels may be shown at once or just their headers can be visible.

ifvimy
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 16, 2019 6:29 am

Re: how to make a wxPanel like Layer

Post by ifvimy » Sun Dec 08, 2019 1:44 am

Thanks for your reply. I mean I need to overlying wxPanels.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3580
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: how to make a wxPanel like Layer

Post by ONEEYEMAN » Mon Dec 09, 2019 3:39 pm

Hi,
Yes, we got that.
But what is the purpose of them?

Are you trying like see-through panel, with the other one having a bitmap?
Or something else?

Please describe the problem you are trying to solve.

Thank you.

ifvimy
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 16, 2019 6:29 am

Re: how to make a wxPanel like Layer

Post by ifvimy » Tue Dec 10, 2019 8:01 am

Thanks for your reply. Maybe see-through panel will work.

ifvimy
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 16, 2019 6:29 am

Re: how to make a wxPanel like Layer

Post by ifvimy » Tue Dec 10, 2019 8:19 am

ONEEYEMAN wrote:
Mon Dec 09, 2019 3:39 pm
Hi,
Yes, we got that.
But what is the purpose of them?

Are you trying like see-through panel, with the other one having a bitmap?
Or something else?

Please describe the problem you are trying to solve.

Thank you.
We want to put Arcgis map(Activexcontainer inherit wxPanel) at the bottom, and another wxPanel covered it, which placed buttons and painted. However, the button can't click.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3580
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: how to make a wxPanel like Layer

Post by ONEEYEMAN » Tue Dec 10, 2019 6:02 pm

Hi,
You mean something like wxOverlay?

Thank you.

Post Reply