[ wxwindows-Bugs-1536659 ] Maximize eats controls
SourceForge.net
noreply at sourceforge.net
Tue Aug 8 06:03:25 PDT 2006
Bugs item #1536659, was opened at 2006-08-08 13:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1536659&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Phoenix_pl (phoenix_pl)
Assigned to: Nobody/Anonymous (nobody)
Summary: Maximize eats controls
Initial Comment:
07/08/2006
----------
First of all sorry for my English and grama. I’m not
sure where to place this and I know that CVS is “under
work”, but I have noticed something strange regarding
Maximize for wxFrame.
I have recompiled my project that was working on
wx2.6.3 to CVS build wx2.7.0 from 07/08/2006. I must
tell you that I didn’t have any problems with wx2.6.3,
but I wanted to see how wx2.7.0 is performing. And it
appears that there is a problem with displaying
controls or sizers. It seams that Maximize is doing
something wrong (deleting/hiding/changing) with sizers
or controls. I know that I can close Maximize between
Show/Hide and problem will disappears, but this
solution will damage message dialogs (like wxBusyInfo
displayed on background). It is not a big problem
because I’m still using wx2.6.3, but I just wanted to
point to possible problem.
What is happening:
I have created the main view frame using wxBoxSizers
and three wxPanels. One is placed at top of frame, rest
is placed horizontally in bottom part of frame. When I
display main frame top wxPanel disappears. Putting
wxBoxSizer::Fit() farther in the code shows that top
panel or sizer is not present. It seams that I have
only two horizontal panels.
I’m using:
- wxWidgets 2.7.0 CVS from 07/08/2006 static build with
Microsoft Visual C++ ToolKit
- Windows XP SP2 with XP look
- Code::Blocks IDE
Full source code with working binaries (compressed with
UPX):
http://republika.pl/pstarczewski/_images/wx2.7.0_sample.zip
Example on wrong behaviour (frame constructor):
MainFrame::MainFrame(wxWindow* parent,wxWindowID id)
{
m_close = false;
//(*Initialize(MainFrame)
Create(parent,id,_("evs"),wxDefaultPosition,wxDefaultSize,wxRESIZE_BORDER,_T(""));
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
Panel2 = new
wxPanel(this,ID_PANEL2,wxDefaultPosition,wxDefaultSize,0,_("ID_PANEL2"));
BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
MenuButton = new
wxButton(Panel2,ID_MENUBUTTON,_("Menu"),wxDefaultPosition,wxSize(-1,20),0,wxDefaultValidator,_("ID_MENUBUTTON"));
if (false) MenuButton->SetDefault();
CurrentTime = new
wxStaticText(Panel2,ID_CURRENTTIME,_("00:00:00
00/00/0000"),wxDefaultPosition,wxDefaultSize,wxALIGN_RIGHT,_("ID_CURRENTTIME"));
BoxSizer4->Add(MenuButton,0,wxLEFT|wxRIGHT|wxALIGN_CENTER,3);
BoxSizer4->Add(-1,-1,1);
BoxSizer4->Add(CurrentTime,0,wxLEFT|wxRIGHT|wxALIGN_CENTER,3);
Panel2->SetSizer(BoxSizer4);
BoxSizer4->Fit(Panel2);
BoxSizer4->SetSizeHints(Panel2);
BoxSizer2->Add(Panel2,1,wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND,0);
BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
view = new ViewPanel(this);
Panel1 = new
wxPanel(this,ID_PANEL1,wxDefaultPosition,wxDefaultSize,0,_("ID_PANEL1"));
BoxSizer5 = new wxBoxSizer(wxVERTICAL);
StaticText2 = new
wxStaticText(Panel1,ID_STATICTEXT2,_("i\nc\no\cn\ns"),wxDefaultPosition,wxDefaultSize,wxALIGN_CENTRE,_("ID_STATICTEXT2"));
BoxSizer5->Add(-1,-1,1);
BoxSizer5->Add(StaticText2,0,wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND,0);
BoxSizer5->Add(-1,-1,1);
Panel1->SetSizer(BoxSizer5);
BoxSizer5->Fit(Panel1);
BoxSizer5->SetSizeHints(Panel1);
BoxSizer3->Add(view,0,wxALL|wxALIGN_LEFT|wxALIGN_TOP,0);
BoxSizer3->Add(Panel1,1,wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND,0);
BoxSizer1->Add(BoxSizer2,1,wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND,0);
BoxSizer1->Add(BoxSizer3,0,wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND,0);
this->SetSizer(BoxSizer1);
BoxSizer1->Fit(this);
BoxSizer1->SetSizeHints(this);
//*)
//* Activate current time *//
wxDateTime now = wxDateTime::Now();
CurrentTime->SetLabel(now.Format(_T("%X %x")));
wxTimer *t = new wxTimer(this,ID_CLOCKTIMER);
t->Start(1000);
BoxSizer1->Fit(this);
// This should put window into fullscreen mode
(toplevel,no caption,no resize). For test it is just
maximized.
Maximize(true); // This line is removing top panel
from view.
/* Solution for it is to replace upper line with:
Show();
Maximize(true);
Hide();
*/
CreateMenus();
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1536659&group_id=9863
More information about the wx-dev
mailing list