]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/choice.cpp
scrolling to selection
[wxWidgets.git] / src / gtk / choice.cpp
index d4bcff0b9eba22a439664a0738803ce19791ade4..384f8b5d0048366b24c45f4d8736dff21b23c026 100644 (file)
@@ -73,6 +73,18 @@ wxChoice::wxChoice()
     m_strings = (wxSortedArrayString *)NULL;
 }
 
+bool wxChoice::Create( wxWindow *parent, wxWindowID id,
+                       const wxPoint &pos, const wxSize &size,
+                       const wxArrayString& choices,
+                       long style, const wxValidator& validator,
+                       const wxString &name )
+{
+    wxCArrayString chs(choices);
+
+    return Create( parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
+                   style, validator, name );
+}
+
 bool wxChoice::Create( wxWindow *parent, wxWindowID id,
                        const wxPoint &pos, const wxSize &size,
                        int n, const wxString choices[],
@@ -110,16 +122,8 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-
-    SetFont( parent->GetFont() );
-
-    SetBestSize(size);
-
-    SetBackgroundColour( parent->GetBackgroundColour() );
-    SetForegroundColour( parent->GetForegroundColour() );
-
-    Show( TRUE );
+    PostCreation(size);
+    SetBestSize(size); // need this too because this is a wxControlWithItems
 
     return TRUE;
 }
@@ -534,7 +538,7 @@ wxSize wxChoice::DoGetBestSize() const
         size_t count = GetCount();
         for ( size_t n = 0; n < count; n++ )
         {
-            GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font );
+            GetTextExtent( GetString(n), &width, NULL, NULL, NULL );
             if ( width > ret.x )
                 ret.x = width;
         }
@@ -570,6 +574,13 @@ bool wxChoice::IsOwnGtkWindow( GdkWindow *window )
 #endif
 }
 
+// static
+wxVisualAttributes
+wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+    return GetDefaultAttributesFromGTKWidget(gtk_option_menu_new);
+}
+
 
 #endif // wxUSE_CHOICE