]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/aui/auidemo.cpp
A call to wxPopupWindow::Show shouldn't automatically cause the popup window to steal...
[wxWidgets.git] / samples / aui / auidemo.cpp
index fca8e1c612b5199a06c11934d0c8a2048386abba..519a3fb7148693d580ea9f787e3dc94b9d7a1bac 100644 (file)
@@ -1451,7 +1451,7 @@ void MyFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& evt)
 
 void MyFrame::OnTabAlignment(wxCommandEvent &evt)
 {
-   size_t i, count;
+    size_t i, count;
     wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
     for (i = 0, count = all_panes.GetCount(); i < count; ++i)
     {
@@ -1460,10 +1460,14 @@ void MyFrame::OnTabAlignment(wxCommandEvent &evt)
         {
             wxAuiNotebook* nb = (wxAuiNotebook*)pane.window;
 
+            long style = nb->GetWindowStyleFlag();
+            style &= ~(wxAUI_NB_TOP | wxAUI_NB_BOTTOM);
             if (evt.GetId() == ID_NotebookAlignTop)
-                nb->SetWindowStyleFlag(nb->GetWindowStyleFlag()^wxAUI_NB_BOTTOM|wxAUI_NB_TOP);
-           else if (evt.GetId() == ID_NotebookAlignBottom)
-               nb->SetWindowStyleFlag(nb->GetWindowStyleFlag()^wxAUI_NB_TOP|wxAUI_NB_BOTTOM);
+                style |= wxAUI_NB_TOP;
+            else if (evt.GetId() == ID_NotebookAlignBottom)
+                style |= wxAUI_NB_BOTTOM;
+            nb->SetWindowStyleFlag(style);
+
             nb->Refresh();
         }
     }
@@ -1574,13 +1578,14 @@ wxAuiNotebook* MyFrame::CreateNotebook()
                                     wxPoint(client_size.x, client_size.y),
                                     wxSize(430,200),
                                     m_notebook_style);
+   ctrl->Freeze();
 
    wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
 
    ctrl->AddPage(CreateHTMLCtrl(ctrl), wxT("Welcome to wxAUI") , false, page_bmp);
 
    wxPanel *panel = new wxPanel( ctrl, wxID_ANY );
-   wxFlexGridSizer *flex = new wxFlexGridSizer( 2 );
+   wxFlexGridSizer *flex = new wxFlexGridSizer( 4, 2, 0, 0 );
    flex->AddGrowableRow( 0 );
    flex->AddGrowableRow( 3 );
    flex->AddGrowableCol( 1 );
@@ -1620,6 +1625,7 @@ wxAuiNotebook* MyFrame::CreateNotebook()
    ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
                 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 8") );
 
+   ctrl->Thaw();
    return ctrl;
 }