]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxCB_READONLY
authorRobert Roebling <robert@roebling.de>
Wed, 14 Apr 1999 12:58:23 +0000 (12:58 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 14 Apr 1999 12:58:23 +0000 (12:58 +0000)
  fixed MDI bug
  fixed GTK 1.2.0 compilation in wxMenu::something

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

samples/controls/controls.cpp
src/gtk/combobox.cpp
src/gtk/mdi.cpp
src/gtk/menu.cpp
src/gtk1/combobox.cpp
src/gtk1/mdi.cpp
src/gtk1/menu.cpp

index ae3aa14b97b5f560e961ab4a4b1ddf658de266e7..9b02248738d2dda22d949e8bb200e7bef68804c4 100644 (file)
@@ -484,7 +484,7 @@ m_text(NULL), m_notebook(NULL)
     m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
 
     panel = new wxPanel(m_notebook);
-    m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
+    m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices, wxCB_READONLY );
     (void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
     (void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
     (void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
index 98b3ba7b826e13921455ae5c9d733c47566ccae6..efbb27e187b643e06d528dfff30990923708ace9 100644 (file)
@@ -136,6 +136,9 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     gtk_widget_realize( GTK_COMBO(m_widget)->entry );
     gtk_widget_realize( GTK_COMBO(m_widget)->button );
 
+    if (style & wxCB_READONLY)
+        gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO(m_widget)->entry ), FALSE );
+
     gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
       GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
 
index 5df3bbfd17db05b47c26e4f7d7369a5bceb55a96..3eb711da9d002dbd77e68788c0d1f987e7f5ab6e 100644 (file)
@@ -112,6 +112,7 @@ void wxMDIParentFrame::OnInternalIdle()
     wxFrame::OnInternalIdle();
 
     wxMDIChildFrame *active_child_frame = GetActiveChild();
+    bool visible_child_menu = FALSE;
 
     wxNode *node = m_clientWindow->m_children.First();
     while (node)
@@ -120,7 +121,10 @@ void wxMDIParentFrame::OnInternalIdle()
         if (child_frame->m_menuBar)
         {
             if (child_frame == active_child_frame)
+           {
                gtk_widget_show( child_frame->m_menuBar->m_widget );
+              visible_child_menu = TRUE;
+           }
             else
                gtk_widget_hide( child_frame->m_menuBar->m_widget );
         }
@@ -128,7 +132,7 @@ void wxMDIParentFrame::OnInternalIdle()
     }
 
     /* show/hide parent menu bar as required */
-    if (m_frameMenuBar) m_frameMenuBar->Show( (active_child_frame == NULL) );
+    if (m_frameMenuBar) m_frameMenuBar->Show( !visible_child_menu );
 }
 
 void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
index cf3cf9a8dc9b4bf918a753fbe9e6725b596b1cd2..860adb822d5be91abfcf71205dc32bd16c598cea 100644 (file)
@@ -552,7 +552,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
         s << *pc;
     }
     
-    GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
+    GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
     
 #else
 
index 98b3ba7b826e13921455ae5c9d733c47566ccae6..efbb27e187b643e06d528dfff30990923708ace9 100644 (file)
@@ -136,6 +136,9 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     gtk_widget_realize( GTK_COMBO(m_widget)->entry );
     gtk_widget_realize( GTK_COMBO(m_widget)->button );
 
+    if (style & wxCB_READONLY)
+        gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO(m_widget)->entry ), FALSE );
+
     gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
       GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
 
index 5df3bbfd17db05b47c26e4f7d7369a5bceb55a96..3eb711da9d002dbd77e68788c0d1f987e7f5ab6e 100644 (file)
@@ -112,6 +112,7 @@ void wxMDIParentFrame::OnInternalIdle()
     wxFrame::OnInternalIdle();
 
     wxMDIChildFrame *active_child_frame = GetActiveChild();
+    bool visible_child_menu = FALSE;
 
     wxNode *node = m_clientWindow->m_children.First();
     while (node)
@@ -120,7 +121,10 @@ void wxMDIParentFrame::OnInternalIdle()
         if (child_frame->m_menuBar)
         {
             if (child_frame == active_child_frame)
+           {
                gtk_widget_show( child_frame->m_menuBar->m_widget );
+              visible_child_menu = TRUE;
+           }
             else
                gtk_widget_hide( child_frame->m_menuBar->m_widget );
         }
@@ -128,7 +132,7 @@ void wxMDIParentFrame::OnInternalIdle()
     }
 
     /* show/hide parent menu bar as required */
-    if (m_frameMenuBar) m_frameMenuBar->Show( (active_child_frame == NULL) );
+    if (m_frameMenuBar) m_frameMenuBar->Show( !visible_child_menu );
 }
 
 void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
index cf3cf9a8dc9b4bf918a753fbe9e6725b596b1cd2..860adb822d5be91abfcf71205dc32bd16c598cea 100644 (file)
@@ -552,7 +552,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
         s << *pc;
     }
     
-    GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
+    GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
     
 #else