]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/aui/auidemo.cpp
common private decls
[wxWidgets.git] / samples / aui / auidemo.cpp
index fd094e791fd5a0c97d0334de02b7d58f06be8b68..c695aa025c6cf73c471ff0edd845e9a1c9749c07 100644 (file)
@@ -269,14 +269,15 @@ class SettingsPanel : public wxPanel
 public:
 
     SettingsPanel(wxWindow* parent, MyFrame* frame)
 public:
 
     SettingsPanel(wxWindow* parent, MyFrame* frame)
-            : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
+            : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize),
+              m_frame(frame)
     {
         //wxBoxSizer* vert = new wxBoxSizer(wxVERTICAL);
 
         //vert->Add(1, 1, 1, wxEXPAND);
 
         wxBoxSizer* s1 = new wxBoxSizer(wxHORIZONTAL);
     {
         //wxBoxSizer* vert = new wxBoxSizer(wxVERTICAL);
 
         //vert->Add(1, 1, 1, wxEXPAND);
 
         wxBoxSizer* s1 = new wxBoxSizer(wxHORIZONTAL);
-        m_border_size = new wxSpinCtrl(this, ID_PaneBorderSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
+        m_border_size = new wxSpinCtrl(this, ID_PaneBorderSize, wxString::Format(wxT("%d"), frame->GetDockArt()->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE)), wxDefaultPosition, wxSize(50,20), wxSP_ARROW_KEYS, 0, 100, frame->GetDockArt()->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE));
         s1->Add(1, 1, 1, wxEXPAND);
         s1->Add(new wxStaticText(this, wxID_ANY, wxT("Pane Border Size:")));
         s1->Add(m_border_size);
         s1->Add(1, 1, 1, wxEXPAND);
         s1->Add(new wxStaticText(this, wxID_ANY, wxT("Pane Border Size:")));
         s1->Add(m_border_size);
@@ -285,7 +286,7 @@ public:
         //vert->Add(s1, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
 
         wxBoxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
         //vert->Add(s1, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
 
         wxBoxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
-        m_sash_size = new wxSpinCtrl(this, ID_SashSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
+        m_sash_size = new wxSpinCtrl(this, ID_SashSize, wxString::Format(wxT("%d"), frame->GetDockArt()->GetMetric(wxAUI_DOCKART_SASH_SIZE)), wxDefaultPosition, wxSize(50,20), wxSP_ARROW_KEYS, 0, 100, frame->GetDockArt()->GetMetric(wxAUI_DOCKART_SASH_SIZE));
         s2->Add(1, 1, 1, wxEXPAND);
         s2->Add(new wxStaticText(this, wxID_ANY, wxT("Sash Size:")));
         s2->Add(m_sash_size);
         s2->Add(1, 1, 1, wxEXPAND);
         s2->Add(new wxStaticText(this, wxID_ANY, wxT("Sash Size:")));
         s2->Add(m_sash_size);
@@ -294,7 +295,7 @@ public:
         //vert->Add(s2, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
 
         wxBoxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
         //vert->Add(s2, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
 
         wxBoxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
-        m_caption_size = new wxSpinCtrl(this, ID_CaptionSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
+        m_caption_size = new wxSpinCtrl(this, ID_CaptionSize, wxString::Format(wxT("%d"), frame->GetDockArt()->GetMetric(wxAUI_DOCKART_CAPTION_SIZE)), wxDefaultPosition, wxSize(50,20), wxSP_ARROW_KEYS, 0, 100, frame->GetDockArt()->GetMetric(wxAUI_DOCKART_CAPTION_SIZE));
         s3->Add(1, 1, 1, wxEXPAND);
         s3->Add(new wxStaticText(this, wxID_ANY, wxT("Caption Size:")));
         s3->Add(m_caption_size);
         s3->Add(1, 1, 1, wxEXPAND);
         s3->Add(new wxStaticText(this, wxID_ANY, wxT("Caption Size:")));
         s3->Add(m_caption_size);
@@ -402,7 +403,6 @@ public:
         SetSizer(cont_sizer);
         GetSizer()->SetSizeHints(this);
 
         SetSizer(cont_sizer);
         GetSizer()->SetSizeHints(this);
 
-        m_frame = frame;
         m_border_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE));
         m_sash_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_SASH_SIZE));
         m_caption_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_CAPTION_SIZE));
         m_border_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE));
         m_sash_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_SASH_SIZE));
         m_caption_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_DOCKART_CAPTION_SIZE));
@@ -548,6 +548,9 @@ END_EVENT_TABLE()
 
 bool MyApp::OnInit()
 {
 
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     wxFrame* frame = new MyFrame(NULL,
                                  wxID_ANY,
                                  wxT("wxAUI Sample Application"),
     wxFrame* frame = new MyFrame(NULL,
                                  wxID_ANY,
                                  wxT("wxAUI Sample Application"),
@@ -626,7 +629,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_UPDATE_UI(ID_HorizontalGradient, MyFrame::OnUpdateUI)
     EVT_MENU_RANGE(MyFrame::ID_FirstPerspective, MyFrame::ID_FirstPerspective+1000,
                    MyFrame::OnRestorePerspective)
     EVT_UPDATE_UI(ID_HorizontalGradient, MyFrame::OnUpdateUI)
     EVT_MENU_RANGE(MyFrame::ID_FirstPerspective, MyFrame::ID_FirstPerspective+1000,
                    MyFrame::OnRestorePerspective)
-    EVT_AUI_PANECLOSE(MyFrame::OnPaneClose)
+    EVT_AUI_PANE_CLOSE(MyFrame::OnPaneClose)
     EVT_AUINOTEBOOK_ALLOW_DND(wxID_ANY, MyFrame::OnAllowNotebookDnD)
     EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, MyFrame::OnNotebookPageClose)
 END_EVENT_TABLE()
     EVT_AUINOTEBOOK_ALLOW_DND(wxID_ANY, MyFrame::OnAllowNotebookDnD)
     EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, MyFrame::OnNotebookPageClose)
 END_EVENT_TABLE()
@@ -793,6 +796,7 @@ MyFrame::MyFrame(wxWindow* parent,
     tb4->AddTool(101, wxT("Item 6"), tb4_bmp1);
     tb4->AddTool(101, wxT("Item 7"), tb4_bmp1);
     tb4->AddTool(101, wxT("Item 8"), tb4_bmp1);
     tb4->AddTool(101, wxT("Item 6"), tb4_bmp1);
     tb4->AddTool(101, wxT("Item 7"), tb4_bmp1);
     tb4->AddTool(101, wxT("Item 8"), tb4_bmp1);
+    tb4->AddControl(new wxComboBox(tb4, -1));
     tb4->Realize();
 
     // create some toolbars
     tb4->Realize();
 
     // create some toolbars
@@ -1281,7 +1285,7 @@ wxPoint MyFrame::GetStartPosition()
 void MyFrame::OnCreateTree(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateTreeCtrl(), wxAuiPaneInfo().
 void MyFrame::OnCreateTree(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateTreeCtrl(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("Tree Control")).
+                  Caption(wxT("Tree Control")).
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(150,300)));
     m_mgr.Update();
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(150,300)));
     m_mgr.Update();
@@ -1290,7 +1294,7 @@ void MyFrame::OnCreateTree(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnCreateGrid(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateGrid(), wxAuiPaneInfo().
 void MyFrame::OnCreateGrid(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateGrid(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("Grid")).
+                  Caption(wxT("Grid")).
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(300,200)));
     m_mgr.Update();
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(300,200)));
     m_mgr.Update();
@@ -1299,7 +1303,7 @@ void MyFrame::OnCreateGrid(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnCreateHTML(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateHTMLCtrl(), wxAuiPaneInfo().
 void MyFrame::OnCreateHTML(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateHTMLCtrl(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("HTML Control")).
+                  Caption(wxT("HTML Control")).
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(300,200)));
     m_mgr.Update();
                   Float().FloatingPosition(GetStartPosition()).
                   FloatingSize(wxSize(300,200)));
     m_mgr.Update();
@@ -1308,7 +1312,7 @@ void MyFrame::OnCreateHTML(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnCreateNotebook(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateNotebook(), wxAuiPaneInfo().
 void MyFrame::OnCreateNotebook(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateNotebook(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("Notebook")).
+                  Caption(wxT("Notebook")).
                   Float().FloatingPosition(GetStartPosition()).
                   //FloatingSize(300,200).
                   CloseButton(true).MaximizeButton(true));
                   Float().FloatingPosition(GetStartPosition()).
                   //FloatingSize(300,200).
                   CloseButton(true).MaximizeButton(true));
@@ -1318,7 +1322,7 @@ void MyFrame::OnCreateNotebook(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnCreateText(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateTextCtrl(), wxAuiPaneInfo().
 void MyFrame::OnCreateText(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateTextCtrl(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("Text Control")).
+                  Caption(wxT("Text Control")).
                   Float().FloatingPosition(GetStartPosition()));
     m_mgr.Update();
 }
                   Float().FloatingPosition(GetStartPosition()));
     m_mgr.Update();
 }
@@ -1326,7 +1330,7 @@ void MyFrame::OnCreateText(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnCreateSizeReport(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
 void MyFrame::OnCreateSizeReport(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
-                  Name(wxT("Test")).Caption(wxT("Client Size Reporter")).
+                  Caption(wxT("Client Size Reporter")).
                   Float().FloatingPosition(GetStartPosition()).
                   CloseButton(true).MaximizeButton(true));
     m_mgr.Update();
                   Float().FloatingPosition(GetStartPosition()).
                   CloseButton(true).MaximizeButton(true));
     m_mgr.Update();
@@ -1469,6 +1473,7 @@ wxAuiNotebook* MyFrame::CreateNotebook()
    panel->SetSizer( flex );
    ctrl->AddPage( panel, wxT("wxPanel"), false, page_bmp );
    
    panel->SetSizer( flex );
    ctrl->AddPage( panel, wxT("wxPanel"), false, page_bmp );
    
+   
    ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some text"),
                 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 1"), false, page_bmp );
                 
    ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some text"),
                 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 1"), false, page_bmp );