]> git.saurik.com Git - wxWidgets.git/commitdiff
GtkMyFixed is now more "GTK 1.2.3 ready".
authorRobert Roebling <robert@roebling.de>
Thu, 20 May 1999 14:32:04 +0000 (14:32 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 20 May 1999 14:32:04 +0000 (14:32 +0000)
  Test added to notebook sample (showing that GTK
  1.2.3 is not GTK 1.2.3 ready).
  Touched frame?

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/notebook/test.cpp
samples/notebook/test.h
src/gtk/frame.cpp
src/gtk/win_gtk.c
src/gtk1/frame.cpp
src/gtk1/win_gtk.c

index 4070a935bd20c305ae892b16a087c189aad8b0ce..4f3b57893fec2303253d4c59551f13de6de84a9d 100644 (file)
@@ -59,7 +59,7 @@ void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window)
 {
   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));
+  m_addPageButton = new wxButton(window, ID_ADD_PAGE, "Add page", wxPoint(-1, -1), wxSize(80, 25));
   m_okButton->SetDefault();
 
   wxLayoutConstraints* c = new wxLayoutConstraints;
@@ -67,10 +67,10 @@ void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window)
   c->bottom.SameAs(window, wxBottom, 4);
   c->height.AsIs();
   c->width.AsIs();
-  m_helpButton->SetConstraints(c);
+  m_addPageButton->SetConstraints(c);
 
   c = new wxLayoutConstraints;
-  c->right.SameAs(m_helpButton, wxLeft, 4);
+  c->right.SameAs(m_addPageButton, wxLeft, 4);
   c->bottom.SameAs(window, wxBottom, 4);
   c->height.AsIs();
   c->width.AsIs();
@@ -101,7 +101,6 @@ void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window)
     wxTE_MULTILINE);
 
   notebook->AddPage(panel2, "Dog");
-
   wxPanel *panel3 = new wxPanel(notebook, -1);
   panel3->SetBackgroundColour(wxColour("WHITE"));
   notebook->AddPage(panel3, "Goat");
@@ -156,6 +155,7 @@ void MyDialog::Init(void)
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_BUTTON(wxID_OK, MyFrame::OnOK)
     EVT_BUTTON(wxID_CANCEL, MyFrame::OnOK)
+    EVT_BUTTON(ID_ADD_PAGE, MyFrame::OnAddPage)
     EVT_SIZE(MyFrame::OnSize)
 END_EVENT_TABLE()
 
@@ -168,6 +168,14 @@ MyFrame::MyFrame(wxFrame* parent, const wxWindowID id, const wxString& title,
     Init();
 }
 
+void MyFrame::OnAddPage(wxCommandEvent& WXUNUSED(event))
+{
+  wxPanel *panel = new wxPanel( m_notebook, -1 );
+  (void)new wxButton( panel, -1, "Button", wxPoint( 10,10 ), wxSize(-1,-1) );
+  m_notebook->AddPage( panel, "Added" );
+  m_notebook->SetSelection( m_notebook->GetPageCount()-1 );
+}
+
 void MyFrame::OnOK(wxCommandEvent& WXUNUSED(event) )
 {
     this->Destroy();
index 719948f708fd28613f4b01a46c78c6f8d2b69d09..dc40a2456497e52a14e1e09e8d386cdad7b64ea5 100644 (file)
@@ -20,7 +20,7 @@ public:
 
     wxButton*   m_okButton;
     wxButton*   m_cancelButton;
-    wxButton*   m_helpButton;
+    wxButton*   m_addPageButton;
 };
 
 DECLARE_APP(MyApp)
@@ -49,6 +49,7 @@ public:
 
     void OnOK(wxCommandEvent& event);
     void OnCloseWindow(wxCloseEvent& event);
+    void OnAddPage(wxCommandEvent& event);
     void OnSize(wxSizeEvent& event);
     void Init(void);
 protected:
@@ -76,4 +77,5 @@ DECLARE_EVENT_TABLE()
 #define TEST_TAB_AARDVARK   12
 
 #define ID_NOTEBOOK         1000
+#define ID_ADD_PAGE         1200
 
index e0b475caae32176b96775e8e35fb442c9b608a18..e2b33215317cc922bd36db9f8e04456e25a75fc7 100644 (file)
@@ -789,7 +789,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
         {
             /* yes: set it's size to fill all the frame */
             int client_x, client_y;
-            GetClientSize( &client_x, &client_y );
+            DoGetClientSize( &client_x, &client_y );
             child->SetSize( 1, 1, client_x-2, client_y-2 );
         }
     }
index 43f275e84010dffd5d1482cb562bc029db2a5364..e4fe2c1812ce0031f0b661f483f2e572b6b73d56 100644 (file)
@@ -225,14 +225,16 @@ gtk_myfixed_put (GtkMyFixed   *myfixed,
 
   myfixed->children = g_list_append (myfixed->children, child_info); 
 
-  if (GTK_WIDGET_REALIZED (myfixed) && !GTK_WIDGET_REALIZED (widget))
+  if (GTK_WIDGET_REALIZED (myfixed))
     gtk_widget_realize (widget);
 
-  if (GTK_WIDGET_MAPPED (myfixed) && !GTK_WIDGET_MAPPED (widget) && GTK_WIDGET_VISIBLE (widget))
-    gtk_widget_map (widget);
-
-  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
-    gtk_widget_queue_resize (GTK_WIDGET (myfixed));
+  if (GTK_WIDGET_VISIBLE (myfixed) && GTK_WIDGET_VISIBLE (widget))
+    {
+      if (GTK_WIDGET_MAPPED (myfixed))
+       gtk_widget_map (widget);
+      
+      gtk_widget_queue_resize (GTK_WIDGET (myfixed));
+    }
 }
 
 void
index e0b475caae32176b96775e8e35fb442c9b608a18..e2b33215317cc922bd36db9f8e04456e25a75fc7 100644 (file)
@@ -789,7 +789,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
         {
             /* yes: set it's size to fill all the frame */
             int client_x, client_y;
-            GetClientSize( &client_x, &client_y );
+            DoGetClientSize( &client_x, &client_y );
             child->SetSize( 1, 1, client_x-2, client_y-2 );
         }
     }
index 43f275e84010dffd5d1482cb562bc029db2a5364..e4fe2c1812ce0031f0b661f483f2e572b6b73d56 100644 (file)
@@ -225,14 +225,16 @@ gtk_myfixed_put (GtkMyFixed   *myfixed,
 
   myfixed->children = g_list_append (myfixed->children, child_info); 
 
-  if (GTK_WIDGET_REALIZED (myfixed) && !GTK_WIDGET_REALIZED (widget))
+  if (GTK_WIDGET_REALIZED (myfixed))
     gtk_widget_realize (widget);
 
-  if (GTK_WIDGET_MAPPED (myfixed) && !GTK_WIDGET_MAPPED (widget) && GTK_WIDGET_VISIBLE (widget))
-    gtk_widget_map (widget);
-
-  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
-    gtk_widget_queue_resize (GTK_WIDGET (myfixed));
+  if (GTK_WIDGET_VISIBLE (myfixed) && GTK_WIDGET_VISIBLE (widget))
+    {
+      if (GTK_WIDGET_MAPPED (myfixed))
+       gtk_widget_map (widget);
+      
+      gtk_widget_queue_resize (GTK_WIDGET (myfixed));
+    }
 }
 
 void