]> git.saurik.com Git - wxWidgets.git/commitdiff
distribution things
authorRobert Roebling <robert@roebling.de>
Wed, 10 Feb 1999 23:08:27 +0000 (23:08 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 10 Feb 1999 23:08:27 +0000 (23:08 +0000)
  implemented native docking for menus and toolbars
    (see toolbar sample) someone may have to create
    the new wxMenuBar constructor
  corrected wxFileDlg appearance and made it i18n
  implemented defaults buttons
  improved look of all common dlgs except print setup
  corrected forty's player dlg
  added wxMB_DOCKABLE and wxTB_DOCKABLE flags
  augmented BETA_VERSION to 4
  prevent wxListBox from sending a list_item_selected
    event when adding the first item to a list that
    is a single selection list using AppendXX()

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

32 files changed:
distrib/msw/gtk.rsp
distrib/msw/motif.rsp
docs/gtk/install.txt
docs/gtk/makewxgtk
docs/gtk/readme.txt
docs/gtk/todo.txt
include/wx/defs.h
include/wx/gtk/menu.h
include/wx/gtk1/menu.h
include/wx/version.h
samples/forty/playerdg.cpp
samples/toolbar/test.cpp
src/generic/choicdgg.cpp
src/generic/colrdlgg.cpp
src/generic/dirdlgg.cpp
src/generic/fontdlgg.cpp
src/generic/msgdlgg.cpp
src/generic/textdlgg.cpp
src/gtk/bmpbuttn.cpp
src/gtk/button.cpp
src/gtk/filedlg.cpp
src/gtk/listbox.cpp
src/gtk/menu.cpp
src/gtk/tbargtk.cpp
src/gtk/window.cpp
src/gtk1/bmpbuttn.cpp
src/gtk1/button.cpp
src/gtk1/filedlg.cpp
src/gtk1/listbox.cpp
src/gtk1/menu.cpp
src/gtk1/tbargtk.cpp
src/gtk1/window.cpp

index 53c4ef8ea555efb4ad836715d63bb09d43c521b8..6c53a637c5ba1c64c8cf21552dcd50b337da8a15 100644 (file)
@@ -20,7 +20,7 @@ include/install-sh
 
 src/Makefile
 src/Makefile.in
-src/*.inc
+src/gtk.inc
 src/make.env
 src/makelib.env
 src/makeprog.env
index 70e619436ea42e5d01366f97c9d2710c28f9e1e4..9af44964c0d0cfa22c8df7668dfc1302330114d6 100644 (file)
@@ -16,7 +16,7 @@ src/makelib.env
 
 src/Makefile
 src/Makefile.in
-src/*.inc
+src/motif.inc
 
 src/motif/*.cpp
 src/motif/*.c
index cc9979e03d1da9fe80af6a21d3286b6824bb3e3d..6aa0cd9fa116d1a310b68e1fb87415864632784f 100644 (file)
@@ -17,6 +17,12 @@ installed it, but you also have another version of the
 GTK installed, which you may need to removed including
 other versions of glib (and its headers).
 
+You get errors during compilation. The reason is that you
+probably have a broken compiler, which includes almost
+everything that is called gcc. If there is just any way
+for you to use egcs, use egcs. We are sorry, but we cannot
+fix gcc for the moment.
+
 * The most simple program
 -------------------------
 
@@ -48,7 +54,7 @@ this has no effect, but I tried...
 
 wxWindows/GTK requires the GTK+ library to be installed on your system.
 It has to be a stable version, preferebly version 1.0.6. When using
-a version previous to 1.0.6 you'll get crashes here and there.
+a version previous to 1.0.6 you'll might get crashes here and there.
 
 wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library
 and we will wait until the 1.2 version comes out and has stabilized
@@ -93,6 +99,10 @@ problem will disappear in the near future when all major
 Linux Variants have moved to glibc 2. Also, the Linux
 Base Standard will include glibc 2 and Posix threads.
 
+NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE
+ALL PROGRAMS WILL CRASH UPON START-UP. Just always
+use egcs and be happy.
+
 * Create your configuration
 -----------------------------
 
index 71971a3621448148cfd7914cbd0d9e4b096c4008..8956a8fe05b1f4fc6ac6777d8529c5b6c30feef9 100644 (file)
@@ -6,6 +6,6 @@
 # if you're feeling brave, you may wish to compile with threads.
 # -- Julian Smart
 chmod a+x configure config.sub config.guess setup/general/* setup/shared/*
-./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads -without-odbc
+./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads
 make makefiles
 make
index e8e4f3c9cbc225574648d9a4db9126f2ce65d855..25c561571bd80074e23052e4645b44801c32c2f2 100644 (file)
@@ -1,5 +1,5 @@
 
-  Welcome to wxWindows/Gtk 2.01 (beta 3),
+  Welcome to wxWindows/Gtk 2.01 (beta 4),
 
 you have downloaded version 2.01 of the GTK+ 1.0 port of 
 the wxWindows GUI library.
index 05ba0e3afddf7b4944dac5c73993c3986f52a94b..798af17b332b9cf9a3cd1c0668ee9413b170792a 100644 (file)
@@ -7,7 +7,7 @@ OwnerDraw for wxListCtrl and others
   -> Postponed.
   
 DnD
-  -> Must be rewritten for GTK+ 1.1.3  
+  -> Must be rewritten for GTK+ 1.2
  
 wxDebugContext <-> wxLogXXX functions
   -> Remove either
@@ -15,8 +15,11 @@ wxDebugContext <-> wxLogXXX functions
 Implement wxPalette
   -> I never understood that. Postponed.
   
+Implement different visuals and displays
+  -> I never understood that. Postponed.
+  
 Show accelerator in menus
-  -> Changed in GTK 1.1.X. Postponed.
+  -> Changed in GTK 1.2. Postponed.
   
 Cooperation with Qt
   -> Would be nice.
index 63f75b9e6098d570a929cc15b8c301b721418054..ce89fa76a83fbc2cccff7a4dbbab9e18d289c6b6 100644 (file)
@@ -437,17 +437,24 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 /*
  * wxToolBar style flags
  */
-
 #define wxTB_3DBUTTONS      0x8000
 #define wxTB_HORIZONTAL     0x0002
 #define wxTB_VERTICAL       0x0004
 // Flatbar/Coolbar under Win98
 #define wxTB_FLAT           0x0008
+// use native docking
+#define wxTB_DOCKABLE       0x0010
 
 /*
- * Apply to all panel items
+ * wxMenuBar style flags
  */
+// use native docking
+#define wxMB_DOCKABLE       0x0001
+
 
+/*
+ * Apply to all panel items
+ */
 #define wxCOLOURED          0x0800
 // Alignment for panel item labels: replaces characters with zeros
 // when creating label, so spaces can be included in string for alignment.
@@ -460,7 +467,6 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 /*
  * Styles for wxListBox
  */
-
 #define wxLB_SORT           0x0010
 #define wxLB_SINGLE         0x0020
 #define wxLB_MULTIPLE       0x0040
@@ -516,7 +522,6 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 /*
  * wxSlider flags
  */
-
 #define wxSL_HORIZONTAL      wxHORIZONTAL
 #define wxSL_VERTICAL        wxVERTICAL
 // The next one is obsolete - use scroll events instead
@@ -534,21 +539,18 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 /*
  * wxScrollBar flags
  */
-
 #define wxSB_HORIZONTAL      wxHORIZONTAL
 #define wxSB_VERTICAL        wxVERTICAL
 
 /*
  * wxButton flags
  */
-
 #define wxBU_AUTODRAW        0x0004
 #define wxBU_NOAUTODRAW      0x0000
 
 /*
  * wxTreeCtrl flags
  */
-
 #define wxTR_HAS_BUTTONS     0x0004
 #define wxTR_EDIT_LABELS     0x0008
 #define wxTR_LINES_AT_ROOT   0x0010
@@ -556,7 +558,6 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 /*
  * wxListCtrl flags
  */
-
 #define wxLC_ICON            0x0004
 #define wxLC_SMALL_ICON      0x0008
 #define wxLC_LIST            0x0010
index 347acf3340bf89d1550fb3fe0246337b8cf93369..08a63b914eee9406737e442e9c91125e242dbdb0 100644 (file)
@@ -44,6 +44,7 @@ class wxMenuBar: public wxWindow
 DECLARE_DYNAMIC_CLASS(wxMenuBar)
 
 public:
+  wxMenuBar( long style );
   wxMenuBar();
   void Append( wxMenu *menu, const wxString &title );
 
index 347acf3340bf89d1550fb3fe0246337b8cf93369..08a63b914eee9406737e442e9c91125e242dbdb0 100644 (file)
@@ -44,6 +44,7 @@ class wxMenuBar: public wxWindow
 DECLARE_DYNAMIC_CLASS(wxMenuBar)
 
 public:
+  wxMenuBar( long style );
   wxMenuBar();
   void Append( wxMenu *menu, const wxString &title );
 
index 0c765e74935432aa6c03d2fbefab61527177ecac..155118e34e19a0437408b6933601f0f9cf234c90 100644 (file)
@@ -18,7 +18,7 @@
 #define wxRELEASE_NUMBER   1
 #define wxVERSION_STRING "wxWindows 2.0.1"
 #define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
-#define wxBETA_NUMBER      3
+#define wxBETA_NUMBER      4
 #define wxVERSION_FLOAT wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)
 
 #endif
index dc04b7f4c7c3740d382464a0bee00e161bda36b9..2b221ecd4abf711eaef416e0efbcf496648690af 100644 (file)
@@ -153,9 +153,7 @@ void PlayerSelectionDialog::SelectCallback(wxCommandEvent& event)
 {
        if (event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED)
        {
-#ifdef __WXGTK__
-               if (event.IsSelection())
-#endif
+//         if (event.IsSelection())
                m_textField->SetValue(event.GetString());
        }
 }
index 9d6232483aaf2a8ff75eb5ca1c59a9e502558709..298851bbc735072936e7937f3acc6d6d05a5e34b 100644 (file)
@@ -61,7 +61,7 @@ bool MyApp::OnInit(void)
   wxMenu *helpMenu = new wxMenu;
   helpMenu->Append(wxID_HELP, "&About", "About toolbar sample");
 
-  wxMenuBar* menuBar = new wxMenuBar;
+  wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE );
 
   menuBar->Append(fileMenu, "&File");
   menuBar->Append(helpMenu, "&Help");
@@ -70,7 +70,7 @@ bool MyApp::OnInit(void)
   frame->SetMenuBar(menuBar);
 
   // Create the toolbar
-  frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
+  frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT|wxTB_DOCKABLE, ID_TOOLBAR);
   
   frame->GetToolBar()->SetMargins( 2, 2 );
 
index e9f54e59f934f67a91e6f78bc965ebaa6ab76605..4fd5d33454ee5a478165146ae37a5e7592e21761 100644 (file)
@@ -284,6 +284,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
        // Insert a sizer for the buttons
        wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
        buttonSizer->SetName("buttonSizer");
+       buttonSizer->SetSpacing(12,0);
 
        // Specify constraints for the button sizer
        wxLayoutConstraints *c = new wxLayoutConstraints;
@@ -297,12 +298,12 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
        wxButton *cancel = NULL;
 
   if (style & wxOK) {
-    ok = new wxButton(this, wxID_OK, _("OK"));
+    ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1) );
        buttonSizer->AddSizerChild(ok);
   }
 
   if (style & wxCANCEL) {
-    cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+    cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
        buttonSizer->AddSizerChild(cancel);
   }
 
index 192fbbcddbb517b9cc915d72a721bc3622bcaf82..7f71b2bc75a0416ad7b813eabb3ac661c2a5af57 100644 (file)
@@ -228,11 +228,11 @@ void wxGenericColourDialog::CreateWidgets(void)
 {
   wxBeginBusyCursor();
   
-  wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(okButtonX, buttonY));
+  wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(okButtonX, buttonY), wxSize(75,-1) );
   int bw, bh;
   okButton->GetSize(&bw, &bh);
 
-  (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY));
+  (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY), wxSize(75,-1));
   (void) new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours"),
      wxPoint(customButtonX, buttonY));
 
index da985fa3af3060a03bd19dd64cbac5bd643f3dbf..49a60b633723e943e839252b61454ca87da5264d 100644 (file)
@@ -338,7 +338,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
   m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); 
   // m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") );
   m_ok = new wxButton( this, ID_OK, _("OK") );
-  m_cancel = new wxButton( this, ID_CANCEL, _("Cancel") );
+  m_cancel = new wxButton( this, ID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1) );
   m_new = new wxButton( this, ID_NEW, _("New...") );
 
   // m_check->SetValue(TRUE);
@@ -364,7 +364,7 @@ void wxDirDialog::doSize()
   m_input->GetSize(&w,&h2); h -= h2;
   m_ok->GetSize(&w, &h2); h -= h2;
   //m_check->GetSize(&w, &h2); h -= h2;
-  h -= 20;
+  h -= 30;
 
   wxLayoutConstraints *c = new wxLayoutConstraints;
   c->left.SameAs       (this, wxLeft,5);
@@ -390,14 +390,14 @@ void wxDirDialog::doSize()
   c = new wxLayoutConstraints;
   c->width.SameAs      (m_cancel, wxWidth);
   c->height.AsIs       ();
-  c->top.Below         (m_input,5);
-  c->centreX.PercentOf (this, wxWidth, 25);
+  c->top.Below         (m_input,10);
+  c->centreX.PercentOf (this, wxWidth, 20);
   m_ok->SetConstraints(c);
 
   c = new wxLayoutConstraints;
   c->width.SameAs      (m_cancel, wxWidth);
   c->height.AsIs       ();
-  c->top.Below         (m_input,5);
+  c->top.Below         (m_input,10);
   c->bottom.SameAs      (this, wxBottom, 5);
   c->centreX.PercentOf (this, wxWidth, 50);
   m_new->SetConstraints(c);
@@ -405,8 +405,8 @@ void wxDirDialog::doSize()
   c = new wxLayoutConstraints;
   c->width.AsIs                ();
   c->height.AsIs       ();
-  c->top.Below         (m_input,5);
-  c->centreX.PercentOf (this, wxWidth, 75);
+  c->top.Below         (m_input,10);
+  c->centreX.PercentOf (this, wxWidth, 80);
   m_cancel->SetConstraints(c);
 
   Layout();
index 7991fef481eb34e8da9e9ea561d8d77115f797ff..d08904e7ac67e72aede019a29db86b7e9172b255 100644 (file)
@@ -255,10 +255,10 @@ void wxGenericFontDialog::CreateWidgets(void)
 
   fontRect.y+=y+5; //NL mod
 
-  int by = (fontRect.y + fontRect.height + 10);
+  int by = (fontRect.y + fontRect.height + 15);
 
-  wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(220, by), wxSize(100,-1));
-  (void) new wxButton(this, wxID_OK, _("Cancel"), wxPoint(340, by), wxSize(100,-1));
+  wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(230, by), wxSize(75,-1));
+  (void) new wxButton(this, wxID_OK, _("Cancel"), wxPoint(330, by), wxSize(75,-1));
 
   familyChoice->SetStringSelection( wxFontFamilyIntToString(dialogFont.GetFamily()) );
   styleChoice->SetStringSelection(wxFontStyleIntToString(dialogFont.GetStyle()));
index 498dccc0b64b27ec89253decae0dc3d803766192..9ad504ce9411ac20a32a1880e1dd936a44e435a8 100644 (file)
@@ -111,6 +111,7 @@ wxGenericMessageDialog::wxGenericMessageDialog(wxWindow *parent, const wxString&
 
     wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
     buttonSizer->SetName("buttonSizer");
+    buttonSizer->SetSpacing(12,0);
 
     // Specify constraints for the button sizer
     wxLayoutConstraints *c = new wxLayoutConstraints;
@@ -126,20 +127,20 @@ wxGenericMessageDialog::wxGenericMessageDialog(wxWindow *parent, const wxString&
     wxButton *no = (wxButton *) NULL;
 
     if (style & wxYES_NO) {
-       yes = new wxButton(this, wxID_YES, _("Yes"));
-       no = new wxButton(this, wxID_NO, _("No"));
+       yes = new wxButton(this, wxID_YES, _("Yes"), wxDefaultPosition, wxSize(75,-1) );
+       no = new wxButton(this, wxID_NO, _("No"), wxDefaultPosition, wxSize(75,-1) );
 
        buttonSizer->AddSizerChild(yes);
        buttonSizer->AddSizerChild(no);
     }
 
     if (style & wxOK) {
-        ok = new wxButton(this, wxID_OK, _("OK"));
+        ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1) );
         buttonSizer->AddSizerChild(ok);
     }
 
     if (style & wxCANCEL) {
-        cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+        cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1) );
         buttonSizer->AddSizerChild(cancel);
     }
 
index c582cc875f4c2112d255e50d5bdc896228d10eb1..d4ce2cdc1df82854c28e93b0f8c7c34d02b6f62e 100644 (file)
@@ -127,17 +127,18 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
        c->top.Below            (spacingSizer2);
        c->centreX.SameAs       (textSizer, wxCentreX);
        buttonSizer->SetConstraints(c);
+       buttonSizer->SetSpacing(12,0);
 
     wxButton *ok = NULL;
        wxButton *cancel = NULL;
 
   if (style & wxOK) {
-    ok = new wxButton(this, wxID_OK, _("OK"));
+    ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1));
        buttonSizer->AddSizerChild(ok);
   }
 
   if (style & wxCANCEL) {
-    cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+    cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
        buttonSizer->AddSizerChild(cancel);
   }
 
index 49f84d1698e5a948b4240a39c6bfa08b35c94dee..0984b033021d9b4092dacc06edff1aafa24831c4 100644 (file)
@@ -163,10 +163,10 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
       
 void wxBitmapButton::SetDefault()
 {
-/*
     GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
     gtk_widget_grab_default( m_widget );
-*/
+    
+    SetSize( m_x, m_y, m_width, m_height );
 }
 
 void wxBitmapButton::SetLabel( const wxString &label )
index 8c91ec2adc36c3fc3861641e4ef8a05335a28ae1..42716b5b40dfd88bb7d36aea4fbc15c5f7dc8bdf 100644 (file)
@@ -97,10 +97,10 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
 void wxButton::SetDefault(void)
 {
-/*
-  GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
-  gtk_widget_grab_default( m_widget );
-*/
+    GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
+    gtk_widget_grab_default( m_widget );
+    
+    SetSize( m_x, m_y, m_width, m_height );
 }
 
 void wxButton::SetLabel( const wxString &label )
index 1667ec8e07841c5f514fba8623242c9a38616314..fce41fad7e20fe7fdb5e89e69b04122b18cfbe23 100644 (file)
@@ -110,6 +110,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
     gtk_widget_set_uposition( m_widget, x, y );
 
     GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
+    gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
 
     m_path.Append(m_dir);
     if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
@@ -120,9 +121,15 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
     gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
       GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
 
+    // strange way to internationalize
+    gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), _("OK") );
+
     gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
       GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
-
+      
+    // strange way to internationalize
+    gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), _("Cancel") );
+    
     gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
         GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
 }
index 436ae7f1d6fbbb5591384d9d7935e11a4f517df7..5028599776cd4bc74e3ab73377b37a40ce23e471 100644 (file)
@@ -316,6 +316,8 @@ void wxListBox::AppendCommon( const wxString &item )
         list_item = gtk_list_item_new_with_label( item );
     }
 
+    gtk_container_add( GTK_CONTAINER(m_list), list_item );
+
     gtk_signal_connect( GTK_OBJECT(list_item), "select",
       GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
 
@@ -323,8 +325,6 @@ void wxListBox::AppendCommon( const wxString &item )
         gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
           GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
 
-    gtk_container_add( GTK_CONTAINER(m_list), list_item );
-
     if (m_widgetStyle) ApplyWidgetStyle();
 
     gtk_signal_connect( GTK_OBJECT(list_item),
index 7f42dd5e946786113d9e085107572b8996ddee49..aff2211922fa246801ac7cd44f134b303dd956dc 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
 
+wxMenuBar::wxMenuBar( long style )
+{
+    m_needParent = FALSE; // hmmm
+
+    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
+
+    m_menus.DeleteContents( TRUE );
+
+    m_menubar = gtk_menu_bar_new();
+
+    if (style & wxMB_DOCKABLE)
+    {
+        m_widget = gtk_handle_box_new();
+       gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_menubar) );
+       gtk_widget_show( GTK_WIDGET(m_menubar) );
+    }
+    else
+    {
+        m_widget = GTK_WIDGET(m_menubar);
+    }
+
+    PostCreation();
+
+    Show( TRUE );
+}
+
 wxMenuBar::wxMenuBar()
 {
     m_needParent = FALSE; // hmmm
@@ -36,7 +62,7 @@ wxMenuBar::wxMenuBar()
 
     m_menubar = gtk_menu_bar_new();
 
-    m_widget = GTK_WIDGET(m_menubar);
+        m_widget = GTK_WIDGET(m_menubar);
 
     PostCreation();
 
index df1b967d1d1ee2f90401fd67cf8339abf80a77a4..5712f800d3940a22fc8032104297fe3a8829fd0b 100644 (file)
@@ -123,8 +123,17 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
     m_separation = 5;
     gtk_toolbar_set_space_size( m_toolbar, m_separation );
     m_hasToolAlready = FALSE;
-                                             
-    m_widget = GTK_WIDGET(m_toolbar);                                      
+
+    if (style & wxTB_DOCKABLE)
+    {
+        m_widget = gtk_handle_box_new();
+       gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
+       gtk_widget_show( GTK_WIDGET(m_toolbar) );
+    }
+    else
+    {     
+        m_widget = GTK_WIDGET(m_toolbar);
+    }
                                            
     gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
index d450141f21e07ccb5b655f923d3b4b2a363587b6..f60a748ecf99d1f1e0c8c99f077372eaddb15d94 100644 (file)
@@ -1828,11 +1828,24 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
         if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
         if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
 
-        wxPoint pt( m_parent->GetClientAreaOrigin() );
-        gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
-
-        if ((old_width != m_width) || (old_height != m_height))
-             gtk_widget_set_usize( m_widget, m_width, m_height );
+        if (GTK_WIDGET_HAS_DEFAULT(m_widget))
+       {
+           /* the default button has a border around it */
+           int border = 5;
+       
+            wxPoint pt( m_parent->GetClientAreaOrigin() );
+            gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x-border, m_y+pt.y-border );
+
+            gtk_widget_set_usize( m_widget, m_width+2*border, m_height+2*border );
+       }
+       else
+       {
+            wxPoint pt( m_parent->GetClientAreaOrigin() );
+            gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
+
+            if ((old_width != m_width) || (old_height != m_height))
+              gtk_widget_set_usize( m_widget, m_width, m_height );
+       }
     }
 
     m_sizeSet = TRUE;
index 49f84d1698e5a948b4240a39c6bfa08b35c94dee..0984b033021d9b4092dacc06edff1aafa24831c4 100644 (file)
@@ -163,10 +163,10 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
       
 void wxBitmapButton::SetDefault()
 {
-/*
     GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
     gtk_widget_grab_default( m_widget );
-*/
+    
+    SetSize( m_x, m_y, m_width, m_height );
 }
 
 void wxBitmapButton::SetLabel( const wxString &label )
index 8c91ec2adc36c3fc3861641e4ef8a05335a28ae1..42716b5b40dfd88bb7d36aea4fbc15c5f7dc8bdf 100644 (file)
@@ -97,10 +97,10 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
 void wxButton::SetDefault(void)
 {
-/*
-  GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
-  gtk_widget_grab_default( m_widget );
-*/
+    GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
+    gtk_widget_grab_default( m_widget );
+    
+    SetSize( m_x, m_y, m_width, m_height );
 }
 
 void wxButton::SetLabel( const wxString &label )
index 1667ec8e07841c5f514fba8623242c9a38616314..fce41fad7e20fe7fdb5e89e69b04122b18cfbe23 100644 (file)
@@ -110,6 +110,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
     gtk_widget_set_uposition( m_widget, x, y );
 
     GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
+    gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
 
     m_path.Append(m_dir);
     if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
@@ -120,9 +121,15 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
     gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
       GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
 
+    // strange way to internationalize
+    gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), _("OK") );
+
     gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
       GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
-
+      
+    // strange way to internationalize
+    gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), _("Cancel") );
+    
     gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
         GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
 }
index 436ae7f1d6fbbb5591384d9d7935e11a4f517df7..5028599776cd4bc74e3ab73377b37a40ce23e471 100644 (file)
@@ -316,6 +316,8 @@ void wxListBox::AppendCommon( const wxString &item )
         list_item = gtk_list_item_new_with_label( item );
     }
 
+    gtk_container_add( GTK_CONTAINER(m_list), list_item );
+
     gtk_signal_connect( GTK_OBJECT(list_item), "select",
       GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
 
@@ -323,8 +325,6 @@ void wxListBox::AppendCommon( const wxString &item )
         gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
           GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
 
-    gtk_container_add( GTK_CONTAINER(m_list), list_item );
-
     if (m_widgetStyle) ApplyWidgetStyle();
 
     gtk_signal_connect( GTK_OBJECT(list_item),
index 7f42dd5e946786113d9e085107572b8996ddee49..aff2211922fa246801ac7cd44f134b303dd956dc 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
 
+wxMenuBar::wxMenuBar( long style )
+{
+    m_needParent = FALSE; // hmmm
+
+    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
+
+    m_menus.DeleteContents( TRUE );
+
+    m_menubar = gtk_menu_bar_new();
+
+    if (style & wxMB_DOCKABLE)
+    {
+        m_widget = gtk_handle_box_new();
+       gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_menubar) );
+       gtk_widget_show( GTK_WIDGET(m_menubar) );
+    }
+    else
+    {
+        m_widget = GTK_WIDGET(m_menubar);
+    }
+
+    PostCreation();
+
+    Show( TRUE );
+}
+
 wxMenuBar::wxMenuBar()
 {
     m_needParent = FALSE; // hmmm
@@ -36,7 +62,7 @@ wxMenuBar::wxMenuBar()
 
     m_menubar = gtk_menu_bar_new();
 
-    m_widget = GTK_WIDGET(m_menubar);
+        m_widget = GTK_WIDGET(m_menubar);
 
     PostCreation();
 
index df1b967d1d1ee2f90401fd67cf8339abf80a77a4..5712f800d3940a22fc8032104297fe3a8829fd0b 100644 (file)
@@ -123,8 +123,17 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
     m_separation = 5;
     gtk_toolbar_set_space_size( m_toolbar, m_separation );
     m_hasToolAlready = FALSE;
-                                             
-    m_widget = GTK_WIDGET(m_toolbar);                                      
+
+    if (style & wxTB_DOCKABLE)
+    {
+        m_widget = gtk_handle_box_new();
+       gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
+       gtk_widget_show( GTK_WIDGET(m_toolbar) );
+    }
+    else
+    {     
+        m_widget = GTK_WIDGET(m_toolbar);
+    }
                                            
     gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
index d450141f21e07ccb5b655f923d3b4b2a363587b6..f60a748ecf99d1f1e0c8c99f077372eaddb15d94 100644 (file)
@@ -1828,11 +1828,24 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
         if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
         if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
 
-        wxPoint pt( m_parent->GetClientAreaOrigin() );
-        gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
-
-        if ((old_width != m_width) || (old_height != m_height))
-             gtk_widget_set_usize( m_widget, m_width, m_height );
+        if (GTK_WIDGET_HAS_DEFAULT(m_widget))
+       {
+           /* the default button has a border around it */
+           int border = 5;
+       
+            wxPoint pt( m_parent->GetClientAreaOrigin() );
+            gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x-border, m_y+pt.y-border );
+
+            gtk_widget_set_usize( m_widget, m_width+2*border, m_height+2*border );
+       }
+       else
+       {
+            wxPoint pt( m_parent->GetClientAreaOrigin() );
+            gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
+
+            if ((old_width != m_width) || (old_height != m_height))
+              gtk_widget_set_usize( m_widget, m_width, m_height );
+       }
     }
 
     m_sizeSet = TRUE;