Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / panels and sizers

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. panels and sizers
#2917
Posted by: lea 2003-11-20 14:16:16
Hi!

Next question!
I tried to implement a wxFrame with a panel.
Doesn't seem to work like in Java, panel seems to be something else.

wxFrame has a sizer, the sizer has a panel.
It does not show anything, but when i put the panel out of the sizer it works.

Lets say it have two panels, and one wxFrame, how should i add the panels to a sizer, which i can set for the wxFrame?
Very confusing, found nothing in the whole net...

Thanks.
Message2. Re: panels and sizers
#2920
Posted by: upCASE 2003-11-20 17:35:38
Hi!
Try it by using wxGlade and after playing around with it it will be quite obvious :)

Seriously: A panel is nothing more then a blank space where you can put you controls on or draw on it.
If you have a wxFrame and show it, there will be a dark gray area, meaning it is blank. Adding a  wxPanel to that frame will make the client area show a light gray area. This is your panel coloured with the default system colour.

If you want to add two panles to a sizer/frame, set a box sizer for the frame and add both panels to it.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: panels and sizers
#2927
Posted by: lea 2003-11-20 23:19:58
Thx!

The problem was,  i did not set the size hints for the panel and did not set wxEXPAND, too.
So the panel was from 0,0,0,0 :(.

But works now as expected:).
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2023-2-4  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0