]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/combobox.cpp
ignore clicks on a toolbar but outside any button
[wxWidgets.git] / src / gtk / combobox.cpp
index c138c48a42f01adad90ac78719a5474f177f2bb0..de35777f0b8bc2682090eac4e64d887837df7366 100644 (file)
@@ -178,9 +178,15 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     if (new_size.y > size_best.y)
         new_size.y = size_best.y;
     if ((new_size.x != size.x) || (new_size.y != size.y))
     if (new_size.y > size_best.y)
         new_size.y = size_best.y;
     if ((new_size.x != size.x) || (new_size.y != size.y))
+    {
         SetSize( new_size.x, new_size.y );
         SetSize( new_size.x, new_size.y );
+        
+        // This is required for tool bar support
+        gtk_widget_set_usize( m_widget, new_size.x, new_size.y );
+    }
 
 
-    SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW ) );
+
+    SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
     SetForegroundColour( parent->GetForegroundColour() );
 
     Show( TRUE );
     SetForegroundColour( parent->GetForegroundColour() );
 
     Show( TRUE );
@@ -287,7 +293,7 @@ wxClientData* wxComboBox::GetClientObject( int n )
 {
     wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
 
 {
     wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
 
-    wxNode *node = m_clientDataList.Nth( n );
+    wxNode *node = m_clientObjectList.Nth( n );
     if (!node) return (wxClientData*) NULL;
 
     return (wxClientData*) node->Data();
     if (!node) return (wxClientData*) NULL;
 
     return (wxClientData*) node->Data();
@@ -609,7 +615,26 @@ void wxComboBox::OnChar( wxKeyEvent &event )
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }
-            //else: do nothing, this will open the listbox
+            else
+            {
+                // This will invoke the dialog default action, such
+                // as the clicking the default button.
+    
+                wxWindow *top_frame = m_parent;
+                while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
+                top_frame = top_frame->GetParent();
+        
+                if (top_frame && GTK_IS_WINDOW(top_frame->m_widget))
+                {
+                    GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
+
+                    if (window->default_widget)
+                    {
+                        gtk_widget_activate (window->default_widget);
+                        return;
+                    }
+                }
+            }
         }
     }
 
         }
     }