]> git.saurik.com Git - wxWidgets.git/commitdiff
Added Prepend() and Remove() methods to wxSizer,
authorRobert Roebling <robert@roebling.de>
Mon, 16 Aug 1999 20:17:48 +0000 (20:17 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 16 Aug 1999 20:17:48 +0000 (20:17 +0000)
  Corrected a stupid bug in it,
  Freshed up wxPropertyXXX to make use of the icons
  in the dialogs.
  Made wxBmpButton inherit from wxButton. Grumble.

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

17 files changed:
BuildCVS.txt
configure.in
include/wx/gtk/bmpbuttn.h
include/wx/gtk/button.h
include/wx/gtk1/bmpbuttn.h
include/wx/gtk1/button.h
include/wx/prop.h
include/wx/proplist.h
include/wx/sizer.h
samples/proplist/.cvsignore
src/common/sizer.cpp
src/generic/proplist.cpp
src/gtk/app.cpp
src/gtk/bmpbuttn.cpp
src/gtk1/app.cpp
src/gtk1/bmpbuttn.cpp
src/makeprog.env.in

index 81ffa9a83ebd663b8f4ff2dbba8b50db9a6f3b94..f086d038209a921d28f9d99d4501578bac0fbb6f 100644 (file)
@@ -54,6 +54,12 @@ won't ever work, but there is now a new makefile system
 that works without libtool and automake, using only
 configure to create what is needed. 
 
 that works without libtool and automake, using only
 configure to create what is needed. 
 
+In order to create configure, you need to have the
+GNU autoconf package (version 2.13 or 2.14) installed
+on your system and type run "autoconf" in the base
+directory (or run the autogen.sh script in the same
+directory, which just calls autoconf).
+
 Set WXWIN environment variable to the base directory such
 as ~/wxWindows (this is actually not really needed).
 
 Set WXWIN environment variable to the base directory such
 as ~/wxWindows (this is actually not really needed).
 
index b6b535452f07419eeb5b8a03f25647ce7da0095b..d0be0cf4768d31f260e8f5f17bb9c027295bbd1d 100644 (file)
@@ -2717,6 +2717,7 @@ AC_OUTPUT([
            samples/minimal/Makefile
            samples/notebook/Makefile
             samples/printing/Makefile
            samples/minimal/Makefile
            samples/notebook/Makefile
             samples/printing/Makefile
+            samples/proplist/Makefile
            samples/sashtest/Makefile
            samples/scroll/Makefile
            samples/splitter/Makefile
            samples/sashtest/Makefile
            samples/scroll/Makefile
            samples/splitter/Makefile
index 4d3a769c400a3cc2da901dafa068144c782886f3..7126dc067527dc8fcc1ad3c9eb1f0c1bba64ebfd 100644 (file)
@@ -23,6 +23,7 @@
 #include "wx/list.h"
 #include "wx/control.h"
 #include "wx/bitmap.h"
 #include "wx/list.h"
 #include "wx/control.h"
 #include "wx/bitmap.h"
+#include "wx/button.h"
 
 //-----------------------------------------------------------------------------
 // classes
 
 //-----------------------------------------------------------------------------
 // classes
@@ -40,7 +41,7 @@ extern const wxChar *wxButtonNameStr;
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
-class wxBitmapButton: public wxControl
+class wxBitmapButton: public wxButton
 {
   DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 
 {
   DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 
@@ -59,7 +60,7 @@ public:
                const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxButtonNameStr);
                const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxButtonNameStr);
-  void SetDefault();
+  virtual void SetDefault();
     
   void SetLabel( const wxString &label );
   wxString GetLabel() const;
     
   void SetLabel( const wxString &label );
   wxString GetLabel() const;
index 9e2268309c9b87330493a3269513e8650e35c4d3..af4fdac9ee02392f8af7f848758af0ff2b606b9f 100644 (file)
@@ -57,7 +57,7 @@ class wxButton: public wxControl
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxButtonNameStr);
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxButtonNameStr);
-    void SetDefault();
+    virtual void SetDefault();
     void SetLabel( const wxString &label );
     bool Enable( bool enable );
 
     void SetLabel( const wxString &label );
     bool Enable( bool enable );
 
index 4d3a769c400a3cc2da901dafa068144c782886f3..7126dc067527dc8fcc1ad3c9eb1f0c1bba64ebfd 100644 (file)
@@ -23,6 +23,7 @@
 #include "wx/list.h"
 #include "wx/control.h"
 #include "wx/bitmap.h"
 #include "wx/list.h"
 #include "wx/control.h"
 #include "wx/bitmap.h"
+#include "wx/button.h"
 
 //-----------------------------------------------------------------------------
 // classes
 
 //-----------------------------------------------------------------------------
 // classes
@@ -40,7 +41,7 @@ extern const wxChar *wxButtonNameStr;
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
-class wxBitmapButton: public wxControl
+class wxBitmapButton: public wxButton
 {
   DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 
 {
   DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 
@@ -59,7 +60,7 @@ public:
                const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxButtonNameStr);
                const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxButtonNameStr);
-  void SetDefault();
+  virtual void SetDefault();
     
   void SetLabel( const wxString &label );
   wxString GetLabel() const;
     
   void SetLabel( const wxString &label );
   wxString GetLabel() const;
index 9e2268309c9b87330493a3269513e8650e35c4d3..af4fdac9ee02392f8af7f848758af0ff2b606b9f 100644 (file)
@@ -57,7 +57,7 @@ class wxButton: public wxControl
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxButtonNameStr);
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxButtonNameStr);
-    void SetDefault();
+    virtual void SetDefault();
     void SetLabel( const wxString &label );
     bool Enable( bool enable );
 
     void SetLabel( const wxString &label );
     bool Enable( bool enable );
 
index 24348b1e70062e3bc7d05f007d9df3022d0ca583..109b51a4ad83b0c8a698666cc02dc87dfb18dc22 100644 (file)
@@ -26,6 +26,7 @@
 #include "wx/textctrl.h"
 #include "wx/gdicmn.h"
 #include "wx/layout.h"
 #include "wx/textctrl.h"
 #include "wx/gdicmn.h"
 #include "wx/layout.h"
+#include "wx/sizer.h"
 
 class wxWindow;
 class wxProperty;
 
 class wxWindow;
 class wxProperty;
index 2df1170cb9a2a073044cb3c5e48ea8760f458ea5..98ac6d0e9cbfbe48f9916fbf29dae7453d0c8ccd 100644 (file)
@@ -172,12 +172,10 @@ public:
   wxButton*         m_confirmButton;  // A tick, as in VB
   wxButton*         m_cancelButton;   // A cross, as in VB
   wxButton*         m_editButton;     // Invokes the custom validator, if any
   wxButton*         m_confirmButton;  // A tick, as in VB
   wxButton*         m_cancelButton;   // A cross, as in VB
   wxButton*         m_editButton;     // Invokes the custom validator, if any
+  wxSizer*          m_middleSizer;
 
   bool              m_detailedEditing;     // E.g. using listbox for choices
 
 
   bool              m_detailedEditing;     // E.g. using listbox for choices
 
-  static wxBitmap*  sm_tickBitmap;
-  static wxBitmap*  sm_crossBitmap;
-
   wxPanel*          m_propertyWindow; // Panel that the controls will appear on
   wxWindow*         m_managedWindow; // Frame or dialog
 
   wxPanel*          m_propertyWindow; // Panel that the controls will appear on
   wxWindow*         m_managedWindow; // Frame or dialog
 
index 61eda2e4ecb47ac1854b38c74b436f8734c339b1..5b8af95cdb26bbd46509ea19db8d709190f33316 100644 (file)
@@ -92,6 +92,14 @@ public:
    virtual void Add( wxSizer *sizer, int option = 0, int flag = 0, int border = 0 );
    virtual void Add( int width, int height, int option = 0, int flag = 0, int border = 0  );
   
    virtual void Add( wxSizer *sizer, int option = 0, int flag = 0, int border = 0 );
    virtual void Add( int width, int height, int option = 0, int flag = 0, int border = 0  );
   
+   virtual void Prepend( wxWindow *window, int option = 0, int flag = 0, int border = 0 );
+   virtual void Prepend( wxSizer *sizer, int option = 0, int flag = 0, int border = 0 );
+   virtual void Prepend( int width, int height, int option = 0, int flag = 0, int border = 0  );
+   
+   virtual bool Remove( wxWindow *window );
+   virtual bool Remove( wxSizer *sizer );
+   virtual bool Remove( int pos );
+  
    void SetDimension( int x, int y, int width, int height );
   
    wxSize GetSize()
    void SetDimension( int x, int y, int width, int height );
   
    wxSize GetSize()
index f5eaa1a85937ad3c039965403e248ee9192db378..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,2 +1 @@
-Makefile.in
 
 
index 5dbc84608be943bc2dd32c5a75bde358e8802d0d..fcac0711a7b3d4454412277f893c1afb18a2807a 100644 (file)
@@ -197,6 +197,69 @@ void wxSizer::Add( int width, int height, int option, int flag, int border )
     m_children.Append( new wxSizerItem( width, height, option, flag, border ) );
 }
 
     m_children.Append( new wxSizerItem( width, height, option, flag, border ) );
 }
 
+void wxSizer::Prepend( wxWindow *window, int option, int flag, int border )
+{
+    m_children.Insert( new wxSizerItem( window, option, flag, border ) );
+}
+
+void wxSizer::Prepend( wxSizer *sizer, int option, int flag, int border )
+{
+    m_children.Insert( new wxSizerItem( sizer, option, flag, border ) );
+}
+
+void wxSizer::Prepend( int width, int height, int option, int flag, int border )
+{
+    m_children.Insert( new wxSizerItem( width, height, option, flag, border ) );
+}
+
+bool wxSizer::Remove( wxWindow *window )
+{
+    wxASSERT( window );
+    
+    wxNode *node = m_children.First();
+    while (node)
+    {
+        wxSizerItem *item = (wxSizerItem*)node->Data();
+       if (item->GetWindow() == window)
+       {
+            m_children.DeleteNode( node );
+           return TRUE;
+       }
+        node = node->Next();
+    }
+    
+    return FALSE;
+}
+
+bool wxSizer::Remove( wxSizer *sizer )
+{
+    wxASSERT( sizer );
+    
+    wxNode *node = m_children.First();
+    while (node)
+    {
+        wxSizerItem *item = (wxSizerItem*)node->Data();
+       if (item->GetSizer() == sizer)
+       {
+            m_children.DeleteNode( node );
+           return TRUE;
+       }
+        node = node->Next();
+    }
+    
+    return FALSE;
+}
+
+bool wxSizer::Remove( int pos )
+{
+    wxNode *node = m_children.Nth( pos );
+    if (!node) return FALSE;
+    
+    m_children.DeleteNode( node );
+    
+    return TRUE;
+}
+  
 void wxSizer::Fit( wxWindow *window )
 {
     window->SetSize( GetMinWindowSize( window ) );
 void wxSizer::Fit( wxWindow *window )
 {
     window->SetSize( GetMinWindowSize( window ) );
@@ -204,7 +267,7 @@ void wxSizer::Fit( wxWindow *window )
 
 void wxSizer::Layout()
 {
 
 void wxSizer::Layout()
 {
-    m_size = CalcMin();
+    CalcMin();
     RecalcSizes();
 }
 
     RecalcSizes();
 }
 
@@ -229,6 +292,7 @@ void wxSizer::SetDimension( int x, int y, int width, int height )
     m_position.y = y;
     m_size.x = width;
     m_size.y = height;
     m_position.y = y;
     m_size.x = width;
     m_size.y = height;
+    CalcMin();
     RecalcSizes();
 }
 
     RecalcSizes();
 }
 
@@ -244,10 +308,7 @@ wxBoxSizer::wxBoxSizer( int orient )
 void wxBoxSizer::RecalcSizes()
 {
     if (m_children.GetCount() == 0)
 void wxBoxSizer::RecalcSizes()
 {
     if (m_children.GetCount() == 0)
-    {
-        SetDimension( m_position.x, m_position.y, 2, 2 );
         return;
         return;
-    }
     
     int delta = 0;
     int extra = 0;
     
     int delta = 0;
     int extra = 0;
index dd1e30283055f215782656348b60b898acdcef92..b35a76fb741522e7367ac6fb6e07728e419a3649 100644 (file)
 #endif
 
 #ifndef WX_PRECOMP
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx/wx.h"
+#include "wx/window.h"
+#include "wx/font.h"
+#include "wx/button.h"
+#include "wx/bmpbuttn.h"
+#include "wx/textctrl.h"
+#include "wx/listbox.h"
+#include "wx/settings.h"
+#include "wx/msgdlg.h"
+#include "wx/filedlg.h"
 #endif
 
 #endif
 
+#include "wx/sizer.h"
+#include "wx/module.h"
+#include "wx/intl.h"
+
 #include "wx/colordlg.h"
 #include "wx/proplist.h"
 
 #include "wx/colordlg.h"
 #include "wx/proplist.h"
 
 #include <math.h>
 #include <string.h>
 
 #include <math.h>
 #include <string.h>
 
+#ifndef __WXMSW__
+#include "wx/generic/cross.xpm"
+#include "wx/generic/tick.xpm"
+#endif
+
+
+/*
+ * global data, urgh.
+ */
+
+static wxBitmap* gs_tickBitmap = (wxBitmap*) NULL;
+static wxBitmap* gs_crossBitmap = (wxBitmap*) NULL;
+
 
 /*
  * Property text edit control
 
 /*
  * Property text edit control
@@ -60,6 +85,8 @@ void wxPropertyTextEdit::OnKillFocus(void)
  * Property list view
  */
 
  * Property list view
  */
 
+bool wxPropertyListView::sm_dialogCancelled = FALSE;
+
 IMPLEMENT_DYNAMIC_CLASS(wxPropertyListView, wxPropertyView)
 
 BEGIN_EVENT_TABLE(wxPropertyListView, wxPropertyView)
 IMPLEMENT_DYNAMIC_CLASS(wxPropertyListView, wxPropertyView)
 
 BEGIN_EVENT_TABLE(wxPropertyListView, wxPropertyView)
@@ -76,10 +103,6 @@ BEGIN_EVENT_TABLE(wxPropertyListView, wxPropertyView)
     EVT_LISTBOX(wxID_PROP_VALUE_SELECT, wxPropertyListView::OnValueListSelect)
 END_EVENT_TABLE()
 
     EVT_LISTBOX(wxID_PROP_VALUE_SELECT, wxPropertyListView::OnValueListSelect)
 END_EVENT_TABLE()
 
-bool wxPropertyListView::sm_dialogCancelled = FALSE;
-wxBitmap *wxPropertyListView::sm_tickBitmap = NULL;
-wxBitmap *wxPropertyListView::sm_crossBitmap = NULL;
-
 wxPropertyListView::wxPropertyListView(wxPanel *propPanel, long flags):wxPropertyView(flags)
 {
   m_propertyScrollingList = NULL;
 wxPropertyListView::wxPropertyListView(wxPanel *propPanel, long flags):wxPropertyView(flags)
 {
   m_propertyScrollingList = NULL;
@@ -100,12 +123,6 @@ wxPropertyListView::wxPropertyListView(wxPanel *propPanel, long flags):wxPropert
 
 wxPropertyListView::~wxPropertyListView(void)
 {
 
 wxPropertyListView::~wxPropertyListView(void)
 {
-/*
-  if (m_tickBitmap)
-    delete m_tickBitmap;
-  if (m_crossBitmap)
-    delete m_crossBitmap;
-*/
 }
 
 void wxPropertyListView::ShowView(wxPropertySheet *ps, wxPanel *panel)
 }
 
 void wxPropertyListView::ShowView(wxPropertySheet *ps, wxPanel *panel)
@@ -389,258 +406,122 @@ void wxPropertyListView::OnPropertySelect(wxCommandEvent& WXUNUSED(event))
   }
 }
 
   }
 }
 
-bool wxPropertyListView::CreateControls(void)
+bool wxPropertyListView::CreateControls()
 {
 {
-  wxPanel *panel = (wxPanel *)m_propertyWindow;
-
-  int largeButtonWidth = 60;
-  int largeButtonHeight = 25;
-
-  int smallButtonWidth = 25;
-  int smallButtonHeight = 20;
+    wxPanel *panel = (wxPanel *)m_propertyWindow;
 
 
-  // XView must be allowed to choose its own sized buttons
-#ifdef __XVIEW__
-  largeButtonWidth = -1;
-  largeButtonHeight = -1;
+    wxSize largeButtonSize( 60, 25 );
+    wxSize smallButtonSize( 23, 23 );
 
 
-  smallButtonWidth = -1;
-  smallButtonHeight = -1;
-#endif
-
-  if (m_valueText)
-    return TRUE;
-
-  if (!panel)
-    return FALSE;
+    if (m_valueText)
+        return TRUE;
 
 
-  wxWindow *leftMostWindow = panel;
-/*
-  wxWindow *topMostWindow = panel;
-  wxWindow *rightMostWindow = panel;
-*/
+    if (!panel)
+        return FALSE;
 
 
-  wxSystemSettings settings;
-  wxFont guiFont = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
+    wxSystemSettings settings;
+    wxFont guiFont = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
 
 #ifdef __WXMSW__
 
 #ifdef __WXMSW__
-  wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL, FALSE, "Courier New");
+    wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL, FALSE, "Courier New");
 #else
 #else
-  wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxTELETYPE, wxNORMAL, wxNORMAL);
+    wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxTELETYPE, wxNORMAL, wxNORMAL);
 #endif
 
 #endif
 
-  // May need to be changed in future to eliminate clashes with app.
-  // WHAT WAS THIS FOR?
+    // May need to be changed in future to eliminate clashes with app.
+    // WHAT WAS THIS FOR?
 //  panel->SetClientData((char *)this);
 
 //  panel->SetClientData((char *)this);
 
-  // These buttons are at the bottom of the window, but create them now
-  // so the constraints are evaluated in the correct order
-  if (m_buttonFlags & wxPROP_BUTTON_OK)
-  {
-    m_windowCloseButton = new wxButton(panel, wxID_OK, "OK",
-     wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
-    m_windowCloseButton->SetDefault();
-    m_windowCloseButton->SetFocus();
-  }
-  else if (m_buttonFlags & wxPROP_BUTTON_CLOSE)
-  {
-    m_windowCloseButton = new wxButton(panel, wxID_OK, "Close",
-     wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
-  }
-  if (m_buttonFlags & wxPROP_BUTTON_CANCEL)
-  {
-    m_windowCancelButton = new wxButton(panel, wxID_CANCEL, "Cancel",
-     wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
-  }
-  if (m_buttonFlags & wxPROP_BUTTON_HELP)
-  {
-    m_windowHelpButton = new wxButton(panel, wxID_HELP, "Help",
-     wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
-  }
+    wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
+    
+    // top row with optional buttons and input line
 
 
-  if (m_windowCloseButton)
-  {
-    wxLayoutConstraints *c1 = new wxLayoutConstraints;
-
-    c1->left.SameAs       (panel, wxLeft, 2);
-    c1->bottom.SameAs        (panel, wxBottom, 2);
-    c1->width.AsIs();
-    c1->height.AsIs();
-    m_windowCloseButton->SetConstraints(c1);
-    leftMostWindow = m_windowCloseButton;
-  }
-  if (m_windowCancelButton)
-  {
-    wxLayoutConstraints *c2 = new wxLayoutConstraints;
-
-    c2->right.SameAs       (panel, wxRight, 2);
-    c2->bottom.SameAs          (panel, wxBottom, 2);
-    c2->width.AsIs();
-    c2->height.AsIs();
-    m_windowCancelButton->SetConstraints(c2);
-    leftMostWindow = m_windowCancelButton;
-  }
-  if (m_windowHelpButton)
-  {
-    wxLayoutConstraints *c2 = new wxLayoutConstraints;
-    if (leftMostWindow == panel)
-      c2->left.SameAs       (panel, wxLeft, 2);
-    else
-      c2->left.RightOf      (leftMostWindow, 2);
-
-    c2->bottom.SameAs          (panel, wxBottom, 2);
-    c2->width.AsIs();
-    c2->height.AsIs();
-    m_windowHelpButton->SetConstraints(c2);
-    leftMostWindow = m_windowHelpButton;
-  }
+    wxBoxSizer *topsizer = new wxBoxSizer( wxHORIZONTAL );
+    int buttonborder = 3;
 
 
-  if (m_buttonFlags & wxPROP_BUTTON_CHECK_CROSS)
-  {
-/*
-    if (!tickBitmap)
-    {
-#ifdef __WXMSW__
-      tickBitmap = new wxBitmap("tick_bmp", wxBITMAP_TYPE_RESOURCE);
-      crossBitmap =  new wxBitmap("cross_bmp", wxBITMAP_TYPE_RESOURCE);
-      if (!tickBitmap || !crossBitmap || !tickBitmap->Ok() || !crossBitmap->Ok())
-      {
-        if (tickBitmap)
-          delete tickBitmap;
-        if (crossBitmap)
-          delete crossBitmap;
-        tickBitmap = NULL;
-        crossBitmap = NULL;
-      }
-#endif
-    }
-*/
-/*
-    if (tickBitmap && crossBitmap)
+    if (m_buttonFlags & wxPROP_BUTTON_CHECK_CROSS)
     {
     {
-      m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, tickBitmap,
-       wxPoint(-1, -1), wxSize(smallButtonWidth-5, smallButtonHeight-5));
-      m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, crossBitmap,
-       wxPoint(-1, -1), wxSize(smallButtonWidth-5, smallButtonHeight-5));
+        if (gs_tickBitmap && gs_crossBitmap)
+        {
+            m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, *gs_tickBitmap, wxPoint(-1, -1), smallButtonSize );
+            m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, *gs_crossBitmap, wxPoint(-1, -1), smallButtonSize );
+        }
+        else
+        {
+            m_confirmButton = new wxButton(panel, wxID_PROP_CHECK, ":-)", wxPoint(-1, -1), smallButtonSize );
+           m_cancelButton = new wxButton(panel, wxID_PROP_CROSS, "X", wxPoint(-1, -1), smallButtonSize );
+        }
+       
+       topsizer->Add( m_confirmButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
+       topsizer->Add( m_cancelButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
     }
     }
-    else
-*/
+
+    m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, "", 
+       wxPoint(-1, -1), wxSize(-1, smallButtonSize.y), wxPROCESS_ENTER);
+    m_valueText->Enable(FALSE);
+    topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
+    
+    if (m_buttonFlags & wxPROP_PULLDOWN)
     {
     {
-      m_confirmButton = new wxButton(panel, wxID_PROP_CHECK, ":-)",
-       wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
-      m_cancelButton = new wxButton(panel, wxID_PROP_CROSS, "X",
-       wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
+        m_editButton = new wxButton(panel, wxID_PROP_EDIT, "...",  wxPoint(-1, -1), smallButtonSize);
+        m_editButton->Enable(FALSE);
+       topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
     }
 
     }
 
-    wxLayoutConstraints *c = new wxLayoutConstraints;
-    c->left.SameAs         (panel, wxLeft, 2);
-/*
-    if (windowCloseButton)
-      c->top.Below         (m_windowCloseButton, 2);
-    else
-*/
-      c->top.SameAs        (panel, wxTop, 2);
-
-    c->width.AsIs();
-    c->height.AsIs();
+    mainsizer->Add( topsizer, 0, wxEXPAND );
 
 
-    m_cancelButton->SetConstraints(c);
+    // middle section with two list boxes
 
 
-    c = new wxLayoutConstraints;
-    c->left.RightOf        (m_cancelButton, 2);
-    c->top.SameAs          (m_cancelButton, wxTop, 0);
-    c->width.AsIs();
-    c->height.AsIs();
+    m_middleSizer = new wxBoxSizer( wxVERTICAL );
 
 
-    m_confirmButton->SetConstraints(c);
+    m_valueList = new wxListBox(panel, wxID_PROP_VALUE_SELECT, wxPoint(-1, -1), wxSize(-1, 60));
+    m_valueList->Show(FALSE);
 
 
-    m_cancelButton->Enable(FALSE);
-    m_confirmButton->Enable(FALSE);
-  }
+    m_propertyScrollingList = new wxListBox(panel, wxID_PROP_SELECT, wxPoint(-1, -1), wxSize(100, 100));
+    m_propertyScrollingList->SetFont(* boringFont);
+    m_middleSizer->Add( m_propertyScrollingList, 1, wxALL|wxEXPAND, buttonborder );
 
 
-  if (m_buttonFlags & wxPROP_PULLDOWN)
-  {
-    m_editButton = new wxButton(panel, wxID_PROP_EDIT, "...",
-     wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
-    m_editButton->Enable(FALSE);
-    wxLayoutConstraints *c = new wxLayoutConstraints;
+    mainsizer->Add( m_middleSizer, 1, wxEXPAND );    
 
 
-/*
-    if (m_windowCloseButton)
-      c->top.Below           (m_windowCloseButton, 2);
-    else
-*/
-      c->top.SameAs          (panel, wxTop, 2);
+    // bottom row with buttons
 
 
-    c->right.SameAs          (panel, wxRight, 2);
-    c->width.AsIs();
-    c->height.AsIs();
-    m_editButton->SetConstraints(c);
-  }
-
-  m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, "", wxPoint(-1, -1), wxSize(-1, -1), wxPROCESS_ENTER);
-  m_valueText->Enable(FALSE);
-
-  wxLayoutConstraints *c = new wxLayoutConstraints;
-
-  if (m_cancelButton)
-    c->left.RightOf        (m_confirmButton, 2);
-  else
-    c->left.SameAs         (panel, wxLeft, 2);
-/*
-  if (m_windowCloseButton)
-    c->top.Below           (m_windowCloseButton, 2);
-  else
-*/
-    c->top.SameAs          (panel, wxTop, 2);
-
-  if (m_editButton)
-    c->right.LeftOf        (m_editButton, 2);
-  else
-    c->right.SameAs        (panel, wxRight, 2);
-  c->height.AsIs();
-
-  m_valueText->SetConstraints(c);
-
-  m_valueList = new wxListBox(panel, wxID_PROP_VALUE_SELECT, wxPoint(-1, -1), wxSize(-1, 60));
-  m_valueList->Show(FALSE);
-
-  c = new wxLayoutConstraints;
-
-  c->left.SameAs         (panel, wxLeft, 2);
-  c->top.Below           (m_valueText, 2);
-  c->right.SameAs        (panel, wxRight, 2);
-  c->height.Absolute(60);
-
-  m_valueList->SetConstraints(c);
-
-  m_propertyScrollingList = new wxListBox(panel, wxID_PROP_SELECT,
-    wxPoint(-1, -1), wxSize(300, 300));
-  m_propertyScrollingList->SetFont(* boringFont);
-
-  c = new wxLayoutConstraints;
-
-  c->left.SameAs         (panel, wxLeft, 2);
-
-  if (m_buttonFlags & wxPROP_DYNAMIC_VALUE_FIELD)
-    c->top.Below         (m_valueText, 2);
-  else
-    c->top.Below         (m_valueList, 2);
-
-  c->right.SameAs        (panel, wxRight, 2);
-
-  if (m_windowCloseButton)
-    c->bottom.Above       (m_windowCloseButton, -2);
-  else
-    c->bottom.SameAs       (panel, wxBottom, 2);
-
-  m_propertyScrollingList->SetConstraints(c);
+    if ((m_buttonFlags & wxPROP_BUTTON_OK) ||
+        (m_buttonFlags & wxPROP_BUTTON_CLOSE) ||
+       (m_buttonFlags & wxPROP_BUTTON_CANCEL) ||
+       (m_buttonFlags & wxPROP_BUTTON_HELP))
+    {
+        wxBoxSizer *bottomsizer = new wxBoxSizer( wxHORIZONTAL );
+        buttonborder = 5;
+    
+        if (m_buttonFlags & wxPROP_BUTTON_OK)
+        {
+            m_windowCloseButton = new wxButton(panel, wxID_OK, _("OK"), wxPoint(-1, -1), largeButtonSize );
+            m_windowCloseButton->SetDefault();
+            m_windowCloseButton->SetFocus();
+            bottomsizer->Add( m_windowCloseButton, 0, wxLEFT|wxTOP|wxBOTTOM, buttonborder );
+        }
+        else if (m_buttonFlags & wxPROP_BUTTON_CLOSE)
+        {
+            m_windowCloseButton = new wxButton(panel, wxID_OK, _("Close"), wxPoint(-1, -1), largeButtonSize );
+            bottomsizer->Add( m_windowCloseButton, 0, wxALL, buttonborder );
+        }
+        if (m_buttonFlags & wxPROP_BUTTON_CANCEL)
+        {
+            m_windowCancelButton = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxPoint(-1, -1), largeButtonSize );
+            bottomsizer->Add( m_windowCancelButton, 0, wxALL, buttonborder );
+        }
+        if (m_buttonFlags & wxPROP_BUTTON_HELP)
+        {
+            m_windowHelpButton = new wxButton(panel, wxID_HELP, _("Help"), wxPoint(-1, -1), largeButtonSize );
+            bottomsizer->Add( m_windowHelpButton, 0, wxALL, buttonborder );
+        }
+       
+        mainsizer->Add( bottomsizer, 1, wxALIGN_RIGHT | wxEXPAND );
+    }
 
 
-  // Note: if this is called now, it causes a GPF.
-  // Why?
-//  panel->Layout();
+    panel->SetSizer( mainsizer );
 
 
-  return TRUE;
+    return TRUE;
 }
 
 void wxPropertyListView::ShowTextControl(bool show)
 }
 
 void wxPropertyListView::ShowTextControl(bool show)
@@ -651,30 +532,19 @@ void wxPropertyListView::ShowTextControl(bool show)
 
 void wxPropertyListView::ShowListBoxControl(bool show)
 {
 
 void wxPropertyListView::ShowListBoxControl(bool show)
 {
-  if (m_valueList)
-  {
+    if (!m_valueList) return;
+    
     m_valueList->Show(show);
     m_valueList->Show(show);
+    
     if (m_buttonFlags & wxPROP_DYNAMIC_VALUE_FIELD)
     {
     if (m_buttonFlags & wxPROP_DYNAMIC_VALUE_FIELD)
     {
-      wxLayoutConstraints *constraints = m_propertyScrollingList->GetConstraints();
-      if (constraints)
-      {
         if (show)
         if (show)
-        {
-          constraints->top.Below(m_valueList, 2);
-          // Maintain back-pointer so when valueList is deleted,
-          // any reference to it from this window is removed.
-          m_valueList->AddConstraintReference(m_propertyScrollingList);
-        }
-        else
-        {
-          constraints->top.Below(m_valueText, 2);
-          m_valueText->AddConstraintReference(m_propertyScrollingList);
-        }
+           m_middleSizer->Prepend( m_valueList, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 3 );
+       else
+           m_middleSizer->Remove( 0 );
+      
         m_propertyWindow->Layout();
         m_propertyWindow->Layout();
-      }
     }
     }
-  }
 }
 
 void wxPropertyListView::EnableCheck(bool show)
 }
 
 void wxPropertyListView::EnableCheck(bool show)
@@ -1779,7 +1649,9 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
   wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, "Cancel", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
   wxButton *okButton = new wxButton(dialog, wxID_OK, "OK", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
 
   wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, "Cancel", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
   wxButton *okButton = new wxButton(dialog, wxID_OK, "OK", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
 
+#ifndef __WXGTK__
   okButton->SetDefault();
   okButton->SetDefault();
+#endif
 
   wxLayoutConstraints *c = new wxLayoutConstraints;
 
 
   wxLayoutConstraints *c = new wxLayoutConstraints;
 
@@ -1950,3 +1822,47 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection(void)
   m_stringText->Enable(TRUE);
 }
 
   m_stringText->Enable(TRUE);
 }
 
+//-----------------------------------------------------------------------------
+// wxPropertyModule
+//-----------------------------------------------------------------------------
+
+class wxPropertyModule: public wxModule
+{
+  DECLARE_DYNAMIC_CLASS(wxPropertyModule)
+
+public:
+    wxPropertyModule() {}
+    bool OnInit();
+    void OnExit();
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxPropertyModule,wxModule)
+
+bool wxPropertyModule::OnInit()
+{
+#ifdef __WXMSW__
+    gs_tickBitmap = new wxBitmap("tick_bmp", wxBITMAP_TYPE_RESOURCE);
+    gs_crossBitmap =  new wxBitmap("cross_bmp", wxBITMAP_TYPE_RESOURCE);
+#else
+    gs_tickBitmap = new wxBitmap( tick_xpm );
+    gs_crossBitmap =  new wxBitmap( cross_xpm );
+#endif
+    if (!gs_tickBitmap || !gs_crossBitmap || !gs_tickBitmap->Ok() || !gs_crossBitmap->Ok())
+    {
+        if (gs_tickBitmap) delete gs_tickBitmap;
+       if (gs_crossBitmap) delete gs_crossBitmap;
+       gs_tickBitmap = (wxBitmap*) NULL;
+       gs_crossBitmap = (wxBitmap*) NULL;
+    }
+
+    return TRUE;
+}
+
+void wxPropertyModule::OnExit()
+{
+    if (gs_tickBitmap)
+        delete gs_tickBitmap;
+    if (gs_crossBitmap)
+        delete gs_crossBitmap;
+}
+
index a4beb03e4ad8943cd8a6b471f11a7726bbb19685..2bce90acabca0f6ec08a260fd35b0ad3aceb286b 100644 (file)
@@ -587,8 +587,6 @@ bool wxApp::Initialize()
     wxInitializeResourceSystem();
 #endif
 
     wxInitializeResourceSystem();
 #endif
 
-    wxImage::InitStandardHandlers();
-
     wxModule::RegisterModules();
     if (!wxModule::InitializeModules()) return FALSE;
 
     wxModule::RegisterModules();
     if (!wxModule::InitializeModules()) return FALSE;
 
@@ -622,8 +620,6 @@ void wxApp::CleanUp()
 
     wxDeleteStockLists();
 
 
     wxDeleteStockLists();
 
-    wxImage::CleanUpHandlers();
-
     delete wxTheApp;
     wxTheApp = (wxApp*) NULL;
 
     delete wxTheApp;
     wxTheApp = (wxApp*) NULL;
 
index 71975f8af92609db8bb0750db71b830c8d7174a5..b9226adabf8fbf6e45823e4791fad988468b2806 100644 (file)
@@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
 wxBitmapButton::wxBitmapButton()
 {
 
 wxBitmapButton::wxBitmapButton()
 {
index a4beb03e4ad8943cd8a6b471f11a7726bbb19685..2bce90acabca0f6ec08a260fd35b0ad3aceb286b 100644 (file)
@@ -587,8 +587,6 @@ bool wxApp::Initialize()
     wxInitializeResourceSystem();
 #endif
 
     wxInitializeResourceSystem();
 #endif
 
-    wxImage::InitStandardHandlers();
-
     wxModule::RegisterModules();
     if (!wxModule::InitializeModules()) return FALSE;
 
     wxModule::RegisterModules();
     if (!wxModule::InitializeModules()) return FALSE;
 
@@ -622,8 +620,6 @@ void wxApp::CleanUp()
 
     wxDeleteStockLists();
 
 
     wxDeleteStockLists();
 
-    wxImage::CleanUpHandlers();
-
     delete wxTheApp;
     wxTheApp = (wxApp*) NULL;
 
     delete wxTheApp;
     wxTheApp = (wxApp*) NULL;
 
index 71975f8af92609db8bb0750db71b830c8d7174a5..b9226adabf8fbf6e45823e4791fad988468b2806 100644 (file)
@@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
 wxBitmapButton::wxBitmapButton()
 {
 
 wxBitmapButton::wxBitmapButton()
 {
index 9ae88ae94ac8f932a80549b4fc23ffa292ad7cb5..03b947813fba5a55e27ac5f4de952a557f35a593 100644 (file)
@@ -20,7 +20,7 @@ include $(top_builddir)/src/make.env
 all:    $(PROGRAM) install_dirs install_data
 
 $(PROGRAM):    $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
 all:    $(PROGRAM) install_dirs install_data
 
 $(PROGRAM):    $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
-       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDLIBS)
+       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(EXTRALIBS) $(LDLIBS)
 
 install_dirs:
        @list='$(DATADIRS)'; for p in $$list; do \
 
 install_dirs:
        @list='$(DATADIRS)'; for p in $$list; do \