Add wxCLOSE_BOX to wxFL samples (consider using wxDEFAULT_FRAME_STYLE).
Whitespace/typo fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// Purpose: Contrib. demo
|
||||
// Author: Aleksandras Gluchovas
|
||||
// Modified by: Sebastian Haase (June 21, 2001)
|
||||
// Created: 24/11/98
|
||||
// Created: 24/11/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Aleksandras Gluchovas
|
||||
// Licence: wxWindows license
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
{
|
||||
public:
|
||||
bool OnInit(void);
|
||||
};
|
||||
@@ -45,20 +45,20 @@ class MyFrame: public wxFrame
|
||||
protected:
|
||||
wxFrameLayout* mpLayout;
|
||||
wxWindow* mpClientWnd;
|
||||
|
||||
|
||||
wxTextCtrl* CreateTextCtrl( const wxString& value );
|
||||
|
||||
|
||||
public:
|
||||
MyFrame( wxWindow* parent, const wxChar *title );
|
||||
~MyFrame();
|
||||
|
||||
|
||||
void populateMyFrame();
|
||||
void OnLoad( wxCommandEvent& event );
|
||||
void OnStore( wxCommandEvent& event );
|
||||
void OnQuit( wxCommandEvent& event );
|
||||
|
||||
|
||||
bool OnClose(void) { return true; }
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
@@ -69,30 +69,30 @@ IMPLEMENT_APP (MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// wxWidgets boiler-plate:
|
||||
|
||||
|
||||
MyFrame *frame = new MyFrame(NULL, _("wxFrameLayout sample"));
|
||||
|
||||
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
||||
|
||||
file_menu->Append( ID_LOAD, _("&Load layout") );
|
||||
file_menu->Append( ID_STORE, _("&Store layout") );
|
||||
file_menu->AppendSeparator();
|
||||
|
||||
|
||||
file_menu->Append( ID_QUIT, _("E&xit") );
|
||||
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
||||
|
||||
menu_bar->Append(file_menu, _("&File"));
|
||||
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
frame->CreateStatusBar(3);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
|
||||
frame->Show(true);
|
||||
SetTopWindow(frame);
|
||||
frame->populateMyFrame();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||
: wxFrame( parent, wxID_ANY, title, wxDefaultPosition,
|
||||
wxSize( 700, 500 ),
|
||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX,
|
||||
wxT("freimas") )
|
||||
{
|
||||
}
|
||||
@@ -116,45 +116,45 @@ MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||
void MyFrame::populateMyFrame()
|
||||
{
|
||||
mpClientWnd = CreateTextCtrl( _("Client window") );
|
||||
|
||||
|
||||
mpLayout = new wxFrameLayout( this, mpClientWnd );
|
||||
|
||||
|
||||
/// mpLayout->PushDefaultPlugins();
|
||||
/// mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for barso
|
||||
/// //mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
|
||||
|
||||
cbDimInfo sizes( 80,65, // when docked horizontally
|
||||
80,165, // when docked vertically
|
||||
180,30, // when floated
|
||||
|
||||
cbDimInfo sizes( 80,65, // when docked horizontally
|
||||
80,165, // when docked vertically
|
||||
180,30, // when floated
|
||||
true, // the bar is fixed-size
|
||||
5, // vertical gap (bar border)
|
||||
5 // horizontal gap (bar border)
|
||||
);
|
||||
|
||||
// drop-in 20 bars
|
||||
);
|
||||
|
||||
// drop-in 20 bars
|
||||
for( int i = 1; i <= 10; ++i )
|
||||
{
|
||||
wxSleep(1);
|
||||
wxYield(); // CHECK!
|
||||
|
||||
|
||||
wxChar buf[4];
|
||||
wxSprintf( buf, wxT("%d"), i );
|
||||
wxString name = wxString(wxT("Bar-"));
|
||||
name += buf;
|
||||
|
||||
|
||||
//sizes.mIsFixed = i % 2 > 0; // every fifth bar is not fixed-size
|
||||
|
||||
|
||||
if ( !sizes.mIsFixed ) name += wxT(" (flexible)");
|
||||
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
|
||||
mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name),// bar window
|
||||
sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
|
||||
0, // insert into 0th row (vert. position)
|
||||
0, // offset from the start of row (in pixels)
|
||||
name // name to refere in customization pop-ups
|
||||
// mpLayout->AddBar( CreateTextCtrl(name), // bar window
|
||||
mpLayout->AddBar( new wxTextCtrl(this, wxID_ANY, name), // bar window
|
||||
sizes, i % MAX_PANES, // alignment ( 0-top,1-bottom, etc)
|
||||
0, // insert into 0th row (vert. position)
|
||||
0, // offset from the start of row (in pixels)
|
||||
name // name to refere in customization pop-ups
|
||||
);
|
||||
|
||||
mpLayout->RecalcLayout(true);
|
||||
|
||||
|
||||
// Layout();
|
||||
// Refresh();
|
||||
}
|
||||
@@ -163,17 +163,17 @@ void MyFrame::populateMyFrame()
|
||||
MyFrame::~MyFrame()
|
||||
{
|
||||
// layout is not a window, should be released manually
|
||||
if ( mpLayout )
|
||||
if ( mpLayout )
|
||||
delete mpLayout;
|
||||
}
|
||||
|
||||
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||
{
|
||||
wxTextCtrl* pCtrl = new wxTextCtrl( this, wxID_ANY, value,
|
||||
wxTextCtrl* pCtrl = new wxTextCtrl( this, wxID_ANY, value,
|
||||
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
|
||||
|
||||
|
||||
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
|
||||
|
||||
|
||||
return pCtrl;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Show( false ); // TRICK:: hide it, to avoid flickered destruction
|
||||
|
||||
|
||||
Close(true);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user