X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/028003016290b62becb31873c38a202d6e61eec4..aeafc354935512ddba84502bc60ca3b6246c14ce:/samples/notebook/test.cpp diff --git a/samples/notebook/test.cpp b/samples/notebook/test.cpp index f86b14b797..4070a935bd 100644 --- a/samples/notebook/test.cpp +++ b/samples/notebook/test.cpp @@ -20,7 +20,6 @@ #include "wx/wx.h" #endif -#include "wx/tab.h" #include "test.h" // If 1, use a dialog. Otherwise use a frame. @@ -44,15 +43,20 @@ bool MyApp::OnInit(void) #else frame = new MyFrame((wxFrame*) NULL, -1, (char *) "Notebook", wxPoint(-1, -1), wxSize(365, 390), wxDEFAULT_FRAME_STYLE); + // Problem with generic wxNotebook implementation whereby it doesn't size properly unless + // you set the size again +#if defined(__WIN16__) + int width, height; + frame->GetSize(& width, & height); + frame->SetSize(-1, -1, width, height); +#endif + return TRUE; #endif } void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window) { - int dialogWidth = 365; - int dialogHeight = 390; - m_okButton = new wxButton(window, wxID_OK, "Close", wxPoint(-1, -1), wxSize(80, 25)); m_cancelButton = new wxButton(window, wxID_CANCEL, "Cancel", wxPoint(-1, -1), wxSize(80, 25)); m_helpButton = new wxButton(window, wxID_HELP, "Help", wxPoint(-1, -1), wxSize(80, 25)); @@ -85,7 +89,7 @@ void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window) (void)new wxButton(panel1, -1, "Press me", wxPoint(10, 10)); (void)new wxTextCtrl(panel1, -1, "1234", wxPoint(10, 40), wxSize(120, 150)); - notebook->AddPage(panel1, "Cat"); + notebook->AddPage(panel1, "Cat", TRUE); wxPanel *panel2 = new wxPanel(notebook, -1); panel2->SetBackgroundColour(wxColour("BLUE")); @@ -131,9 +135,6 @@ void MyDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event) ) void MyDialog::Init(void) { - int dialogWidth = 365; - int dialogHeight = 390; - m_notebook = new wxNotebook(this, ID_NOTEBOOK); wxLayoutConstraints* c = new wxLayoutConstraints; @@ -179,9 +180,6 @@ void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event) ) void MyFrame::Init(void) { - int dialogWidth = 365; - int dialogHeight = 390; - m_panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxCLIP_CHILDREN); // Note, omit the wxTAB_STYLE_COLOUR_INTERIOR, so we will guarantee a match