]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxRadioButton (not tested)
authorRobert Roebling <robert@roebling.de>
Fri, 14 Aug 1998 10:07:38 +0000 (10:07 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 14 Aug 1998 10:07:38 +0000 (10:07 +0000)
  Added wxValidator to constructros
  Added resource.cpp
  Added parser stuff
  Added the coolest Makefile.in
  Added callbacks to Menu
  Changed parser.y to include lexer.c for wxGTK
    (Is that right?)
  Can't remeber havning changed the printing stuff.

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

74 files changed:
.cvsignore
include/wx/generic/listctrl.h
include/wx/gtk/bmpbuttn.h
include/wx/gtk/button.h
include/wx/gtk/checkbox.h
include/wx/gtk/choice.h
include/wx/gtk/combobox.h
include/wx/gtk/frame.h
include/wx/gtk/gauge.h
include/wx/gtk/listbox.h
include/wx/gtk/menu.h
include/wx/gtk/radiobox.h
include/wx/gtk/radiobut.h
include/wx/gtk/scrolbar.h
include/wx/gtk/slider.h
include/wx/gtk/textctrl.h
include/wx/gtk/window.h
include/wx/gtk1/bmpbuttn.h
include/wx/gtk1/button.h
include/wx/gtk1/checkbox.h
include/wx/gtk1/choice.h
include/wx/gtk1/combobox.h
include/wx/gtk1/frame.h
include/wx/gtk1/gauge.h
include/wx/gtk1/listbox.h
include/wx/gtk1/menu.h
include/wx/gtk1/radiobox.h
include/wx/gtk1/radiobut.h
include/wx/gtk1/scrolbar.h
include/wx/gtk1/slider.h
include/wx/gtk1/textctrl.h
include/wx/gtk1/window.h
samples/Makefile
src/Makefile.in
src/common/parser.y
src/common/resource.cpp
src/common/validate.cpp
src/generic/listctrl.cpp
src/gtk.inc
src/gtk/bmpbuttn.cpp
src/gtk/button.cpp
src/gtk/checkbox.cpp
src/gtk/choice.cpp
src/gtk/combobox.cpp
src/gtk/control.cpp
src/gtk/gauge.cpp
src/gtk/listbox.cpp
src/gtk/menu.cpp
src/gtk/radiobox.cpp
src/gtk/radiobut.cpp
src/gtk/scrolbar.cpp
src/gtk/slider.cpp
src/gtk/textctrl.cpp
src/gtk/utilsgtk.cpp
src/gtk/window.cpp
src/gtk1/bmpbuttn.cpp
src/gtk1/button.cpp
src/gtk1/checkbox.cpp
src/gtk1/choice.cpp
src/gtk1/combobox.cpp
src/gtk1/control.cpp
src/gtk1/gauge.cpp
src/gtk1/listbox.cpp
src/gtk1/menu.cpp
src/gtk1/radiobox.cpp
src/gtk1/radiobut.cpp
src/gtk1/scrolbar.cpp
src/gtk1/slider.cpp
src/gtk1/textctrl.cpp
src/gtk1/utilsgtk.cpp
src/gtk1/window.cpp
user/Makefile
utils/Makefile
utils/serialize/serwnd.cpp

index 01ecbbec3346d3f7f410bed954b83597dc18bfd6..a61591ad04d22155c2214d78f39e2448befe7a41 100644 (file)
@@ -1,2 +1,4 @@
 system.list
 bin
+.gdb_history
+Test
index 227bc96d834a454f11a6104b26aafbfec96fec0b..4a60aabbddbaea5da5842f0234be22b5616af8fa 100644 (file)
@@ -598,7 +598,7 @@ class wxListCtrl: public wxControl
     void SetSingleStyle( long style, bool add = TRUE ) ;
     void SetWindowStyleFlag(long style);
     void RecreateWindow(void) {};
-    long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE);
+    long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const;
     wxImageList *GetImageList(int which);
     void SetImageList(wxImageList *imageList, int which) ;
     bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
index 659e9443dc52220fb682bfcd313cd6c54ac6c721..41ef3b50774f35dc2539b426e8e739ee1cb52c2d 100644 (file)
@@ -44,12 +44,19 @@ class wxBitmapButton: public wxControl
   public:
 
     wxBitmapButton(void);
-    wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
+    inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr)
+    {
+      Create(parent, id, bitmap, pos, size, style, validator, name);
+    }
+    bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr);
     void SetDefault(void);
     void SetLabel( const wxString &label );
     wxString GetLabel(void) const;
index c423cc21fb630856787a36be797c439e36cd1afa..5adbd99d0c5efd073a72654cf3a166f579b6bb1b 100644 (file)
@@ -44,12 +44,19 @@ class wxButton: public wxControl
   public:
 
     wxButton(void);
-    wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
+    inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr)
+    {
+      Create(parent, id, label, pos, size, style, validator, name);
+    }
+    bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr);
     void SetDefault(void);
     void SetLabel( const wxString &label );
 };
index 6ff10bcecc040c5e72c051c8f60bc26a5e0c791e..d949234568c5420ed05e255efec165276bfff07f 100644 (file)
@@ -44,12 +44,19 @@ class wxCheckBox: public wxControl
   public:
 
     wxCheckBox(void);
-    wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxCheckBoxNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxCheckBoxNameStr  );
+    inline wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxCheckBoxNameStr)
+    {
+      Create(parent, id, label, pos, size, style, validator, name);
+    }
+    bool Create( wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxCheckBoxNameStr );
     void SetValue( bool state );
     bool GetValue(void) const;
 };
index 99e7ec087870126d3f351c19234a1ce6221a7980..31265e11616e6986b37df2bfef4c8714235b2d99 100644 (file)
@@ -44,14 +44,23 @@ class wxChoice: public wxControl
   public:
 
     wxChoice(void);
-    wxChoice( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxChoiceNameStr );
+    inline wxChoice( wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxChoiceNameStr )
+    {
+      Create(parent, id, pos, size, n, choices, style, validator, name);
+    }
     bool Create( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxChoiceNameStr );
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxChoiceNameStr );
     void Append( const wxString &item );
     void Clear(void);
     int FindString( const wxString &string ) const;
index 1215f6a85db33de395e66e65a768de39399b4f2e..d2ea1822c9ea65bcaf3b753b57d78331d7e57ee9 100644 (file)
@@ -50,17 +50,18 @@ class wxComboBox: public wxControl
            const wxSize& size = wxDefaultSize,
            int n = 0, const wxString choices[] = NULL,
            long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxComboBoxNameStr)
   {
-    Create(parent, id, value, pos, size, n, choices, style, name);
+    Create(parent, id, value, pos, size, n, choices, style, validator, name);
   }
-
   bool Create(wxWindow *parent, wxWindowID id,
            const wxString& value = wxEmptyString,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            int n = 0, const wxString choices[] = NULL,
            long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxComboBoxNameStr);
 
   // List functions
index 2b52e132c47cf2164322d7c1f3fc5f69e32d27e6..e4f5d5481827819d2a64cf28d8f2ce66a65197d7 100644 (file)
@@ -88,6 +88,8 @@ public:
   virtual wxString GetTitle() const { return m_title; }
   
   virtual void SetIcon( const wxIcon &icon );
+  void Iconize( bool WXUNUSED(iconize)) { }
+  bool IsIconized(void) const { return FALSE; }
 
   void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
   void OnSize( wxSizeEvent &event );
index 2aa81557e1bf8e35222707bea907297ffbd7c4ab..51e9563b56d9d8c39edda0add93a520300a4ba86 100644 (file)
@@ -44,34 +44,34 @@ class wxGauge: public wxControl
   public:
     inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
 
-  inline wxGauge(wxWindow *parent, wxWindowID id,
+    inline wxGauge( wxWindow *parent, wxWindowID id,
            int range,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxGA_HORIZONTAL,
-           const wxString& name = wxGaugeNameStr)
-  {
-    Create(parent, id, range, pos, size, style, name);
-  };
-
-  bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxGaugeNameStr )
+    {
+      Create(parent, id, range, pos, size, style, validator, name);
+    }
+    bool Create( wxWindow *parent, wxWindowID id,
            int range,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxGA_HORIZONTAL,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxGaugeNameStr );
-
-  void SetShadowWidth( int WXUNUSED(w) ) {};
-  void SetBezelFace( int WXUNUSED(w) ) {};
-  void SetRange( int r );
-  void SetValue( int pos );
-  int GetShadowWidth(void) const { return 0; };
-  int GetBezelFace(void) const { return 0; };
-  int GetRange(void) const;
-  int GetValue(void) const;
-
-  // Are we a Win95/GTK progress bar, or a normal gauge?
-  inline bool GetProgressBar(void) const { return m_useProgressBar; }
+    void SetShadowWidth( int WXUNUSED(w) ) {};
+    void SetBezelFace( int WXUNUSED(w) ) {};
+    void SetRange( int r );
+    void SetValue( int pos );
+    int GetShadowWidth(void) const { return 0; };
+    int GetBezelFace(void) const { return 0; };
+    int GetRange(void) const;
+    int GetValue(void) const;
+
+    // Are we a Win95/GTK progress bar, or a normal gauge?
+    inline bool GetProgressBar(void) const { return m_useProgressBar; }
 
  protected:
  
index 43012923c16ecd057dc2c4ef8b5dda404c5fc7b7..eb757db9b4d9d6da693c2aa182dc21d7b50d8c82 100644 (file)
@@ -45,14 +45,23 @@ class wxListBox: public wxControl
   public:
 
     wxListBox(void);
-    wxListBox( wxWindow *parent, wxWindowID id, 
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxListBoxNameStr );
+    inline wxListBox( wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxListBoxNameStr )
+    {
+      Create(parent, id, pos, size, n, choices, style, validator, name);
+    }
     bool Create( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxListBoxNameStr );
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxListBoxNameStr );
     void Append( const wxString &item );
     void Append( const wxString &item, char *clientData );
     void Clear(void);
index 2c9db7bb52f6ec75e0654e1a86ca1b693a0988a0..5ce6c353ccfb0ed90a347f89ab180e7d2aaea5ed 100644 (file)
@@ -123,7 +123,7 @@ DECLARE_DYNAMIC_CLASS(wxMenu)
 
 public:
   // construction
-  wxMenu( const wxString &title = "" );
+  wxMenu( const wxString& title = wxEmptyString, const wxFunction func = NULL );
 
   // operations
     // menu creation
@@ -149,16 +149,23 @@ public:
   // accessors
   wxList& GetItems() { return m_items; }
 
+  inline void Callback(const wxFunction func) { m_callback = func; }
+  
+  inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+  inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+  
 public:
   int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
   void SetInvokingWindow( wxWindow *win );
   wxWindow *GetInvokingWindow();
 
-  wxString    m_title;
-  wxList      m_items;
-  wxWindow   *m_invokingWindow;
+  wxString       m_title;
+  wxList         m_items;
+  wxWindow      *m_invokingWindow;
+  wxFunction     m_callback;
+  wxEvtHandler  *m_eventHandler;
 
-  GtkWidget  *m_menu;  // GtkMenu
+  GtkWidget     *m_menu;  // GtkMenu
 };
 
 #endif // __GTKMENUH__
index c1218fc449dbd900c3cad34733410013921b7b39..1477aaadd2fe02cd15b395bcd09cac90ffc81b30 100644 (file)
@@ -46,16 +46,21 @@ class wxRadioBox: public wxControl
   public:
   
     wxRadioBox(void);
-    wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      int majorDim = 0, long style = wxRA_HORIZONTAL,
-      const wxString &name = wxRadioBoxNameStr );
+    inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
+             const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+             int n = 0, const wxString choices[] = NULL,
+             int majorDim = 0, long style = wxRA_HORIZONTAL,
+             const wxValidator& val = wxDefaultValidator, 
+            const wxString& name = wxRadioBoxNameStr )
+    {
+      Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
+    }
     bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      int majorDim = 0, long style = wxRA_HORIZONTAL,
-      const wxString &name = wxRadioBoxNameStr );
+             const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+             int n = 0, const wxString choices[] = NULL,
+             int majorDim = 0, long style = wxRA_HORIZONTAL,
+             const wxValidator& val = wxDefaultValidator, 
+            const wxString& name = wxRadioBoxNameStr );
     int FindString( const wxString& s) const;
     void SetSelection( int n );
     int GetSelection(void) const;
index 337264fe5afb07864a743be0040c162df875d9f7..61e7130035bb45c5a4f4d6f2a9cd1ee6ac873f65 100644 (file)
 
 class wxRadioButton;
 
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern const char* wxRadioButtonNameStr;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+class wxRadioButton: public wxControl
+{
+  DECLARE_DYNAMIC_CLASS(wxRadioButton)
+  
+  public:
+    inline wxRadioButton(void) {}
+    inline wxRadioButton( wxWindow *parent, wxWindowID id,
+           const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxRadioButtonNameStr )
+    {
+      Create( parent, id, label, pos, size, style, validator, name );
+    }
+    bool Create(wxWindow *parent, wxWindowID id,
+           const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxRadioButtonNameStr );
+    virtual void SetLabel(const wxString& label);
+    virtual void SetValue(bool val);
+    virtual bool GetValue(void) const;
+};
 
 #endif // __GTKRADIOBUTTONH__
index 5badbfcb2891b478e9a10b4cfe5ba758727702dc..2a79f45acf4cd78fec26782a0c4e3d45f1ac147e 100644 (file)
@@ -43,17 +43,22 @@ class wxScrollBar: public wxControl
   public:
   
     wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; };
-    wxScrollBar(wxWindow *parent, wxWindowID id,
+    inline wxScrollBar( wxWindow *parent, wxWindowID id,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSB_HORIZONTAL,
-           const wxString& name = wxScrollBarNameStr );
-    ~wxScrollBar(void);
-    bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxScrollBarNameStr )
+    {
+      Create( parent, id, pos, size, style, validator, name );
+    }
+    bool Create( wxWindow *parent, wxWindowID id,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSB_HORIZONTAL,
-           const wxString& name = wxScrollBarNameStr);
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxScrollBarNameStr );
+    ~wxScrollBar(void);
     int GetPosition(void) const;
     int GetThumbSize() const;
     int GetPageSize() const;
index dda48b2093b09218bdf68c39d55cefdd73cea350..2915e8380fc328af75d26610ea7717612ea37e71 100644 (file)
@@ -43,21 +43,24 @@ class wxSlider: public wxControl
 
   public:
     wxSlider(void);
-    wxSlider( wxWindow *parent, wxWindowID id,
+    inline wxSlider( wxWindow *parent, wxWindowID id,
            int value, int minValue, int maxValue,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSL_HORIZONTAL,
-/*           const wxValidator& validator = wxDefaultValidator, */
-           const wxString& name = wxSliderNameStr);
-   ~wxSlider(void);
-   bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxSliderNameStr )
+    {
+      Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name );
+    }
+    ~wxSlider(void);
+    bool Create(wxWindow *parent, wxWindowID id,
            int value, int minValue, int maxValue,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSL_HORIZONTAL,
-/*           const wxValidator& validator = wxDefaultValidator, */
-           const wxString& name = wxSliderNameStr);
+           const wxValidator& validator = wxDefaultValidator, 
+           const wxString& name = wxSliderNameStr );
     virtual int GetValue(void) const;
     virtual void SetValue( int );
     void GetSize( int *x, int *y ) const;
index 2c8d9febeba61126f4838ef068585f49c052a3eb..06d1fa8b6b5e61dea3eeac897390a96598601ee5 100644 (file)
@@ -52,10 +52,12 @@ public:
     wxTextCtrl();
     wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int style = 0, const wxString &name = wxTextCtrlNameStr );
+      int style = 0, const wxValidator& validator = wxDefaultValidator,
+      const wxString &name = wxTextCtrlNameStr );
     bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int style = 0, const wxString &name = wxTextCtrlNameStr );
+      int style = 0, const wxValidator& validator = wxDefaultValidator,
+      const wxString &name = wxTextCtrlNameStr );
     wxString GetValue() const;
     void SetValue( const wxString &value );
     void WriteText( const wxString &text );
index 0f1d410cf75b4fb6079a4826aabbbf49cc3541b6..6f0da39f997d43333b87f2b2477a6b5f7db67473 100644 (file)
@@ -40,6 +40,8 @@ extern wxList wxTopLevelWindows;
 
 class wxLayoutConstraints;
 class wxSizer;
+class wxResourceTable;
+class wxItemResource;
 
 class wxWindow;
 class wxCanvas;
@@ -60,13 +62,24 @@ class wxWindow: public wxEvtHandler
 {
 public:
   wxWindow();
-  wxWindow( wxWindow *parent, wxWindowID id,
-    const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-    long style = 0, const wxString &name = wxPanelNameStr );
-  bool Create( wxWindow *parent, wxWindowID id,
-    const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-    long style = 0, const wxString &name = wxPanelNameStr );
+  inline wxWindow(wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           long style = 0,
+           const wxString& name = wxPanelNameStr)
+  {
+      Create(parent, id, pos, size, style, name);
+  }
+  bool Create(wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           long style = 0,
+           const wxString& name = wxPanelNameStr);
   virtual ~wxWindow();
+  
+  virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+  virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
+  
   bool Close( bool force = FALSE );
   virtual bool Destroy();
   virtual bool DestroyChildren();
@@ -107,7 +120,7 @@ public:
   wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
 
   virtual wxValidator *GetValidator();
-  virtual void SetValidator( wxValidator *validator );
+  virtual void SetValidator( const wxValidator &validator );
 
   bool IsBeingDeleted();
 
@@ -123,6 +136,8 @@ public:
 
   virtual wxColour GetBackgroundColour() const;
   virtual void SetBackgroundColour( const wxColour &colour );
+  virtual wxColour GetForegroundColour() const;
+  virtual void SetForegroundColour( const wxColour &colour );
 
   virtual void SetDefaultBackgroundColour( const wxColour& col )
     { m_defaultBackgroundColour = col; };
index 659e9443dc52220fb682bfcd313cd6c54ac6c721..41ef3b50774f35dc2539b426e8e739ee1cb52c2d 100644 (file)
@@ -44,12 +44,19 @@ class wxBitmapButton: public wxControl
   public:
 
     wxBitmapButton(void);
-    wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
+    inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr)
+    {
+      Create(parent, id, bitmap, pos, size, style, validator, name);
+    }
+    bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr);
     void SetDefault(void);
     void SetLabel( const wxString &label );
     wxString GetLabel(void) const;
index c423cc21fb630856787a36be797c439e36cd1afa..5adbd99d0c5efd073a72654cf3a166f579b6bb1b 100644 (file)
@@ -44,12 +44,19 @@ class wxButton: public wxControl
   public:
 
     wxButton(void);
-    wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxButtonNameStr  );
+    inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr)
+    {
+      Create(parent, id, label, pos, size, style, validator, name);
+    }
+    bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxButtonNameStr);
     void SetDefault(void);
     void SetLabel( const wxString &label );
 };
index 6ff10bcecc040c5e72c051c8f60bc26a5e0c791e..d949234568c5420ed05e255efec165276bfff07f 100644 (file)
@@ -44,12 +44,19 @@ class wxCheckBox: public wxControl
   public:
 
     wxCheckBox(void);
-    wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxCheckBoxNameStr  );
-    bool Create(  wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      long style = 0, const wxString &name = wxCheckBoxNameStr  );
+    inline wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxCheckBoxNameStr)
+    {
+      Create(parent, id, label, pos, size, style, validator, name);
+    }
+    bool Create( wxWindow *parent, wxWindowID id, const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxCheckBoxNameStr );
     void SetValue( bool state );
     bool GetValue(void) const;
 };
index 99e7ec087870126d3f351c19234a1ce6221a7980..31265e11616e6986b37df2bfef4c8714235b2d99 100644 (file)
@@ -44,14 +44,23 @@ class wxChoice: public wxControl
   public:
 
     wxChoice(void);
-    wxChoice( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxChoiceNameStr );
+    inline wxChoice( wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxChoiceNameStr )
+    {
+      Create(parent, id, pos, size, n, choices, style, validator, name);
+    }
     bool Create( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxChoiceNameStr );
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxChoiceNameStr );
     void Append( const wxString &item );
     void Clear(void);
     int FindString( const wxString &string ) const;
index 1215f6a85db33de395e66e65a768de39399b4f2e..d2ea1822c9ea65bcaf3b753b57d78331d7e57ee9 100644 (file)
@@ -50,17 +50,18 @@ class wxComboBox: public wxControl
            const wxSize& size = wxDefaultSize,
            int n = 0, const wxString choices[] = NULL,
            long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxComboBoxNameStr)
   {
-    Create(parent, id, value, pos, size, n, choices, style, name);
+    Create(parent, id, value, pos, size, n, choices, style, validator, name);
   }
-
   bool Create(wxWindow *parent, wxWindowID id,
            const wxString& value = wxEmptyString,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            int n = 0, const wxString choices[] = NULL,
            long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxComboBoxNameStr);
 
   // List functions
index 2b52e132c47cf2164322d7c1f3fc5f69e32d27e6..e4f5d5481827819d2a64cf28d8f2ce66a65197d7 100644 (file)
@@ -88,6 +88,8 @@ public:
   virtual wxString GetTitle() const { return m_title; }
   
   virtual void SetIcon( const wxIcon &icon );
+  void Iconize( bool WXUNUSED(iconize)) { }
+  bool IsIconized(void) const { return FALSE; }
 
   void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
   void OnSize( wxSizeEvent &event );
index 2aa81557e1bf8e35222707bea907297ffbd7c4ab..51e9563b56d9d8c39edda0add93a520300a4ba86 100644 (file)
@@ -44,34 +44,34 @@ class wxGauge: public wxControl
   public:
     inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
 
-  inline wxGauge(wxWindow *parent, wxWindowID id,
+    inline wxGauge( wxWindow *parent, wxWindowID id,
            int range,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxGA_HORIZONTAL,
-           const wxString& name = wxGaugeNameStr)
-  {
-    Create(parent, id, range, pos, size, style, name);
-  };
-
-  bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxGaugeNameStr )
+    {
+      Create(parent, id, range, pos, size, style, validator, name);
+    }
+    bool Create( wxWindow *parent, wxWindowID id,
            int range,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxGA_HORIZONTAL,
+           const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxGaugeNameStr );
-
-  void SetShadowWidth( int WXUNUSED(w) ) {};
-  void SetBezelFace( int WXUNUSED(w) ) {};
-  void SetRange( int r );
-  void SetValue( int pos );
-  int GetShadowWidth(void) const { return 0; };
-  int GetBezelFace(void) const { return 0; };
-  int GetRange(void) const;
-  int GetValue(void) const;
-
-  // Are we a Win95/GTK progress bar, or a normal gauge?
-  inline bool GetProgressBar(void) const { return m_useProgressBar; }
+    void SetShadowWidth( int WXUNUSED(w) ) {};
+    void SetBezelFace( int WXUNUSED(w) ) {};
+    void SetRange( int r );
+    void SetValue( int pos );
+    int GetShadowWidth(void) const { return 0; };
+    int GetBezelFace(void) const { return 0; };
+    int GetRange(void) const;
+    int GetValue(void) const;
+
+    // Are we a Win95/GTK progress bar, or a normal gauge?
+    inline bool GetProgressBar(void) const { return m_useProgressBar; }
 
  protected:
  
index 43012923c16ecd057dc2c4ef8b5dda404c5fc7b7..eb757db9b4d9d6da693c2aa182dc21d7b50d8c82 100644 (file)
@@ -45,14 +45,23 @@ class wxListBox: public wxControl
   public:
 
     wxListBox(void);
-    wxListBox( wxWindow *parent, wxWindowID id, 
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxListBoxNameStr );
+    inline wxListBox( wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxListBoxNameStr )
+    {
+      Create(parent, id, pos, size, n, choices, style, validator, name);
+    }
     bool Create( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, 
-      int n = 0, const wxString choices[] = NULL,
-      long style = 0, const wxString &name = wxListBoxNameStr );
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           int n = 0, const wxString choices[] = NULL,
+           long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxListBoxNameStr );
     void Append( const wxString &item );
     void Append( const wxString &item, char *clientData );
     void Clear(void);
index 2c9db7bb52f6ec75e0654e1a86ca1b693a0988a0..5ce6c353ccfb0ed90a347f89ab180e7d2aaea5ed 100644 (file)
@@ -123,7 +123,7 @@ DECLARE_DYNAMIC_CLASS(wxMenu)
 
 public:
   // construction
-  wxMenu( const wxString &title = "" );
+  wxMenu( const wxString& title = wxEmptyString, const wxFunction func = NULL );
 
   // operations
     // menu creation
@@ -149,16 +149,23 @@ public:
   // accessors
   wxList& GetItems() { return m_items; }
 
+  inline void Callback(const wxFunction func) { m_callback = func; }
+  
+  inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+  inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+  
 public:
   int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
   void SetInvokingWindow( wxWindow *win );
   wxWindow *GetInvokingWindow();
 
-  wxString    m_title;
-  wxList      m_items;
-  wxWindow   *m_invokingWindow;
+  wxString       m_title;
+  wxList         m_items;
+  wxWindow      *m_invokingWindow;
+  wxFunction     m_callback;
+  wxEvtHandler  *m_eventHandler;
 
-  GtkWidget  *m_menu;  // GtkMenu
+  GtkWidget     *m_menu;  // GtkMenu
 };
 
 #endif // __GTKMENUH__
index c1218fc449dbd900c3cad34733410013921b7b39..1477aaadd2fe02cd15b395bcd09cac90ffc81b30 100644 (file)
@@ -46,16 +46,21 @@ class wxRadioBox: public wxControl
   public:
   
     wxRadioBox(void);
-    wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      int majorDim = 0, long style = wxRA_HORIZONTAL,
-      const wxString &name = wxRadioBoxNameStr );
+    inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
+             const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+             int n = 0, const wxString choices[] = NULL,
+             int majorDim = 0, long style = wxRA_HORIZONTAL,
+             const wxValidator& val = wxDefaultValidator, 
+            const wxString& name = wxRadioBoxNameStr )
+    {
+      Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
+    }
     bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int n = 0, const wxString choices[] = NULL,
-      int majorDim = 0, long style = wxRA_HORIZONTAL,
-      const wxString &name = wxRadioBoxNameStr );
+             const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+             int n = 0, const wxString choices[] = NULL,
+             int majorDim = 0, long style = wxRA_HORIZONTAL,
+             const wxValidator& val = wxDefaultValidator, 
+            const wxString& name = wxRadioBoxNameStr );
     int FindString( const wxString& s) const;
     void SetSelection( int n );
     int GetSelection(void) const;
index 337264fe5afb07864a743be0040c162df875d9f7..61e7130035bb45c5a4f4d6f2a9cd1ee6ac873f65 100644 (file)
 
 class wxRadioButton;
 
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern const char* wxRadioButtonNameStr;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+class wxRadioButton: public wxControl
+{
+  DECLARE_DYNAMIC_CLASS(wxRadioButton)
+  
+  public:
+    inline wxRadioButton(void) {}
+    inline wxRadioButton( wxWindow *parent, wxWindowID id,
+           const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxRadioButtonNameStr )
+    {
+      Create( parent, id, label, pos, size, style, validator, name );
+    }
+    bool Create(wxWindow *parent, wxWindowID id,
+           const wxString& label,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize, long style = 0,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxRadioButtonNameStr );
+    virtual void SetLabel(const wxString& label);
+    virtual void SetValue(bool val);
+    virtual bool GetValue(void) const;
+};
 
 #endif // __GTKRADIOBUTTONH__
index 5badbfcb2891b478e9a10b4cfe5ba758727702dc..2a79f45acf4cd78fec26782a0c4e3d45f1ac147e 100644 (file)
@@ -43,17 +43,22 @@ class wxScrollBar: public wxControl
   public:
   
     wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; };
-    wxScrollBar(wxWindow *parent, wxWindowID id,
+    inline wxScrollBar( wxWindow *parent, wxWindowID id,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSB_HORIZONTAL,
-           const wxString& name = wxScrollBarNameStr );
-    ~wxScrollBar(void);
-    bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxScrollBarNameStr )
+    {
+      Create( parent, id, pos, size, style, validator, name );
+    }
+    bool Create( wxWindow *parent, wxWindowID id,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSB_HORIZONTAL,
-           const wxString& name = wxScrollBarNameStr);
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxScrollBarNameStr );
+    ~wxScrollBar(void);
     int GetPosition(void) const;
     int GetThumbSize() const;
     int GetPageSize() const;
index dda48b2093b09218bdf68c39d55cefdd73cea350..2915e8380fc328af75d26610ea7717612ea37e71 100644 (file)
@@ -43,21 +43,24 @@ class wxSlider: public wxControl
 
   public:
     wxSlider(void);
-    wxSlider( wxWindow *parent, wxWindowID id,
+    inline wxSlider( wxWindow *parent, wxWindowID id,
            int value, int minValue, int maxValue,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSL_HORIZONTAL,
-/*           const wxValidator& validator = wxDefaultValidator, */
-           const wxString& name = wxSliderNameStr);
-   ~wxSlider(void);
-   bool Create(wxWindow *parent, wxWindowID id,
+           const wxValidator& validator = wxDefaultValidator,
+           const wxString& name = wxSliderNameStr )
+    {
+      Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name );
+    }
+    ~wxSlider(void);
+    bool Create(wxWindow *parent, wxWindowID id,
            int value, int minValue, int maxValue,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxSL_HORIZONTAL,
-/*           const wxValidator& validator = wxDefaultValidator, */
-           const wxString& name = wxSliderNameStr);
+           const wxValidator& validator = wxDefaultValidator, 
+           const wxString& name = wxSliderNameStr );
     virtual int GetValue(void) const;
     virtual void SetValue( int );
     void GetSize( int *x, int *y ) const;
index 2c8d9febeba61126f4838ef068585f49c052a3eb..06d1fa8b6b5e61dea3eeac897390a96598601ee5 100644 (file)
@@ -52,10 +52,12 @@ public:
     wxTextCtrl();
     wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int style = 0, const wxString &name = wxTextCtrlNameStr );
+      int style = 0, const wxValidator& validator = wxDefaultValidator,
+      const wxString &name = wxTextCtrlNameStr );
     bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      int style = 0, const wxString &name = wxTextCtrlNameStr );
+      int style = 0, const wxValidator& validator = wxDefaultValidator,
+      const wxString &name = wxTextCtrlNameStr );
     wxString GetValue() const;
     void SetValue( const wxString &value );
     void WriteText( const wxString &text );
index 0f1d410cf75b4fb6079a4826aabbbf49cc3541b6..6f0da39f997d43333b87f2b2477a6b5f7db67473 100644 (file)
@@ -40,6 +40,8 @@ extern wxList wxTopLevelWindows;
 
 class wxLayoutConstraints;
 class wxSizer;
+class wxResourceTable;
+class wxItemResource;
 
 class wxWindow;
 class wxCanvas;
@@ -60,13 +62,24 @@ class wxWindow: public wxEvtHandler
 {
 public:
   wxWindow();
-  wxWindow( wxWindow *parent, wxWindowID id,
-    const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-    long style = 0, const wxString &name = wxPanelNameStr );
-  bool Create( wxWindow *parent, wxWindowID id,
-    const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-    long style = 0, const wxString &name = wxPanelNameStr );
+  inline wxWindow(wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           long style = 0,
+           const wxString& name = wxPanelNameStr)
+  {
+      Create(parent, id, pos, size, style, name);
+  }
+  bool Create(wxWindow *parent, wxWindowID id,
+           const wxPoint& pos = wxDefaultPosition,
+           const wxSize& size = wxDefaultSize,
+           long style = 0,
+           const wxString& name = wxPanelNameStr);
   virtual ~wxWindow();
+  
+  virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+  virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
+  
   bool Close( bool force = FALSE );
   virtual bool Destroy();
   virtual bool DestroyChildren();
@@ -107,7 +120,7 @@ public:
   wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
 
   virtual wxValidator *GetValidator();
-  virtual void SetValidator( wxValidator *validator );
+  virtual void SetValidator( const wxValidator &validator );
 
   bool IsBeingDeleted();
 
@@ -123,6 +136,8 @@ public:
 
   virtual wxColour GetBackgroundColour() const;
   virtual void SetBackgroundColour( const wxColour &colour );
+  virtual wxColour GetForegroundColour() const;
+  virtual void SetForegroundColour( const wxColour &colour );
 
   virtual void SetDefaultBackgroundColour( const wxColour& col )
     { m_defaultBackgroundColour = col; };
index 58aefc246fceac463c4524e0113e54d9a8e9bba5..326ffe40611ff182b1cca71b217c03fd881f4678 100644 (file)
@@ -1 +1 @@
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
index f8c9c3bdf67336847e17fc3fb0265497d89c2863..401e958daab032e0128a22a245c635a4a6a79428 100644 (file)
@@ -20,13 +20,23 @@ include @MAKEINCLUDE@
 
 LIB_CPP_ALL_SRC=$(LIB_CPP_SRC) @GTK_JOYSTICK@ @UNIX_THREAD@
 
+LIB_C_ALL_SRC=$(LIB_C_SRC) parser.c
+
 #define library objects
 LIB_OBJ=\
  $(LIB_CPP_ALL_SRC:.cpp=.o) \
- $(LIB_C_SRC:.c=.o)
+ $(LIB_C_ALL_SRC:.c=.o)
 
 all::
-       -../mkdirs
+       @if test ! -d gtk; then mkdir gtk; fi
+       @if test ! -d qt; then mkdir qt; fi
+       @if test ! -d motif; then mkdir motif; fi
+       @if test ! -d common; then mkdir common; fi
+       @if test ! -d generic; then mkdir generic; fi
+       @if test ! -d png; then mkdir png; fi
+       @if test ! -d zlib; then mkdir zlib; fi
+       @if test ! -d gdk_imlib; then mkdir gdk_imlib; fi
+       @if test ! -d iodbc; then mkdir iodbc; fi
 
 clean::
        $(RM) -rf gtk
@@ -38,6 +48,7 @@ clean::
        $(RM) -rf zlib
        $(RM) -rf gdk_imlib
        $(RM) -rf iodbc
+       @$(RM) lexer.c parser.c
 
 #additional things needed for compile
 ADD_COMPILE= \
@@ -45,3 +56,34 @@ ADD_COMPILE= \
 
 # include the definitions now
 include ../../template.mak
+
+# things for the prolog stuff
+
+parser.c: ../common/parser.y lexer.c 
+       @if test ! -f parser.y; then \
+         cp -f ../common/parser.y . ; \
+       fi
+       @$(YACC) parser.y
+       @sed -e "s/y.tab.c/parser.y/g"       < y.tab.c | \
+       sed -e "s/BUFSIZ/5000/g"            | \
+       sed -e "s/YYLMAX 200/YYLMAX 5000/g" | \
+       sed -e "s/yy/PROIO_yy/g"            | \
+       sed -e "s/input/PROIO_input/g"      | \
+       sed -e "s/unput/PROIO_unput/g"      > parser.c
+       @$(RM) y.tab.c
+       @$(RM) parser.y
+
+lexer.c: ../common/lexer.l
+       @if test ! -f lexer.l; then \
+         cp -f ../common/lexer.l . ;\
+       fi
+       @$(LEX) lexer.l
+       @sed -e "s/lex.yy.c/lexer.l/g"       < lex.yy.c | \
+       sed -e "s/yy/PROIO_yy/g"            | \
+       sed -e "s/input/PROIO_input/g"      | \
+       sed -e "s/unput/PROIO_unput/g"      > lexer.c
+       @$(RM) lex.yy.c
+       @$(RM) lexer.l
+
+clean::
+       
\ No newline at end of file
index 1fb7dceb10c9be92d2c030a48a26a33677afc47e..336ee0f964eb265e49ae8cd0fbd307ff2636d3be 100644 (file)
@@ -117,7 +117,11 @@ arg1       :       WORD
 
 %%
 
+#ifdef __WXGTK__
+#include "lexer.c"
+#else
 #include "../common/lex_yy.c"
+#endif
 
 /*
 void yyerror(s)
index ab9cceda58f7cdf25545440b44a57c6a87afb110..5b29102a74ed850ac18a135910a322d3e8dd2798 100644 (file)
@@ -31,6 +31,7 @@
 #include "wx/menu.h"
 #include "wx/stattext.h"
 #include "wx/button.h"
+#include "wx/bmpbuttn.h"
 #include "wx/radiobox.h"
 #include "wx/listbox.h"
 #include "wx/choice.h"
@@ -41,7 +42,8 @@
 #include "wx/gauge.h"
 #endif
 #include "wx/textctrl.h"
-#include "wx/msgbxdlg.h"
+#include "wx/msgdlg.h"
+#include "wx/intl.h"
 #endif
 
 #if USE_SCROLLBAR
@@ -2125,7 +2127,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table)
           break;
         }
 #endif
-#ifdef __X__
+#ifdef __WXGTK__
         case RESOURCE_PLATFORM_X:
         {
           if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
@@ -2169,7 +2171,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table)
     {
       case wxBITMAP_TYPE_XBM_DATA:
       {
-#ifdef __X__
+#ifdef __WXGTK__
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2185,7 +2187,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table)
       }
       case wxBITMAP_TYPE_XPM_DATA:
       {
-#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2292,7 +2294,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
           break;
         }
 #endif
-#ifdef __X__
+#ifdef __WXGTK__
         case RESOURCE_PLATFORM_X:
         {
           if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
@@ -2336,7 +2338,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
     {
       case wxBITMAP_TYPE_XBM_DATA:
       {
-#ifdef __X__
+#ifdef __WXGTK__
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2344,7 +2346,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
                          "Forgot to use wxResourceLoadIconData?"), name);
           return NULL;
         }
-        icon = new wxIcon((char *)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); 
+        icon = new wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); 
 #else
         wxLogWarning(_("No XBM facility available!"));
 #endif
@@ -2354,7 +2356,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
       {
       // *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
 /*
-#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2373,7 +2375,11 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
       }
       default:
       {
+#ifdef __WXGTK__
+        wxLogWarning(_("Icon resource specification %s not found."), resource);
+#else
         icon = new wxIcon(name, bitmapType);
+#endif
         break;
       }
     }
index af5104d42899388fe4b560a782808b9ccf0b1d72..c5eb5c4ca2286910bd1da6ed9f3237ea6b0d8bb6 100644 (file)
@@ -21,7 +21,7 @@
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx.h"
+#include "wx/wx.h"
 #endif
 
 #include "wx/validate.h"
index 5e0008f975df392b24d3ec7b7824ed21e21d0f9b..c9c29db898138d5befef5d8382c13810be4b4835 100644 (file)
@@ -2326,7 +2326,7 @@ long wxListCtrl::GetTopItem(void)
   return 0;
 };
 
-long wxListCtrl::GetNextItem( long item, int geom, int state )
+long wxListCtrl::GetNextItem( long item, int geom, int state ) const
 {
   return m_mainWin->GetNextItem( item, geom, state );
 };
index 38e86a8d173c71212fae07d23f18838a3f023afc..96dc9482b3aacacbaf2d8cb3de9fdfb5be4ec3ff 100644 (file)
@@ -36,6 +36,7 @@ LIB_CPP_SRC=\
  common/odbc.cpp \
  common/postscrp.cpp \
  common/prntbase.cpp \
+ common/resource.cpp \
  common/serbase.cpp \
  common/string.cpp \
  common/textfile.cpp \
@@ -50,9 +51,12 @@ LIB_CPP_SRC=\
  common/mstream.cpp \
  common/zstream.cpp \
  common/objstrm.cpp \
+ common/validate.cpp \
+ common/wxexpr.cpp \
 \
  gtk/app.cpp \
  gtk/bitmap.cpp \
+ gtk/bmpbuttn.cpp \
  gtk/brush.cpp \
  gtk/button.cpp \
  gtk/checkbox.cpp \
index 4e33f54278948aa48cf32bd1fa7e1626c439d163..102ec21dc56600804cbcb8b176c329aaaa75e338 100644 (file)
@@ -40,24 +40,17 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
   event.SetEventObject(button);
   button->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
 wxBitmapButton::wxBitmapButton(void)
 {
-};
-
-wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
-{
-  Create( parent, id, bitmap, pos, size, style, name );
-};
+}
 
 bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
       const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
@@ -65,6 +58,8 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
 
   PreCreation( parent, id, pos, newSize, style, name );
   
+  SetValidator( validator );
+
   m_bitmap = bitmap;
   m_label = "";
   
@@ -78,7 +73,7 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
     
     gtk_widget_show( pixmap );
     gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
-  };
+  }
   
   if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
   if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
@@ -92,18 +87,19 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
   Show( TRUE );
     
   return TRUE;
-};
+}
       
 void wxBitmapButton::SetDefault(void)
 {
-};
+  gtk_widget_grab_default( m_widget );
+}
 
 void wxBitmapButton::SetLabel( const wxString &label )
 {
   wxControl::SetLabel( label );
-};
+}
 
 wxString wxBitmapButton::GetLabel(void) const
 {
   return wxControl::GetLabel();
-};
+}
index 6588daad60de53fcd677662b5d5a5eb1bb3325a8..5d95c5ea7b32e3b27af3904a6cac08472edbced6 100644 (file)
@@ -40,30 +40,25 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
   event.SetEventObject(button);
   button->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
 wxButton::wxButton(void)
 {
-};
-
-wxButton::wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
-{
-  Create( parent, id, label, pos, size, style, name );
-};
+}
 
 bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
       const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
 
   wxSize newSize = size;
 
   PreCreation( parent, id, pos, newSize, style, name );
+  
+  SetValidator( validator );
 
   m_widget = gtk_button_new_with_label( m_label );
   SetLabel(label);
@@ -80,11 +75,12 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
   Show( TRUE );
 
   return TRUE;
-};
+}
 
 void wxButton::SetDefault(void)
 {
-};
+  gtk_widget_grab_default( m_widget );
+}
 
 void wxButton::SetLabel( const wxString &label )
 {
@@ -92,5 +88,5 @@ void wxButton::SetLabel( const wxString &label )
   GtkButton *bin = GTK_BUTTON( m_widget );
   GtkLabel *g_label = GTK_LABEL( bin->child );
   gtk_label_set( g_label, GetLabel() );
-};
+}
 
index dd7ef5f9e19a41b5e5f3f6e38d78965bf5a08b9f..f42ef1867dde9b8c92e785cda71a16a7d49da0fb 100644 (file)
@@ -34,7 +34,7 @@ static void gtk_checkbox_clicked_callback( GtkWidget *WXUNUSED(widget), wxCheckB
   event.SetInt( cb->GetValue() );
   event.SetEventObject(cb);
   cb->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -42,23 +42,18 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox,wxControl)
 
 wxCheckBox::wxCheckBox(void)
 {
-};
-
-wxCheckBox::wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
-{
-  Create( parent, id, label, pos, size, style, name );
-};
+}
 
 bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
       const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   SetLabel( label );
 
   m_widget = gtk_check_button_new_with_label( label );
@@ -76,7 +71,7 @@ bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxCheckBox::SetValue( bool state )
 {
@@ -84,11 +79,11 @@ void wxCheckBox::SetValue( bool state )
     gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_ACTIVE );
   else
     gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_NORMAL );
-};
+}
 
 bool wxCheckBox::GetValue(void) const
 {
   GtkToggleButton *tb = GTK_TOGGLE_BUTTON(m_widget);
   return tb->active;
-};
+}
 
index 039b4fda7ff8e66bd186989662b0f5425c804896..033c4201bd135bfbf4c4a86901ca058d39c8d91d 100644 (file)
@@ -36,7 +36,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject(choice);
   choice->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -44,25 +44,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoice,wxControl)
 
 wxChoice::wxChoice(void)
 {
-};
-
-wxChoice::wxChoice( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      long style, const wxString &name )
-{
-  Create( parent, id, pos, size, n, choices, style, name );
-};
+}
 
 bool wxChoice::Create( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
       int n, const wxString choices[],
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_option_menu_new();
   
   wxSize newSize = size;
@@ -81,7 +75,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
       GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
     gtk_menu_append( GTK_MENU(menu), item );
     gtk_widget_show( item );
-  };
+  }
   gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
   
   PostCreation();
@@ -89,7 +83,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
       
 void wxChoice::Append( const wxString &item )
 {
@@ -100,14 +94,14 @@ void wxChoice::Append( const wxString &item )
     GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
   gtk_menu_append( GTK_MENU(menu), menu_item );
   gtk_widget_show( menu_item );
-};
+}
  
 void wxChoice::Clear(void)
 {
   gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
   GtkWidget *menu = gtk_menu_new();
   gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
-};
+}
 
 int wxChoice::FindString( const wxString &string ) const
 {
@@ -129,17 +123,17 @@ int wxChoice::FindString( const wxString &string ) const
     if (string == label->label) return count;
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: string not found" );
   
   return -1;
-};
+}
 
 int wxChoice::GetColumns(void) const
 {
   return 1;
-};
+}
 
 int wxChoice::GetSelection(void)
 {
@@ -152,12 +146,12 @@ int wxChoice::GetSelection(void)
     if (!bin->child) return count;
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: no selection" );
   
   return -1;
-};
+}
 
 wxString wxChoice::GetString( int n ) const
 {
@@ -176,15 +170,15 @@ wxString wxChoice::GetString( int n ) const
       
       if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
       return label->label;
-    };
+    }
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: string not found" );
   
   return "";
-};
+}
 
 wxString wxChoice::GetStringSelection(void) const
 {
@@ -193,7 +187,7 @@ wxString wxChoice::GetStringSelection(void) const
   wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
   
   return label->label;
-};
+}
 
 int wxChoice::Number(void) const
 {
@@ -204,13 +198,13 @@ int wxChoice::Number(void) const
   {
     count++;
     child = child->next;
-  };
+  }
   return count;
-};
+}
 
 void wxChoice::SetColumns( int WXUNUSED(n) )
 {
-};
+}
 
 void wxChoice::SetSelection( int n )
 {
@@ -218,11 +212,11 @@ void wxChoice::SetSelection( int n )
   gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
   
   gtk_choice_clicked_callback( NULL, this );
-};
+}
 
 void wxChoice::SetStringSelection( const wxString &string )
 {
   int n = FindString( string );
   if (n != -1) SetSelection( n );
-};
+}
 
index 6f0acae1372d3b828dcd292655c23cfdd1509062..bf9aa9dcc731ac2ade1f370ce883051fafc85668 100644 (file)
@@ -47,7 +47,7 @@ static void gtk_combo_clicked_callback( GtkWidget *WXUNUSED(widget), wxComboBox
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject(combo);
   combo->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 // size 
@@ -63,7 +63,7 @@ static gint gtk_combo_size_callback( GtkCombo *widget, GtkAllocation* alloc, wxC
     alloc->width - widget->button->allocation.width;
   
   return FALSE;
-};
+}
 */
 
 //-----------------------------------------------------------------------------
@@ -73,13 +73,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox,wxControl)
 bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
   const wxPoint& pos, const wxSize& size,
   int n, const wxString choices[],
-  long style, const wxString& name )
+  long style, const wxValidator& validator, const wxString& name )
 {
   m_alreadySent = FALSE;
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_combo_new();
   
   wxSize newSize = size;
@@ -102,7 +104,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
     
     gtk_signal_connect( GTK_OBJECT(list_item), "select", 
       GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
-  };
+  }
   
   PostCreation();
 
@@ -116,7 +118,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxComboBox::Clear(void)
 {
@@ -124,12 +126,12 @@ void wxComboBox::Clear(void)
   gtk_list_clear_items( GTK_LIST(list), 0, Number() );
   
   m_clientData.Clear();
-};
+}
 
 void wxComboBox::Append( const wxString &item )
 {
   Append( item, (char*)NULL );
-};
+}
 
 void wxComboBox::Append( const wxString &item, char *clientData )
 {
@@ -146,7 +148,7 @@ void wxComboBox::Append( const wxString &item, char *clientData )
   gtk_widget_show( list_item );
   
   m_clientData.Append( (wxObject*)clientData );
-};
+}
 
 void wxComboBox::Delete( int n )
 {
@@ -160,7 +162,7 @@ void wxComboBox::Delete( int n )
   }
   else
     m_clientData.DeleteNode( node );
-};
+}
 
 int wxComboBox::FindString( const wxString &item )
 {
@@ -175,12 +177,12 @@ int wxComboBox::FindString( const wxString &item )
     if (item == label->label) return count;
     count++;
     child = child->next;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: string not found" );
   
   return -1;
-};
+}
 
 char* wxComboBox::GetClientData( int n )
 {
@@ -190,7 +192,7 @@ char* wxComboBox::GetClientData( int n )
   wxFAIL_MSG( "wxComboBox: wrong index" );
   
   return NULL;
-};
+}
 
 void wxComboBox::SetClientData( int n, char * clientData )
 {
@@ -198,7 +200,7 @@ void wxComboBox::SetClientData( int n, char * clientData )
   if (node) node->SetData( (wxObject*) clientData );
   
   wxFAIL_MSG( "wxComboBox: wrong index" );
-};
+}
 
 int wxComboBox::GetSelection(void) const
 {
@@ -214,13 +216,13 @@ int wxComboBox::GetSelection(void) const
       if (child->data == selection->data) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   
   wxFAIL_MSG( "wxComboBox: no selection" );
   
   return -1;
-};
+}
 
 wxString wxComboBox::GetString( int n ) const
 {
@@ -232,12 +234,12 @@ wxString wxComboBox::GetString( int n ) const
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     return label->label;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: wrong index" );
   
   return "";
-};
+}
 
 wxString wxComboBox::GetStringSelection(void) const
 {
@@ -249,12 +251,12 @@ wxString wxComboBox::GetStringSelection(void) const
     GtkBin *bin = GTK_BIN( selection->data );
     wxString tmp = GTK_LABEL( bin->child )->label;
     return tmp;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: no selection" );
   
   return "";
-};
+}
 
 int wxComboBox::Number(void) const
 {
@@ -262,29 +264,29 @@ int wxComboBox::Number(void) const
   
   GList *child = GTK_LIST(list)->children;
   int count = 0;
-  while (child) { count++; child = child->next; };
+  while (child) { count++; child = child->next; }
   return count;
-};
+}
 
 void wxComboBox::SetSelection( int n )
 {
   GtkWidget *list = GTK_COMBO(m_widget)->list;
   gtk_list_select_item( GTK_LIST(list), n );
-};
+}
 
 void wxComboBox::SetStringSelection( const wxString &string )
 {
   int res = FindString( string );
   if (res == -1) return;
   SetSelection( res );
-};
+}
 
 wxString wxComboBox::GetValue(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   wxString tmp = gtk_entry_get_text( GTK_ENTRY(entry) );
   return tmp;
-};
+}
 
 void wxComboBox::SetValue( const wxString& value )
 {
@@ -292,52 +294,52 @@ void wxComboBox::SetValue( const wxString& value )
   wxString tmp = "";
   if (!value.IsNull()) tmp = value;
   gtk_entry_set_text( GTK_ENTRY(entry), tmp );
-};
+}
 
 void wxComboBox::Copy(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::Cut(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::Paste(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::SetInsertionPoint( long pos )
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int tmp = (int) pos;
   gtk_entry_set_position( GTK_ENTRY(entry), tmp );
-};
+}
 
 void wxComboBox::SetInsertionPointEnd(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int pos = GTK_ENTRY(entry)->text_length;
   SetInsertionPoint( pos-1 );
-};
+}
 
 long wxComboBox::GetInsertionPoint(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   return (long) GTK_EDITABLE(entry)->current_pos;
-};
+}
 
 long wxComboBox::GetLastPosition(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int pos = GTK_ENTRY(entry)->text_length;
   return (long) pos-1;
-};
+}
 
 void wxComboBox::Replace( long from, long to, const wxString& value )
 {
@@ -346,20 +348,20 @@ void wxComboBox::Replace( long from, long to, const wxString& value )
   if (value.IsNull()) return;
   gint pos = (gint)to;
   gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
-};
+}
 
 void wxComboBox::Remove(long from, long to)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
-};
+}
 
 void wxComboBox::SetSelection( long WXUNUSED(from), long WXUNUSED(to) )
 {
-};
+}
 
 void wxComboBox::SetEditable( bool WXUNUSED(editable) )
 {
-};
+}
 
       
index 7979f34d5c503c7db4d18d419160d23a8d4e008d..61bab59ecf0d26ea217725e7d3661ee0fa9a616b 100644 (file)
@@ -23,18 +23,18 @@ IMPLEMENT_DYNAMIC_CLASS(wxControl,wxWindow)
 wxControl::wxControl(void)
 {
   m_needParent = TRUE;
-};
+}
 
 wxControl::wxControl( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name ) :
   wxWindow( parent, id, pos, size, style, name )
 {
-};
+}
 
 void wxControl::Command( wxCommandEvent &WXUNUSED(event) )
 {
-};
+}
 
 void wxControl::SetLabel( const wxString &label )
 {
@@ -50,12 +50,12 @@ void wxControl::SetLabel( const wxString &label )
 
     m_label << *pc;
   }
-};
+}
 
 wxString wxControl::GetLabel(void) const
 {
   return m_label;
-};
+}
 
 
 
index 7230b92816308fb039cddc61aa59ca945b672cad..8499339d67e761ed6c8f97458f783ca7c9dfd496 100644 (file)
@@ -22,12 +22,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge,wxControl)
 
 bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
     const wxPoint& pos, const wxSize& size,
-    long style, const wxString& name )
+    long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_rangeMax = range;
   m_gaugePos = 0;
   m_useProgressBar = TRUE;
@@ -39,7 +41,7 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxGauge::SetRange( int r )
 {
@@ -47,7 +49,7 @@ void wxGauge::SetRange( int r )
   if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
   gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
 
 void wxGauge::SetValue( int pos )
 {
@@ -55,15 +57,15 @@ void wxGauge::SetValue( int pos )
   if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
   gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
 
 int wxGauge::GetRange(void) const
 {
   return m_rangeMax;
-};
+}
 
 int wxGauge::GetValue(void) const
 {
   return m_gaugePos;
-};
+}
 
index c8a8bea0d769cd17a23d7b5940b1edcddb0c9e46..e149810090cf6fa422e148a8d3bf8446f041718c 100644 (file)
@@ -55,7 +55,7 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
 
   listbox->GetEventHandler()->ProcessEvent( event );
   if (event.m_commandString) delete[] event.m_commandString ;
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -64,25 +64,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
 wxListBox::wxListBox(void)
 {
   m_list = NULL;
-};
-
-wxListBox::wxListBox( wxWindow *parent, wxWindowID id, 
-      const wxPoint &pos, const wxSize &size, 
-      int n, const wxString choices[],
-      long style, const wxString &name )
-{
-  Create( parent, id, pos, size, n, choices, style, name );
-};
+}
 
 bool wxListBox::Create( wxWindow *parent, wxWindowID id, 
       const wxPoint &pos, const wxSize &size, 
       int n, const wxString choices[],
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_scrolled_window_new( NULL, NULL );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
@@ -118,7 +112,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     m_clientData.Append( (wxObject*)NULL );
     
     gtk_widget_show( list_item );
-  };
+  }
  
   PostCreation();
   
@@ -127,12 +121,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
   Show( TRUE );
   
   return TRUE;
-};
+}
 
 void wxListBox::Append( const wxString &item )
 {
   Append( item, (char*)NULL );
-};
+}
 
 void wxListBox::Append( const wxString &item, char *clientData )
 {
@@ -151,14 +145,14 @@ void wxListBox::Append( const wxString &item, char *clientData )
   m_clientData.Append( (wxObject*)clientData );
   
   gtk_widget_show( list_item );
-};
+}
 
 void wxListBox::Clear(void)
 {
   gtk_list_clear_items( m_list, 0, Number() );
   
   m_clientData.Clear();
-};
+}
 
 void wxListBox::Delete( int n )
 {
@@ -171,12 +165,12 @@ void wxListBox::Delete( int n )
   }
   else
     m_clientData.DeleteNode( node );
-};
+}
 
 void wxListBox::Deselect( int n )
 {
   gtk_list_unselect_item( m_list, n );
-};
+}
 
 int wxListBox::FindString( const wxString &item ) const
 {
@@ -189,16 +183,16 @@ int wxListBox::FindString( const wxString &item ) const
     if (item == label->label) return count;
     count++;
     child = child->next;
-  };
+  }
   return -1;
-};
+}
 
 char *wxListBox::GetClientData( int n ) const
 {
   wxNode *node = m_clientData.Nth( n );
   if (node) return ((char*)node->Data());
   return NULL;
-};
+}
 
 int wxListBox::GetSelection(void) const
 {
@@ -212,10 +206,10 @@ int wxListBox::GetSelection(void) const
       if (child->data == selection->data) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   return -1;
-};
+}
 
 int wxListBox::GetSelections(wxArrayInt& aSelections) const
 {
@@ -240,7 +234,7 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const
   }
   
   return count;
-};
+}
 
 wxString wxListBox::GetString( int n ) const
 {
@@ -250,9 +244,9 @@ wxString wxListBox::GetString( int n ) const
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     return label->label;
-  };
+  }
   return "";
-};
+}
 
 wxString wxListBox::GetStringSelection(void) const
 {
@@ -262,17 +256,17 @@ wxString wxListBox::GetStringSelection(void) const
     GtkBin *bin = GTK_BIN( selection->data );
     wxString tmp = GTK_LABEL( bin->child )->label;
     return tmp;
-  };
+  }
   return "";
-};
+}
 
 int wxListBox::Number(void)
 {
   GList *child = m_list->children;
   int count = 0;
-  while (child) { count++; child = child->next; };
+  while (child) { count++; child = child->next; }
   return count;
-};
+}
 
 bool wxListBox::Selected( int n )
 {
@@ -284,28 +278,28 @@ bool wxListBox::Selected( int n )
     {
       if (child->data == target->data) return TRUE;
       child = child->next;
-    };
-  };
+    }
+  }
   return FALSE;
-};
+}
 
 void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
 {
-};
+}
 
 void wxListBox::SetClientData( int n, char *clientData )
 {
   wxNode *node = m_clientData.Nth( n );
   if (node) node->SetData( (wxObject*)clientData );
-};
+}
 
 void wxListBox::SetFirstItem( int WXUNUSED(n) )
 {
-};
+}
 
 void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
 {
-};
+}
 
 void wxListBox::SetSelection( int n, bool select )
 {
@@ -313,7 +307,7 @@ void wxListBox::SetSelection( int n, bool select )
     gtk_list_select_item( m_list, n );
   else
     gtk_list_unselect_item( m_list, n );
-};
+}
 
 void wxListBox::SetString( int n, const wxString &string )
 {
@@ -323,13 +317,13 @@ void wxListBox::SetString( int n, const wxString &string )
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     gtk_label_set( label, string );
-  };
-};
+  }
+}
 
 void wxListBox::SetStringSelection( const wxString &string, bool select )
 {
   SetSelection( FindString(string), select );
-};
+}
 
 int wxListBox::GetIndex( GtkWidget *item ) const
 {
@@ -342,15 +336,15 @@ int wxListBox::GetIndex( GtkWidget *item ) const
       if (GTK_WIDGET(child->data) == item) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   return -1;
-};
+}
 
 GtkWidget *wxListBox::GetConnectWidget(void)
 {
   return GTK_WIDGET(m_list);
-};
+}
 
 
 
index 93bc49891bd0fb0c2430bd1c92e1d12193332d25..35832b897f74a4d62acba2d8cee87b44329ebe24 100644 (file)
@@ -42,7 +42,7 @@ wxMenuBar::wxMenuBar()
   PostCreation();
 
   Show( TRUE );
-};
+}
 
 void wxMenuBar::Append( wxMenu *menu, const wxString &title )
 {
@@ -61,7 +61,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
   gtk_menu_item_set_submenu( GTK_MENU_ITEM(root_menu), menu->m_menu );
 
   gtk_menu_bar_append( GTK_MENU_BAR(m_menubar), root_menu );
-};
+}
 
 static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
 {
@@ -69,7 +69,7 @@ static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString
   {
     int res = menu->FindItem( itemString );
     if (res != -1) return res;
-  };
+  }
   wxNode *node = menu->m_items.First();
   while (node)
   {
@@ -77,9 +77,9 @@ static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString
     if (item->IsSubMenu())
       return FindMenuItemRecursive(item->GetSubMenu(), menuString, itemString);
     node = node->Next();
-  };
+  }
   return -1;
-};
+}
 
 int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemString ) const
 {
@@ -90,9 +90,9 @@ int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemStr
     int res = FindMenuItemRecursive( menu, menuString, itemString);
     if (res != -1) return res;
     node = node->Next();
-  };
+  }
   return -1;
-};
+}
 
 // Find a wxMenuItem using its id. Recurses down into sub-menus
 static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
@@ -105,10 +105,10 @@ static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
     if ( item->IsSubMenu() )
       result = FindMenuItemByIdRecursive( item->GetSubMenu(), id );
     node = node->Next();
-  };
+  }
 
   return result;
-};
+}
 
 wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
 {
@@ -127,48 +127,55 @@ void wxMenuBar::Check( int id, bool check )
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) item->Check(check);
-};
+}
 
 bool wxMenuBar::Checked( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsChecked();
   return FALSE;
-};
+}
 
 void wxMenuBar::Enable( int id, bool enable )
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) item->Enable(enable);
-};
+}
 
 bool wxMenuBar::Enabled( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsEnabled();
   return FALSE;
-};
+}
 
 //-----------------------------------------------------------------------------
 // wxMenu
 //-----------------------------------------------------------------------------
 
-void gtk_menu_clicked_callback( GtkWidget *widget, gpointer data )
+static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
 {
-  wxMenu *menu = (wxMenu*)data;
   int id = menu->FindMenuIdByMenuItem(widget);
 
   wxASSERT( id != -1 ); // should find it!
 
-  if (!menu->IsEnabled(id))
-    return;
+  if (!menu->IsEnabled(id)) return;
 
   wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, id );
   event.SetEventObject( menu );
   event.SetInt(id );
+  
+  if (menu->m_callback)
+  {
+     (void) (*(menu->m_callback)) (*menu, event);
+     return;
+  }
+
+  if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
   wxWindow *win = menu->GetInvokingWindow();
   if (win) win->GetEventHandler()->ProcessEvent( event );
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
 
@@ -180,7 +187,7 @@ wxMenuItem::wxMenuItem()
   m_isEnabled = TRUE;
   m_subMenu = NULL;
   m_menuItem = NULL;
-};
+}
 
 void wxMenuItem::SetText(const wxString& str)
 {
@@ -214,13 +221,21 @@ bool wxMenuItem::IsChecked() const
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
 
-wxMenu::wxMenu( const wxString &title )
+wxMenu::wxMenu( const wxString& title, const wxFunction func )
 {
   m_title = title;
   m_items.DeleteContents( TRUE );
   m_invokingWindow = NULL;
   m_menu = gtk_menu_new();  // Do not show!
-};
+  m_callback = func;
+  m_eventHandler = this;
+  if (m_title.IsNull()) m_title = "";
+  if (m_title != "")
+  {
+    Append(-2, m_title);
+    AppendSeparator();
+  }
+}
 
 void wxMenu::AppendSeparator()
 {
@@ -232,7 +247,7 @@ void wxMenu::AppendSeparator()
   gtk_widget_show( menuItem );
   mitem->SetMenuItem(menuItem);
   m_items.Append( mitem );
-};
+}
 
 void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
 {
@@ -253,7 +268,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
   gtk_menu_append( GTK_MENU(m_menu), menuItem );
   gtk_widget_show( menuItem );
   m_items.Append( mitem );
-};
+}
 
 void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxString &helpStr )
 {
@@ -270,7 +285,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
   gtk_menu_append( GTK_MENU(m_menu), menuItem );
   gtk_widget_show( menuItem );
   m_items.Append( mitem );
-};
+}
 
 int wxMenu::FindItem( const wxString itemString ) const
 {
@@ -289,17 +304,17 @@ int wxMenu::FindItem( const wxString itemString ) const
     if (item->GetText() == s)
       return item->GetId();
     node = node->Next();
-  };
+  }
 
   return -1;
-};
+}
 
 void wxMenu::Enable( int id, bool enable )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->Enable(enable);
-};
+}
 
 bool wxMenu::IsEnabled( int id ) const
 {
@@ -308,14 +323,14 @@ bool wxMenu::IsEnabled( int id ) const
     return item->IsEnabled();
   else
     return FALSE;
-};
+}
 
 void wxMenu::Check( int id, bool enable )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->Check(enable);
-};
+}
 
 bool wxMenu::IsChecked( int id ) const
 {
@@ -324,14 +339,14 @@ bool wxMenu::IsChecked( int id ) const
     return item->IsChecked();
   else
     return FALSE;
-};
+}
 
 void wxMenu::SetLabel( int id, const wxString &label )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->SetText(label);
-};
+}
 
 int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
 {
@@ -342,10 +357,10 @@ int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
     if (item->GetMenuItem() == menuItem)
       return item->GetId();
     node = node->Next();
-  };
+  }
 
   return -1;
-};
+}
 
 wxMenuItem *wxMenu::FindItem(int id) const
 {
@@ -355,7 +370,7 @@ wxMenuItem *wxMenu::FindItem(int id) const
     if ( item->GetId() == id )
       return item;
     node = node->Next();
-  };
+  }
 
   wxLogDebug(_("wxMenu::FindItem: item %d not found."), id);
 
@@ -365,11 +380,11 @@ wxMenuItem *wxMenu::FindItem(int id) const
 void wxMenu::SetInvokingWindow( wxWindow *win )
 {
   m_invokingWindow = win;
-};
+}
 
 wxWindow *wxMenu::GetInvokingWindow()
 {
   return m_invokingWindow;
-};
+}
 
 
index 64a36484027a0c076b7240c46b60dc4a8fc5fb5a..6195828b7a2561011ba0d403bb8c8c87522d693c 100644 (file)
@@ -47,7 +47,7 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject( rb );
   rb->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -55,28 +55,20 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
 
 wxRadioBox::wxRadioBox(void)
 {
-};
-
-wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      int majorDim, long style,
-      const wxString &name )
-{
-  Create( parent, id, title, pos, size, n, choices, majorDim, style, name );
-};
+}
 
 bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
       const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      int WXUNUSED(majorDim), long style,
-      const wxString &name )
+      int n, const wxString choices[], int WXUNUSED(majorDim), 
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_alreadySent = FALSE;
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   m_widget = gtk_frame_new( title );
   
   int x = m_x+5;
@@ -111,8 +103,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
       y += 20;
       height += 20;
       
-    };
-  };
+    }
+  }
 
   wxSize newSize = size;
   if (newSize.x == -1) newSize.x = maxLen+10;
@@ -124,7 +116,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 bool wxRadioBox::Show( bool show )
 {
@@ -136,10 +128,10 @@ bool wxRadioBox::Show( bool show )
     GtkWidget *w = GTK_WIDGET( item->data );
     if (show) gtk_widget_show( w ); else gtk_widget_hide( w );
     item = item->next;
-  };
+  }
 
   return TRUE;
-};
+}
 
 int wxRadioBox::FindString( const wxString &s ) const
 {
@@ -154,10 +146,10 @@ int wxRadioBox::FindString( const wxString &s ) const
     if (s == l->label) return count;
     count--;
     item = item->next;
-  };
+  }
 
   return -1;
-};
+}
 
 void wxRadioBox::SetSelection( int n )
 {
@@ -168,7 +160,7 @@ void wxRadioBox::SetSelection( int n )
   GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
   
   gtk_toggle_button_set_state( button, 1 );
-};
+}
 
 int wxRadioBox::GetSelection(void) const
 {
@@ -180,9 +172,9 @@ int wxRadioBox::GetSelection(void) const
     if (GTK_TOGGLE_BUTTON(button)->active) return count;
     count++;
     item = item->next;
-  };
+  }
   return -1;
-};
+}
 
 wxString wxRadioBox::GetString( int n ) const
 {
@@ -196,48 +188,48 @@ wxString wxRadioBox::GetString( int n ) const
   GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
   
   return wxString( label->label );
-};
+}
 
 wxString wxRadioBox::GetLabel(void) const
 {
   return wxControl::GetLabel();
-};
+}
 
 void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
 {
   wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
   return "";
-};
+}
 
 void wxRadioBox::Enable( bool WXUNUSED(enable) )
 {
   wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
 
 void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
 {
   wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
 
 void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
 {
   wxFAIL_MSG("wxRadioBox::Show not implemented.");
-};
+}
 
 wxString wxRadioBox::GetStringSelection(void) const
 {
@@ -249,11 +241,11 @@ wxString wxRadioBox::GetStringSelection(void) const
     {
       GtkLabel *label = GTK_LABEL( button->child );
       return label->label;
-    };
+    }
     item = item->next;
-  };
+  }
   return "";
-};
+}
 
 bool wxRadioBox::SetStringSelection( const wxString&s )
 {
@@ -261,7 +253,7 @@ bool wxRadioBox::SetStringSelection( const wxString&s )
   if (res == -1) return FALSE;
   SetSelection( res );
   return TRUE;
-};
+}
 
 int wxRadioBox::Number(void) const
 {
@@ -271,17 +263,17 @@ int wxRadioBox::Number(void) const
   {
     item = item->next;
     count++;
-  };
+  }
   return count;
-};
+}
 
 int wxRadioBox::GetNumberOfRowsOrCols(void) const
 {
   return 1;
-};
+}
 
 void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
 {
   wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
-};
+}
 
index e4748739916231e8333e3fdcff91f6e507696c5c..3cd45f2b8af212b82bba2fd44848002b1690d60c 100644 (file)
 
 #include "wx/radiobut.h"
 
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern bool g_blockEventsOnDrag;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
+  
+static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRadioButton *rb )
+{
+  if (!rb->HasVMT()) return;
+  if (g_blockEventsOnDrag) return;
+  
+  wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
+  event.SetInt( rb->GetValue() );
+  event.SetEventObject( rb );
+  rb->GetEventHandler()->ProcessEvent( event );
+}
+
+bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
+  const wxPoint& pos,  const wxSize& size, long style,
+  const wxValidator& validator, const wxString& name )
+{
+  m_needParent = TRUE;
+
+  wxSize newSize = size;
+
+  PreCreation( parent, id, pos, newSize, style, name );
+  
+  SetValidator( validator );
+
+  m_widget = gtk_radio_button_new_with_label( NULL, label );
+      
+  SetLabel(label);
+
+  if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+  if (newSize.y == -1) newSize.y = 26;
+  SetSize( newSize.x, newSize.y );
+
+  gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", 
+    GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+       
+  PostCreation();
+
+  Show( TRUE );
+
+  return TRUE;
+}
+
+void wxRadioButton::SetLabel( const wxString& label )
+{
+  wxControl::SetLabel( label );
+  GtkButton *bin = GTK_BUTTON( m_widget );
+  GtkLabel *g_label = GTK_LABEL( bin->child );
+  gtk_label_set( g_label, GetLabel() );
+}
+
+void wxRadioButton::SetValue( bool val )
+{
+  gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
+}
+
+bool wxRadioButton::GetValue(void) const
+{
+  return GTK_TOGGLE_BUTTON(m_widget)->active;
+}
+
+
index 37396d960552a9eb0c100ea1fac5860fb852cb90..ab1482b00601f4882445bd69cda8e92f402084a0 100644 (file)
@@ -59,29 +59,24 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
   cevent.SetEventObject( win );
   win->ProcessEvent( cevent );
 */
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxScrollBar,wxControl)
 
-wxScrollBar::wxScrollBar(wxWindow *parent, wxWindowID id,
-           const wxPoint& pos, const wxSize& size,
-           long style, const wxString& name )
-{
-  Create( parent, id, pos, size, style, name );
-};
-
 wxScrollBar::~wxScrollBar(void)
 {
-};
+}
 
 bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxPoint& pos, const wxSize& size,
-           long style, const wxString& name )
+           long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_oldPos = 0.0;
 
   if (style & wxSB_VERTICAL == wxSB_VERTICAL)
@@ -99,27 +94,27 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 int wxScrollBar::GetPosition(void) const
 {
   return (int)(m_adjust->value+0.5);
-};
+}
 
 int wxScrollBar::GetThumbSize() const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 int wxScrollBar::GetPageSize() const
 {
   return (int)(m_adjust->page_increment+0.5);
-};
+}
 
 int wxScrollBar::GetRange() const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 void wxScrollBar::SetPosition( int viewStart )
 {
@@ -129,7 +124,7 @@ void wxScrollBar::SetPosition( int viewStart )
   m_adjust->value = fpos;
   
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
 
 void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize,
       bool WXUNUSED(refresh) )
@@ -154,18 +149,18 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page
   m_adjust->page_size = fthumb;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 // Backward compatibility
 int wxScrollBar::GetValue(void) const
 {
   return GetPosition();
-};
+}
 
 void wxScrollBar::SetValue( int viewStart )
 {
   SetPosition( viewStart );
-};
+}
 
 void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
 {
@@ -178,17 +173,17 @@ void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength,
   *viewLength = range;
   *objectLength = thumb;
   *pageLength = page;
-};
+}
 
 int wxScrollBar::GetViewLength() const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 int wxScrollBar::GetObjectLength() const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 void wxScrollBar::SetPageSize( int pageLength )
 {
@@ -196,7 +191,7 @@ void wxScrollBar::SetPageSize( int pageLength )
   int thumb = (int)(m_adjust->page_size+0.5);
   int range = (int)(m_adjust->upper+0.5);
   SetScrollbar( pos, thumb, range, pageLength );
-};
+}
 
 void wxScrollBar::SetObjectLength( int objectLength )
 {
@@ -204,7 +199,7 @@ void wxScrollBar::SetObjectLength( int objectLength )
   int page = (int)(m_adjust->page_increment+0.5);
   int range = (int)(m_adjust->upper+0.5);
   SetScrollbar( pos, objectLength, range, page );
-};
+}
 
 void wxScrollBar::SetViewLength( int viewLength )
 {
@@ -212,5 +207,5 @@ void wxScrollBar::SetViewLength( int viewLength )
   int thumb = (int)(m_adjust->page_size+0.5);
   int page = (int)(m_adjust->page_increment+0.5);
   SetScrollbar( pos, thumb, viewLength, page );
-};
+}
 
index fd8d17b8d675290fa77f4d70d3746719532aa28c..01440975b1034fad942ee4bd5532ecea317038af 100644 (file)
@@ -57,40 +57,29 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
   wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
   cevent.SetEventObject( win );
   win->ProcessEvent( cevent );
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
 
 wxSlider::wxSlider(void)
 {
-};
-
-wxSlider::wxSlider( wxWindow *parent, wxWindowID id,
-        int value, int minValue, int maxValue,
-        const wxPoint& pos, const wxSize& size,
-        long style,
-/*      const wxValidator& validator = wxDefaultValidator, */
-        const wxString& name )
-{
-  Create( parent, id, value, minValue, maxValue,
-          pos, size, style, name );
-};
+}
 
 wxSlider::~wxSlider(void)
 {
-};
+}
 
 bool wxSlider::Create(wxWindow *parent, wxWindowID id,
         int value, int minValue, int maxValue,
         const wxPoint& pos, const wxSize& size,
-        long style,
-/*      const wxValidator& validator = wxDefaultValidator, */
-        const wxString& name )
+        long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_oldPos = 0.0;
 
   if (style & wxSL_VERTICAL == wxSL_VERTICAL)
@@ -110,12 +99,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 int wxSlider::GetValue(void) const
 {
   return (int)(m_adjust->value+0.5);
-};
+}
 
 void wxSlider::SetValue( int value )
 {
@@ -125,7 +114,7 @@ void wxSlider::SetValue( int value )
   m_adjust->value = fpos;
   
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
 
 void wxSlider::SetRange( int minValue, int maxValue )
 {
@@ -140,17 +129,17 @@ void wxSlider::SetRange( int minValue, int maxValue )
   m_adjust->upper = fmax;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetMin(void) const
 {
   return (int)(m_adjust->lower+0.5);
-};
+}
 
 int wxSlider::GetMax(void) const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 void wxSlider::SetPageSize( int pageSize )
 {
@@ -161,12 +150,12 @@ void wxSlider::SetPageSize( int pageSize )
   m_adjust->page_increment = fpage;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetPageSize(void) const
 {
   return (int)(m_adjust->page_increment+0.5);
-};
+}
 
 void wxSlider::SetThumbLength( int len )
 {
@@ -177,71 +166,71 @@ void wxSlider::SetThumbLength( int len )
   m_adjust->page_size = flen;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetThumbLength(void) const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 void wxSlider::SetLineSize( int WXUNUSED(lineSize) )
 {
-};
+}
 
 int wxSlider::GetLineSize(void) const
 {
   return 0;
-};
+}
 
 // not supported in wxGTK (and GTK)
 
 void wxSlider::GetSize( int *x, int *y ) const
 {
   wxWindow::GetSize( x, y );
-};
+}
 
 void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
   wxWindow::SetSize( x, y, width, height, sizeFlags );
-};
+}
 
 void wxSlider::GetPosition( int *x, int *y ) const
 {
   wxWindow::GetPosition( x, y );
-};
+}
 
 void wxSlider::SetTick( int WXUNUSED(tickPos) )
 {
-};
+}
 
 void wxSlider::SetTickFreq( int WXUNUSED(n), int WXUNUSED(pos) )
 {
-};
+}
 
 int wxSlider::GetTickFreq(void) const
 {
   return 0;
-};
+}
 
 void wxSlider::ClearTicks(void)
 {
-};
+}
 
 void wxSlider::SetSelection( int WXUNUSED(minPos), int WXUNUSED(maxPos) )
 {
-};
+}
 
 int wxSlider::GetSelEnd(void) const
 {
   return 0;
-};
+}
 
 int wxSlider::GetSelStart(void) const
 {
   return 0;
-};
+}
 
 void wxSlider::ClearSel(void)
 {
-};
+}
 
index d1a19473eb7b31f0b477dbfeae5127f0e92cac7c..46d4e1bffb461a14b940978a41068e877b11b8ce 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
 
-void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
+static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
 {
   win->SetModified();
-};
+}
 
 
 BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
@@ -34,31 +34,31 @@ END_EVENT_TABLE()
 
 wxTextCtrl::wxTextCtrl(void) : streambuf()
 {
-    if( allocate() )
-  setp(base(),ebuf());
+  if (allocate()) setp(base(),ebuf());
 
   m_modified = FALSE;
-};
+}
 
 wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
       const wxPoint &pos, const wxSize &size,
-      int style, const wxString &name ) : streambuf()
+      int style, const wxValidator& validator, const wxString &name ) : streambuf()
 {
-  if( allocate() )
-    setp(base(),ebuf());
+  if (allocate()) setp(base(),ebuf());
 
   m_modified = FALSE;
-  Create( parent, id, value, pos, size, style, name );
-};
+  Create( parent, id, value, pos, size, style, validator, name );
+}
 
 bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
       const wxPoint &pos, const wxSize &size,
-      int style, const wxString &name )
+      int style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
 
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   bool bMultiLine = (style & wxTE_MULTILINE) != 0;
   if ( bMultiLine )
   {
@@ -121,7 +121,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
   {
     gint tmp = 0;
     gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
-  };
+  }
 
   if (style & wxTE_READONLY)
   {
@@ -130,12 +130,12 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
   {
     if ( bMultiLine )
       gtk_text_set_editable( GTK_TEXT(m_text), 1 );
-  };
+  }
 
   Show( TRUE );
 
   return TRUE;
-};
+}
 
 wxString wxTextCtrl::GetValue(void) const
 {
@@ -148,9 +148,9 @@ wxString wxTextCtrl::GetValue(void) const
   else
   {
     tmp = gtk_entry_get_text( GTK_ENTRY(m_text) );
-  };
+  }
   return tmp;
-};
+}
 
 void wxTextCtrl::SetValue( const wxString &value )
 {
@@ -166,8 +166,8 @@ void wxTextCtrl::SetValue( const wxString &value )
   else
   {
     gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
-  };
-};
+  }
+}
 
 void wxTextCtrl::WriteText( const wxString &text )
 {
@@ -181,44 +181,44 @@ void wxTextCtrl::WriteText( const wxString &text )
   else
   {
     gtk_entry_append_text( GTK_ENTRY(m_text), text );
-  };
-};
+  }
+}
 
 bool wxTextCtrl::LoadFile( const wxString &WXUNUSED(file) )
 {
-  wxFAIL_MSG(_("wxTextCtrl::LoadFile not implemented"));
+  wxFAIL_MSG( "wxTextCtrl::LoadFile not implemented" );
 
   return FALSE;
-};
+}
 
 bool wxTextCtrl::SaveFile( const wxString &WXUNUSED(file) )
 {
-  wxFAIL_MSG(_("wxTextCtrl::SaveFile not implemented"));
+  wxFAIL_MSG( "wxTextCtrl::SaveFile not implemented" );
 
   return FALSE;
-};
+}
 
 /*
 wxString wxTextCtrl::GetLineText( long lineNo ) const
 {
-};
+}
 
 
 void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
 {
-};
+}
 
 long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
 {
-};
+}
 
 long wxTextCtrl::XYToPosition( long x, long y )
 {
-};
+}
 
 int wxTextCtrl::GetNumberOfLines(void)
 {
-};
+}
 
 */
 void wxTextCtrl::SetInsertionPoint( long pos )
@@ -228,7 +228,7 @@ void wxTextCtrl::SetInsertionPoint( long pos )
     gtk_text_set_point( GTK_TEXT(m_text), tmp );
   else
     gtk_entry_set_position( GTK_ENTRY(m_text), tmp );
-};
+}
 
 void wxTextCtrl::SetInsertionPointEnd(void)
 {
@@ -238,7 +238,7 @@ void wxTextCtrl::SetInsertionPointEnd(void)
   else
     pos = GTK_ENTRY(m_text)->text_length;
   SetInsertionPoint( pos-1 );
-};
+}
 
 void wxTextCtrl::SetEditable( bool editable )
 {
@@ -246,22 +246,22 @@ void wxTextCtrl::SetEditable( bool editable )
     gtk_text_set_editable( GTK_TEXT(m_text), editable );
   else
     gtk_entry_set_editable( GTK_ENTRY(m_text), editable );
-};
+}
 
 void wxTextCtrl::SetSelection( long from, long to )
 {
   gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
 
 void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
 {
   wxFAIL_MSG(_("wxTextCtrl::ShowPosition not implemented"));
-};
+}
 
 long wxTextCtrl::GetInsertionPoint(void) const
 {
   return (long) GTK_EDITABLE(m_text)->current_pos;
-};
+}
 
 long wxTextCtrl::GetLastPosition(void) const
 {
@@ -271,12 +271,12 @@ long wxTextCtrl::GetLastPosition(void) const
   else
     pos = GTK_ENTRY(m_text)->text_length;
   return (long)pos-1;
-};
+}
 
 void wxTextCtrl::Remove( long from, long to )
 {
   gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
 
 void wxTextCtrl::Replace( long from, long to, const wxString &value )
 {
@@ -284,31 +284,31 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value )
   if (value.IsNull()) return;
   gint pos = (gint)to;
   gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
-};
+}
 
 void wxTextCtrl::Cut(void)
 {
   gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Copy(void)
 {
   gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Paste(void)
 {
   gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Delete(void)
 {
   SetValue( "" );
-};
+}
 
 void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
 {
-};
+}
 
 int wxTextCtrl::overflow( int WXUNUSED(c) )
 {
@@ -320,7 +320,7 @@ int wxTextCtrl::overflow( int WXUNUSED(c) )
   setp(pbase(), epptr());
   delete[] txt;
   return EOF;
-};
+}
 
 int wxTextCtrl::sync(void)
 {
@@ -332,12 +332,12 @@ int wxTextCtrl::sync(void)
   setp(pbase(), epptr());
   delete[] txt;
   return 0;
-};
+}
 
 int wxTextCtrl::underflow(void)
 {
   return EOF;
-};
+}
 
 wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
 {
@@ -390,7 +390,7 @@ wxTextCtrl& wxTextCtrl::operator<<(const char c)
 GtkWidget* wxTextCtrl::GetConnectWidget(void)
 {
   return GTK_WIDGET(m_text);
-};
+}
 
 
 
index d829d20532dd501acfa09e4170e463e2015292f0..3fdfdfde0fce7ee89d96d1427db3c61413cafb0a 100644 (file)
@@ -57,6 +57,25 @@ void wxDisplaySize( int *width, int *height )
   if (height) *height = gdk_screen_height();
 }
 
+void wxGetMousePosition( int* x, int* y )
+{
+  wxFAIL_MSG( "GetMousePosition not yet implemented" );
+  if (x) *x = 0;
+  if (y) *y = 0;
+};
+
+bool wxColourDisplay(void)
+{
+  wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+  return TRUE;
+}
+
+int wxDisplayDepth(void)
+{
+  wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+  return 8;
+}
+
 //------------------------------------------------------------------------
 // user and home routines
 //------------------------------------------------------------------------
index 9839c6b049d07b4d5503958a8570fc1f1ad32bc5..9457a59a57cbf194b81e2d8ad35269a29d8f0b1f 100644 (file)
@@ -754,22 +754,16 @@ wxWindow::wxWindow()
   m_resizing = FALSE;
 }
 
-wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
-{
-  m_cursor = NULL;
-  Create( parent, id, pos, size, style, name );
-}
-
 bool wxWindow::Create( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
+      long style, const wxString &name  )
 {
   m_isShown = FALSE;
   m_isEnabled = TRUE;
   m_needParent = TRUE;
   
+  m_cursor = NULL;
+  
   PreCreation( parent, id, pos, size, style, name );
   
   m_widget = gtk_scrolled_window_new( NULL, NULL );
@@ -887,8 +881,7 @@ wxWindow::~wxWindow(void)
     m_windowSizer = NULL;
   }
   // If this is a child of a sizer, remove self from parent
-  if (m_sizerParent)
-    m_sizerParent->RemoveChild((wxWindow *)this);
+  if (m_sizerParent) m_sizerParent->RemoveChild((wxWindow *)this);
 
   // Just in case the window has been Closed, but
   // we're then deleting immediately: don't leave
@@ -900,6 +893,7 @@ wxWindow::~wxWindow(void)
   // class
   wxTopLevelWindows.DeleteObject(this);
     
+  if (m_windowValidator) delete m_windowValidator;
 }
 
 void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
@@ -921,7 +915,6 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   if (m_height == -1) m_height = 20;
   m_retCode = 0;
   m_eventHandler = this;
-  m_windowValidator = NULL;
   m_windowId = id;
   m_sizeSet = FALSE;
   if (m_cursor == NULL)
@@ -940,6 +933,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
   m_resizing = FALSE;
+  m_windowValidator = NULL;
 }
 
 void wxWindow::PostCreation(void)
@@ -1580,9 +1574,11 @@ wxValidator *wxWindow::GetValidator(void)
   return m_windowValidator;
 }
 
-void wxWindow::SetValidator( wxValidator *validator )
+void wxWindow::SetValidator( const wxValidator& validator )
 {
-  m_windowValidator = validator;
+  if (m_windowValidator) delete m_windowValidator;
+  m_windowValidator = validator.Clone();
+  if (m_windowValidator) m_windowValidator->SetWindow(this);
 }
 
 bool wxWindow::IsBeingDeleted(void)
@@ -1696,6 +1692,16 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
   // do something ?
 }
 
+wxColour wxWindow::GetForegroundColour(void) const
+{
+  return m_foregroundColour;
+}
+
+void wxWindow::SetForegroundColour( const wxColour &colour )
+{
+  m_foregroundColour = colour;
+}
+
 bool wxWindow::Validate(void)
 {
   wxNode *node = GetChildren()->First();
index 4e33f54278948aa48cf32bd1fa7e1626c439d163..102ec21dc56600804cbcb8b176c329aaaa75e338 100644 (file)
@@ -40,24 +40,17 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
   event.SetEventObject(button);
   button->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
 wxBitmapButton::wxBitmapButton(void)
 {
-};
-
-wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-      const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
-{
-  Create( parent, id, bitmap, pos, size, style, name );
-};
+}
 
 bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
       const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
@@ -65,6 +58,8 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
 
   PreCreation( parent, id, pos, newSize, style, name );
   
+  SetValidator( validator );
+
   m_bitmap = bitmap;
   m_label = "";
   
@@ -78,7 +73,7 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
     
     gtk_widget_show( pixmap );
     gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
-  };
+  }
   
   if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
   if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
@@ -92,18 +87,19 @@ bool wxBitmapButton::Create(  wxWindow *parent, wxWindowID id, const wxBitmap &b
   Show( TRUE );
     
   return TRUE;
-};
+}
       
 void wxBitmapButton::SetDefault(void)
 {
-};
+  gtk_widget_grab_default( m_widget );
+}
 
 void wxBitmapButton::SetLabel( const wxString &label )
 {
   wxControl::SetLabel( label );
-};
+}
 
 wxString wxBitmapButton::GetLabel(void) const
 {
   return wxControl::GetLabel();
-};
+}
index 6588daad60de53fcd677662b5d5a5eb1bb3325a8..5d95c5ea7b32e3b27af3904a6cac08472edbced6 100644 (file)
@@ -40,30 +40,25 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
   event.SetEventObject(button);
   button->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
 wxButton::wxButton(void)
 {
-};
-
-wxButton::wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
-{
-  Create( parent, id, label, pos, size, style, name );
-};
+}
 
 bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
       const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
 
   wxSize newSize = size;
 
   PreCreation( parent, id, pos, newSize, style, name );
+  
+  SetValidator( validator );
 
   m_widget = gtk_button_new_with_label( m_label );
   SetLabel(label);
@@ -80,11 +75,12 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
   Show( TRUE );
 
   return TRUE;
-};
+}
 
 void wxButton::SetDefault(void)
 {
-};
+  gtk_widget_grab_default( m_widget );
+}
 
 void wxButton::SetLabel( const wxString &label )
 {
@@ -92,5 +88,5 @@ void wxButton::SetLabel( const wxString &label )
   GtkButton *bin = GTK_BUTTON( m_widget );
   GtkLabel *g_label = GTK_LABEL( bin->child );
   gtk_label_set( g_label, GetLabel() );
-};
+}
 
index dd7ef5f9e19a41b5e5f3f6e38d78965bf5a08b9f..f42ef1867dde9b8c92e785cda71a16a7d49da0fb 100644 (file)
@@ -34,7 +34,7 @@ static void gtk_checkbox_clicked_callback( GtkWidget *WXUNUSED(widget), wxCheckB
   event.SetInt( cb->GetValue() );
   event.SetEventObject(cb);
   cb->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -42,23 +42,18 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox,wxControl)
 
 wxCheckBox::wxCheckBox(void)
 {
-};
-
-wxCheckBox::wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
-      const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
-{
-  Create( parent, id, label, pos, size, style, name );
-};
+}
 
 bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
       const wxPoint &pos, const wxSize &size, 
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   SetLabel( label );
 
   m_widget = gtk_check_button_new_with_label( label );
@@ -76,7 +71,7 @@ bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxCheckBox::SetValue( bool state )
 {
@@ -84,11 +79,11 @@ void wxCheckBox::SetValue( bool state )
     gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_ACTIVE );
   else
     gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_NORMAL );
-};
+}
 
 bool wxCheckBox::GetValue(void) const
 {
   GtkToggleButton *tb = GTK_TOGGLE_BUTTON(m_widget);
   return tb->active;
-};
+}
 
index 039b4fda7ff8e66bd186989662b0f5425c804896..033c4201bd135bfbf4c4a86901ca058d39c8d91d 100644 (file)
@@ -36,7 +36,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject(choice);
   choice->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -44,25 +44,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoice,wxControl)
 
 wxChoice::wxChoice(void)
 {
-};
-
-wxChoice::wxChoice( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      long style, const wxString &name )
-{
-  Create( parent, id, pos, size, n, choices, style, name );
-};
+}
 
 bool wxChoice::Create( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
       int n, const wxString choices[],
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_option_menu_new();
   
   wxSize newSize = size;
@@ -81,7 +75,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
       GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
     gtk_menu_append( GTK_MENU(menu), item );
     gtk_widget_show( item );
-  };
+  }
   gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
   
   PostCreation();
@@ -89,7 +83,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
       
 void wxChoice::Append( const wxString &item )
 {
@@ -100,14 +94,14 @@ void wxChoice::Append( const wxString &item )
     GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
   gtk_menu_append( GTK_MENU(menu), menu_item );
   gtk_widget_show( menu_item );
-};
+}
  
 void wxChoice::Clear(void)
 {
   gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
   GtkWidget *menu = gtk_menu_new();
   gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
-};
+}
 
 int wxChoice::FindString( const wxString &string ) const
 {
@@ -129,17 +123,17 @@ int wxChoice::FindString( const wxString &string ) const
     if (string == label->label) return count;
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: string not found" );
   
   return -1;
-};
+}
 
 int wxChoice::GetColumns(void) const
 {
   return 1;
-};
+}
 
 int wxChoice::GetSelection(void)
 {
@@ -152,12 +146,12 @@ int wxChoice::GetSelection(void)
     if (!bin->child) return count;
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: no selection" );
   
   return -1;
-};
+}
 
 wxString wxChoice::GetString( int n ) const
 {
@@ -176,15 +170,15 @@ wxString wxChoice::GetString( int n ) const
       
       if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
       return label->label;
-    };
+    }
     child = child->next;
     count++;
-  };
+  }
   
   wxFAIL_MSG( "wxChoice: string not found" );
   
   return "";
-};
+}
 
 wxString wxChoice::GetStringSelection(void) const
 {
@@ -193,7 +187,7 @@ wxString wxChoice::GetStringSelection(void) const
   wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
   
   return label->label;
-};
+}
 
 int wxChoice::Number(void) const
 {
@@ -204,13 +198,13 @@ int wxChoice::Number(void) const
   {
     count++;
     child = child->next;
-  };
+  }
   return count;
-};
+}
 
 void wxChoice::SetColumns( int WXUNUSED(n) )
 {
-};
+}
 
 void wxChoice::SetSelection( int n )
 {
@@ -218,11 +212,11 @@ void wxChoice::SetSelection( int n )
   gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
   
   gtk_choice_clicked_callback( NULL, this );
-};
+}
 
 void wxChoice::SetStringSelection( const wxString &string )
 {
   int n = FindString( string );
   if (n != -1) SetSelection( n );
-};
+}
 
index 6f0acae1372d3b828dcd292655c23cfdd1509062..bf9aa9dcc731ac2ade1f370ce883051fafc85668 100644 (file)
@@ -47,7 +47,7 @@ static void gtk_combo_clicked_callback( GtkWidget *WXUNUSED(widget), wxComboBox
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject(combo);
   combo->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 // size 
@@ -63,7 +63,7 @@ static gint gtk_combo_size_callback( GtkCombo *widget, GtkAllocation* alloc, wxC
     alloc->width - widget->button->allocation.width;
   
   return FALSE;
-};
+}
 */
 
 //-----------------------------------------------------------------------------
@@ -73,13 +73,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox,wxControl)
 bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
   const wxPoint& pos, const wxSize& size,
   int n, const wxString choices[],
-  long style, const wxString& name )
+  long style, const wxValidator& validator, const wxString& name )
 {
   m_alreadySent = FALSE;
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_combo_new();
   
   wxSize newSize = size;
@@ -102,7 +104,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
     
     gtk_signal_connect( GTK_OBJECT(list_item), "select", 
       GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
-  };
+  }
   
   PostCreation();
 
@@ -116,7 +118,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxComboBox::Clear(void)
 {
@@ -124,12 +126,12 @@ void wxComboBox::Clear(void)
   gtk_list_clear_items( GTK_LIST(list), 0, Number() );
   
   m_clientData.Clear();
-};
+}
 
 void wxComboBox::Append( const wxString &item )
 {
   Append( item, (char*)NULL );
-};
+}
 
 void wxComboBox::Append( const wxString &item, char *clientData )
 {
@@ -146,7 +148,7 @@ void wxComboBox::Append( const wxString &item, char *clientData )
   gtk_widget_show( list_item );
   
   m_clientData.Append( (wxObject*)clientData );
-};
+}
 
 void wxComboBox::Delete( int n )
 {
@@ -160,7 +162,7 @@ void wxComboBox::Delete( int n )
   }
   else
     m_clientData.DeleteNode( node );
-};
+}
 
 int wxComboBox::FindString( const wxString &item )
 {
@@ -175,12 +177,12 @@ int wxComboBox::FindString( const wxString &item )
     if (item == label->label) return count;
     count++;
     child = child->next;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: string not found" );
   
   return -1;
-};
+}
 
 char* wxComboBox::GetClientData( int n )
 {
@@ -190,7 +192,7 @@ char* wxComboBox::GetClientData( int n )
   wxFAIL_MSG( "wxComboBox: wrong index" );
   
   return NULL;
-};
+}
 
 void wxComboBox::SetClientData( int n, char * clientData )
 {
@@ -198,7 +200,7 @@ void wxComboBox::SetClientData( int n, char * clientData )
   if (node) node->SetData( (wxObject*) clientData );
   
   wxFAIL_MSG( "wxComboBox: wrong index" );
-};
+}
 
 int wxComboBox::GetSelection(void) const
 {
@@ -214,13 +216,13 @@ int wxComboBox::GetSelection(void) const
       if (child->data == selection->data) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   
   wxFAIL_MSG( "wxComboBox: no selection" );
   
   return -1;
-};
+}
 
 wxString wxComboBox::GetString( int n ) const
 {
@@ -232,12 +234,12 @@ wxString wxComboBox::GetString( int n ) const
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     return label->label;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: wrong index" );
   
   return "";
-};
+}
 
 wxString wxComboBox::GetStringSelection(void) const
 {
@@ -249,12 +251,12 @@ wxString wxComboBox::GetStringSelection(void) const
     GtkBin *bin = GTK_BIN( selection->data );
     wxString tmp = GTK_LABEL( bin->child )->label;
     return tmp;
-  };
+  }
   
   wxFAIL_MSG( "wxComboBox: no selection" );
   
   return "";
-};
+}
 
 int wxComboBox::Number(void) const
 {
@@ -262,29 +264,29 @@ int wxComboBox::Number(void) const
   
   GList *child = GTK_LIST(list)->children;
   int count = 0;
-  while (child) { count++; child = child->next; };
+  while (child) { count++; child = child->next; }
   return count;
-};
+}
 
 void wxComboBox::SetSelection( int n )
 {
   GtkWidget *list = GTK_COMBO(m_widget)->list;
   gtk_list_select_item( GTK_LIST(list), n );
-};
+}
 
 void wxComboBox::SetStringSelection( const wxString &string )
 {
   int res = FindString( string );
   if (res == -1) return;
   SetSelection( res );
-};
+}
 
 wxString wxComboBox::GetValue(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   wxString tmp = gtk_entry_get_text( GTK_ENTRY(entry) );
   return tmp;
-};
+}
 
 void wxComboBox::SetValue( const wxString& value )
 {
@@ -292,52 +294,52 @@ void wxComboBox::SetValue( const wxString& value )
   wxString tmp = "";
   if (!value.IsNull()) tmp = value;
   gtk_entry_set_text( GTK_ENTRY(entry), tmp );
-};
+}
 
 void wxComboBox::Copy(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::Cut(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::Paste(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
 
 void wxComboBox::SetInsertionPoint( long pos )
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int tmp = (int) pos;
   gtk_entry_set_position( GTK_ENTRY(entry), tmp );
-};
+}
 
 void wxComboBox::SetInsertionPointEnd(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int pos = GTK_ENTRY(entry)->text_length;
   SetInsertionPoint( pos-1 );
-};
+}
 
 long wxComboBox::GetInsertionPoint(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   return (long) GTK_EDITABLE(entry)->current_pos;
-};
+}
 
 long wxComboBox::GetLastPosition(void) const
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   int pos = GTK_ENTRY(entry)->text_length;
   return (long) pos-1;
-};
+}
 
 void wxComboBox::Replace( long from, long to, const wxString& value )
 {
@@ -346,20 +348,20 @@ void wxComboBox::Replace( long from, long to, const wxString& value )
   if (value.IsNull()) return;
   gint pos = (gint)to;
   gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
-};
+}
 
 void wxComboBox::Remove(long from, long to)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
   gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
-};
+}
 
 void wxComboBox::SetSelection( long WXUNUSED(from), long WXUNUSED(to) )
 {
-};
+}
 
 void wxComboBox::SetEditable( bool WXUNUSED(editable) )
 {
-};
+}
 
       
index 7979f34d5c503c7db4d18d419160d23a8d4e008d..61bab59ecf0d26ea217725e7d3661ee0fa9a616b 100644 (file)
@@ -23,18 +23,18 @@ IMPLEMENT_DYNAMIC_CLASS(wxControl,wxWindow)
 wxControl::wxControl(void)
 {
   m_needParent = TRUE;
-};
+}
 
 wxControl::wxControl( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name ) :
   wxWindow( parent, id, pos, size, style, name )
 {
-};
+}
 
 void wxControl::Command( wxCommandEvent &WXUNUSED(event) )
 {
-};
+}
 
 void wxControl::SetLabel( const wxString &label )
 {
@@ -50,12 +50,12 @@ void wxControl::SetLabel( const wxString &label )
 
     m_label << *pc;
   }
-};
+}
 
 wxString wxControl::GetLabel(void) const
 {
   return m_label;
-};
+}
 
 
 
index 7230b92816308fb039cddc61aa59ca945b672cad..8499339d67e761ed6c8f97458f783ca7c9dfd496 100644 (file)
@@ -22,12 +22,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge,wxControl)
 
 bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
     const wxPoint& pos, const wxSize& size,
-    long style, const wxString& name )
+    long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_rangeMax = range;
   m_gaugePos = 0;
   m_useProgressBar = TRUE;
@@ -39,7 +41,7 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 void wxGauge::SetRange( int r )
 {
@@ -47,7 +49,7 @@ void wxGauge::SetRange( int r )
   if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
   gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
 
 void wxGauge::SetValue( int pos )
 {
@@ -55,15 +57,15 @@ void wxGauge::SetValue( int pos )
   if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
   gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
 
 int wxGauge::GetRange(void) const
 {
   return m_rangeMax;
-};
+}
 
 int wxGauge::GetValue(void) const
 {
   return m_gaugePos;
-};
+}
 
index c8a8bea0d769cd17a23d7b5940b1edcddb0c9e46..e149810090cf6fa422e148a8d3bf8446f041718c 100644 (file)
@@ -55,7 +55,7 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
 
   listbox->GetEventHandler()->ProcessEvent( event );
   if (event.m_commandString) delete[] event.m_commandString ;
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -64,25 +64,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
 wxListBox::wxListBox(void)
 {
   m_list = NULL;
-};
-
-wxListBox::wxListBox( wxWindow *parent, wxWindowID id, 
-      const wxPoint &pos, const wxSize &size, 
-      int n, const wxString choices[],
-      long style, const wxString &name )
-{
-  Create( parent, id, pos, size, n, choices, style, name );
-};
+}
 
 bool wxListBox::Create( wxWindow *parent, wxWindowID id, 
       const wxPoint &pos, const wxSize &size, 
       int n, const wxString choices[],
-      long style, const wxString &name )
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_widget = gtk_scrolled_window_new( NULL, NULL );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
@@ -118,7 +112,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     m_clientData.Append( (wxObject*)NULL );
     
     gtk_widget_show( list_item );
-  };
+  }
  
   PostCreation();
   
@@ -127,12 +121,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
   Show( TRUE );
   
   return TRUE;
-};
+}
 
 void wxListBox::Append( const wxString &item )
 {
   Append( item, (char*)NULL );
-};
+}
 
 void wxListBox::Append( const wxString &item, char *clientData )
 {
@@ -151,14 +145,14 @@ void wxListBox::Append( const wxString &item, char *clientData )
   m_clientData.Append( (wxObject*)clientData );
   
   gtk_widget_show( list_item );
-};
+}
 
 void wxListBox::Clear(void)
 {
   gtk_list_clear_items( m_list, 0, Number() );
   
   m_clientData.Clear();
-};
+}
 
 void wxListBox::Delete( int n )
 {
@@ -171,12 +165,12 @@ void wxListBox::Delete( int n )
   }
   else
     m_clientData.DeleteNode( node );
-};
+}
 
 void wxListBox::Deselect( int n )
 {
   gtk_list_unselect_item( m_list, n );
-};
+}
 
 int wxListBox::FindString( const wxString &item ) const
 {
@@ -189,16 +183,16 @@ int wxListBox::FindString( const wxString &item ) const
     if (item == label->label) return count;
     count++;
     child = child->next;
-  };
+  }
   return -1;
-};
+}
 
 char *wxListBox::GetClientData( int n ) const
 {
   wxNode *node = m_clientData.Nth( n );
   if (node) return ((char*)node->Data());
   return NULL;
-};
+}
 
 int wxListBox::GetSelection(void) const
 {
@@ -212,10 +206,10 @@ int wxListBox::GetSelection(void) const
       if (child->data == selection->data) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   return -1;
-};
+}
 
 int wxListBox::GetSelections(wxArrayInt& aSelections) const
 {
@@ -240,7 +234,7 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const
   }
   
   return count;
-};
+}
 
 wxString wxListBox::GetString( int n ) const
 {
@@ -250,9 +244,9 @@ wxString wxListBox::GetString( int n ) const
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     return label->label;
-  };
+  }
   return "";
-};
+}
 
 wxString wxListBox::GetStringSelection(void) const
 {
@@ -262,17 +256,17 @@ wxString wxListBox::GetStringSelection(void) const
     GtkBin *bin = GTK_BIN( selection->data );
     wxString tmp = GTK_LABEL( bin->child )->label;
     return tmp;
-  };
+  }
   return "";
-};
+}
 
 int wxListBox::Number(void)
 {
   GList *child = m_list->children;
   int count = 0;
-  while (child) { count++; child = child->next; };
+  while (child) { count++; child = child->next; }
   return count;
-};
+}
 
 bool wxListBox::Selected( int n )
 {
@@ -284,28 +278,28 @@ bool wxListBox::Selected( int n )
     {
       if (child->data == target->data) return TRUE;
       child = child->next;
-    };
-  };
+    }
+  }
   return FALSE;
-};
+}
 
 void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
 {
-};
+}
 
 void wxListBox::SetClientData( int n, char *clientData )
 {
   wxNode *node = m_clientData.Nth( n );
   if (node) node->SetData( (wxObject*)clientData );
-};
+}
 
 void wxListBox::SetFirstItem( int WXUNUSED(n) )
 {
-};
+}
 
 void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
 {
-};
+}
 
 void wxListBox::SetSelection( int n, bool select )
 {
@@ -313,7 +307,7 @@ void wxListBox::SetSelection( int n, bool select )
     gtk_list_select_item( m_list, n );
   else
     gtk_list_unselect_item( m_list, n );
-};
+}
 
 void wxListBox::SetString( int n, const wxString &string )
 {
@@ -323,13 +317,13 @@ void wxListBox::SetString( int n, const wxString &string )
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = GTK_LABEL( bin->child );
     gtk_label_set( label, string );
-  };
-};
+  }
+}
 
 void wxListBox::SetStringSelection( const wxString &string, bool select )
 {
   SetSelection( FindString(string), select );
-};
+}
 
 int wxListBox::GetIndex( GtkWidget *item ) const
 {
@@ -342,15 +336,15 @@ int wxListBox::GetIndex( GtkWidget *item ) const
       if (GTK_WIDGET(child->data) == item) return count;
       count++;
       child = child->next;
-    };
-  };
+    }
+  }
   return -1;
-};
+}
 
 GtkWidget *wxListBox::GetConnectWidget(void)
 {
   return GTK_WIDGET(m_list);
-};
+}
 
 
 
index 93bc49891bd0fb0c2430bd1c92e1d12193332d25..35832b897f74a4d62acba2d8cee87b44329ebe24 100644 (file)
@@ -42,7 +42,7 @@ wxMenuBar::wxMenuBar()
   PostCreation();
 
   Show( TRUE );
-};
+}
 
 void wxMenuBar::Append( wxMenu *menu, const wxString &title )
 {
@@ -61,7 +61,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
   gtk_menu_item_set_submenu( GTK_MENU_ITEM(root_menu), menu->m_menu );
 
   gtk_menu_bar_append( GTK_MENU_BAR(m_menubar), root_menu );
-};
+}
 
 static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
 {
@@ -69,7 +69,7 @@ static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString
   {
     int res = menu->FindItem( itemString );
     if (res != -1) return res;
-  };
+  }
   wxNode *node = menu->m_items.First();
   while (node)
   {
@@ -77,9 +77,9 @@ static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString
     if (item->IsSubMenu())
       return FindMenuItemRecursive(item->GetSubMenu(), menuString, itemString);
     node = node->Next();
-  };
+  }
   return -1;
-};
+}
 
 int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemString ) const
 {
@@ -90,9 +90,9 @@ int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemStr
     int res = FindMenuItemRecursive( menu, menuString, itemString);
     if (res != -1) return res;
     node = node->Next();
-  };
+  }
   return -1;
-};
+}
 
 // Find a wxMenuItem using its id. Recurses down into sub-menus
 static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
@@ -105,10 +105,10 @@ static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
     if ( item->IsSubMenu() )
       result = FindMenuItemByIdRecursive( item->GetSubMenu(), id );
     node = node->Next();
-  };
+  }
 
   return result;
-};
+}
 
 wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
 {
@@ -127,48 +127,55 @@ void wxMenuBar::Check( int id, bool check )
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) item->Check(check);
-};
+}
 
 bool wxMenuBar::Checked( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsChecked();
   return FALSE;
-};
+}
 
 void wxMenuBar::Enable( int id, bool enable )
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) item->Enable(enable);
-};
+}
 
 bool wxMenuBar::Enabled( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsEnabled();
   return FALSE;
-};
+}
 
 //-----------------------------------------------------------------------------
 // wxMenu
 //-----------------------------------------------------------------------------
 
-void gtk_menu_clicked_callback( GtkWidget *widget, gpointer data )
+static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
 {
-  wxMenu *menu = (wxMenu*)data;
   int id = menu->FindMenuIdByMenuItem(widget);
 
   wxASSERT( id != -1 ); // should find it!
 
-  if (!menu->IsEnabled(id))
-    return;
+  if (!menu->IsEnabled(id)) return;
 
   wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, id );
   event.SetEventObject( menu );
   event.SetInt(id );
+  
+  if (menu->m_callback)
+  {
+     (void) (*(menu->m_callback)) (*menu, event);
+     return;
+  }
+
+  if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
   wxWindow *win = menu->GetInvokingWindow();
   if (win) win->GetEventHandler()->ProcessEvent( event );
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
 
@@ -180,7 +187,7 @@ wxMenuItem::wxMenuItem()
   m_isEnabled = TRUE;
   m_subMenu = NULL;
   m_menuItem = NULL;
-};
+}
 
 void wxMenuItem::SetText(const wxString& str)
 {
@@ -214,13 +221,21 @@ bool wxMenuItem::IsChecked() const
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
 
-wxMenu::wxMenu( const wxString &title )
+wxMenu::wxMenu( const wxString& title, const wxFunction func )
 {
   m_title = title;
   m_items.DeleteContents( TRUE );
   m_invokingWindow = NULL;
   m_menu = gtk_menu_new();  // Do not show!
-};
+  m_callback = func;
+  m_eventHandler = this;
+  if (m_title.IsNull()) m_title = "";
+  if (m_title != "")
+  {
+    Append(-2, m_title);
+    AppendSeparator();
+  }
+}
 
 void wxMenu::AppendSeparator()
 {
@@ -232,7 +247,7 @@ void wxMenu::AppendSeparator()
   gtk_widget_show( menuItem );
   mitem->SetMenuItem(menuItem);
   m_items.Append( mitem );
-};
+}
 
 void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
 {
@@ -253,7 +268,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
   gtk_menu_append( GTK_MENU(m_menu), menuItem );
   gtk_widget_show( menuItem );
   m_items.Append( mitem );
-};
+}
 
 void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxString &helpStr )
 {
@@ -270,7 +285,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
   gtk_menu_append( GTK_MENU(m_menu), menuItem );
   gtk_widget_show( menuItem );
   m_items.Append( mitem );
-};
+}
 
 int wxMenu::FindItem( const wxString itemString ) const
 {
@@ -289,17 +304,17 @@ int wxMenu::FindItem( const wxString itemString ) const
     if (item->GetText() == s)
       return item->GetId();
     node = node->Next();
-  };
+  }
 
   return -1;
-};
+}
 
 void wxMenu::Enable( int id, bool enable )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->Enable(enable);
-};
+}
 
 bool wxMenu::IsEnabled( int id ) const
 {
@@ -308,14 +323,14 @@ bool wxMenu::IsEnabled( int id ) const
     return item->IsEnabled();
   else
     return FALSE;
-};
+}
 
 void wxMenu::Check( int id, bool enable )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->Check(enable);
-};
+}
 
 bool wxMenu::IsChecked( int id ) const
 {
@@ -324,14 +339,14 @@ bool wxMenu::IsChecked( int id ) const
     return item->IsChecked();
   else
     return FALSE;
-};
+}
 
 void wxMenu::SetLabel( int id, const wxString &label )
 {
   wxMenuItem *item = FindItem(id);
   if ( item )
     item->SetText(label);
-};
+}
 
 int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
 {
@@ -342,10 +357,10 @@ int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
     if (item->GetMenuItem() == menuItem)
       return item->GetId();
     node = node->Next();
-  };
+  }
 
   return -1;
-};
+}
 
 wxMenuItem *wxMenu::FindItem(int id) const
 {
@@ -355,7 +370,7 @@ wxMenuItem *wxMenu::FindItem(int id) const
     if ( item->GetId() == id )
       return item;
     node = node->Next();
-  };
+  }
 
   wxLogDebug(_("wxMenu::FindItem: item %d not found."), id);
 
@@ -365,11 +380,11 @@ wxMenuItem *wxMenu::FindItem(int id) const
 void wxMenu::SetInvokingWindow( wxWindow *win )
 {
   m_invokingWindow = win;
-};
+}
 
 wxWindow *wxMenu::GetInvokingWindow()
 {
   return m_invokingWindow;
-};
+}
 
 
index 64a36484027a0c076b7240c46b60dc4a8fc5fb5a..6195828b7a2561011ba0d403bb8c8c87522d693c 100644 (file)
@@ -47,7 +47,7 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
   event.SetString( WXSTRINGCAST(tmp) );
   event.SetEventObject( rb );
   rb->GetEventHandler()->ProcessEvent(event);
-};
+}
 
 //-----------------------------------------------------------------------------
 
@@ -55,28 +55,20 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
 
 wxRadioBox::wxRadioBox(void)
 {
-};
-
-wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
-      const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      int majorDim, long style,
-      const wxString &name )
-{
-  Create( parent, id, title, pos, size, n, choices, majorDim, style, name );
-};
+}
 
 bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
       const wxPoint &pos, const wxSize &size,
-      int n, const wxString choices[],
-      int WXUNUSED(majorDim), long style,
-      const wxString &name )
+      int n, const wxString choices[], int WXUNUSED(majorDim), 
+      long style, const wxValidator& validator, const wxString &name )
 {
   m_alreadySent = FALSE;
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   m_widget = gtk_frame_new( title );
   
   int x = m_x+5;
@@ -111,8 +103,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
       y += 20;
       height += 20;
       
-    };
-  };
+    }
+  }
 
   wxSize newSize = size;
   if (newSize.x == -1) newSize.x = maxLen+10;
@@ -124,7 +116,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 bool wxRadioBox::Show( bool show )
 {
@@ -136,10 +128,10 @@ bool wxRadioBox::Show( bool show )
     GtkWidget *w = GTK_WIDGET( item->data );
     if (show) gtk_widget_show( w ); else gtk_widget_hide( w );
     item = item->next;
-  };
+  }
 
   return TRUE;
-};
+}
 
 int wxRadioBox::FindString( const wxString &s ) const
 {
@@ -154,10 +146,10 @@ int wxRadioBox::FindString( const wxString &s ) const
     if (s == l->label) return count;
     count--;
     item = item->next;
-  };
+  }
 
   return -1;
-};
+}
 
 void wxRadioBox::SetSelection( int n )
 {
@@ -168,7 +160,7 @@ void wxRadioBox::SetSelection( int n )
   GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
   
   gtk_toggle_button_set_state( button, 1 );
-};
+}
 
 int wxRadioBox::GetSelection(void) const
 {
@@ -180,9 +172,9 @@ int wxRadioBox::GetSelection(void) const
     if (GTK_TOGGLE_BUTTON(button)->active) return count;
     count++;
     item = item->next;
-  };
+  }
   return -1;
-};
+}
 
 wxString wxRadioBox::GetString( int n ) const
 {
@@ -196,48 +188,48 @@ wxString wxRadioBox::GetString( int n ) const
   GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
   
   return wxString( label->label );
-};
+}
 
 wxString wxRadioBox::GetLabel(void) const
 {
   return wxControl::GetLabel();
-};
+}
 
 void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
 {
   wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
 
 wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
 {
   wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
   return "";
-};
+}
 
 void wxRadioBox::Enable( bool WXUNUSED(enable) )
 {
   wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
 
 void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
 {
   wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
 
 void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
 {
   wxFAIL_MSG("wxRadioBox::Show not implemented.");
-};
+}
 
 wxString wxRadioBox::GetStringSelection(void) const
 {
@@ -249,11 +241,11 @@ wxString wxRadioBox::GetStringSelection(void) const
     {
       GtkLabel *label = GTK_LABEL( button->child );
       return label->label;
-    };
+    }
     item = item->next;
-  };
+  }
   return "";
-};
+}
 
 bool wxRadioBox::SetStringSelection( const wxString&s )
 {
@@ -261,7 +253,7 @@ bool wxRadioBox::SetStringSelection( const wxString&s )
   if (res == -1) return FALSE;
   SetSelection( res );
   return TRUE;
-};
+}
 
 int wxRadioBox::Number(void) const
 {
@@ -271,17 +263,17 @@ int wxRadioBox::Number(void) const
   {
     item = item->next;
     count++;
-  };
+  }
   return count;
-};
+}
 
 int wxRadioBox::GetNumberOfRowsOrCols(void) const
 {
   return 1;
-};
+}
 
 void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
 {
   wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
-};
+}
 
index e4748739916231e8333e3fdcff91f6e507696c5c..3cd45f2b8af212b82bba2fd44848002b1690d60c 100644 (file)
 
 #include "wx/radiobut.h"
 
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern bool g_blockEventsOnDrag;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
+  
+static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRadioButton *rb )
+{
+  if (!rb->HasVMT()) return;
+  if (g_blockEventsOnDrag) return;
+  
+  wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
+  event.SetInt( rb->GetValue() );
+  event.SetEventObject( rb );
+  rb->GetEventHandler()->ProcessEvent( event );
+}
+
+bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
+  const wxPoint& pos,  const wxSize& size, long style,
+  const wxValidator& validator, const wxString& name )
+{
+  m_needParent = TRUE;
+
+  wxSize newSize = size;
+
+  PreCreation( parent, id, pos, newSize, style, name );
+  
+  SetValidator( validator );
+
+  m_widget = gtk_radio_button_new_with_label( NULL, label );
+      
+  SetLabel(label);
+
+  if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+  if (newSize.y == -1) newSize.y = 26;
+  SetSize( newSize.x, newSize.y );
+
+  gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", 
+    GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+       
+  PostCreation();
+
+  Show( TRUE );
+
+  return TRUE;
+}
+
+void wxRadioButton::SetLabel( const wxString& label )
+{
+  wxControl::SetLabel( label );
+  GtkButton *bin = GTK_BUTTON( m_widget );
+  GtkLabel *g_label = GTK_LABEL( bin->child );
+  gtk_label_set( g_label, GetLabel() );
+}
+
+void wxRadioButton::SetValue( bool val )
+{
+  gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
+}
+
+bool wxRadioButton::GetValue(void) const
+{
+  return GTK_TOGGLE_BUTTON(m_widget)->active;
+}
+
+
index 37396d960552a9eb0c100ea1fac5860fb852cb90..ab1482b00601f4882445bd69cda8e92f402084a0 100644 (file)
@@ -59,29 +59,24 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
   cevent.SetEventObject( win );
   win->ProcessEvent( cevent );
 */
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxScrollBar,wxControl)
 
-wxScrollBar::wxScrollBar(wxWindow *parent, wxWindowID id,
-           const wxPoint& pos, const wxSize& size,
-           long style, const wxString& name )
-{
-  Create( parent, id, pos, size, style, name );
-};
-
 wxScrollBar::~wxScrollBar(void)
 {
-};
+}
 
 bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxPoint& pos, const wxSize& size,
-           long style, const wxString& name )
+           long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_oldPos = 0.0;
 
   if (style & wxSB_VERTICAL == wxSB_VERTICAL)
@@ -99,27 +94,27 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 int wxScrollBar::GetPosition(void) const
 {
   return (int)(m_adjust->value+0.5);
-};
+}
 
 int wxScrollBar::GetThumbSize() const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 int wxScrollBar::GetPageSize() const
 {
   return (int)(m_adjust->page_increment+0.5);
-};
+}
 
 int wxScrollBar::GetRange() const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 void wxScrollBar::SetPosition( int viewStart )
 {
@@ -129,7 +124,7 @@ void wxScrollBar::SetPosition( int viewStart )
   m_adjust->value = fpos;
   
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
 
 void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize,
       bool WXUNUSED(refresh) )
@@ -154,18 +149,18 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page
   m_adjust->page_size = fthumb;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 // Backward compatibility
 int wxScrollBar::GetValue(void) const
 {
   return GetPosition();
-};
+}
 
 void wxScrollBar::SetValue( int viewStart )
 {
   SetPosition( viewStart );
-};
+}
 
 void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
 {
@@ -178,17 +173,17 @@ void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength,
   *viewLength = range;
   *objectLength = thumb;
   *pageLength = page;
-};
+}
 
 int wxScrollBar::GetViewLength() const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 int wxScrollBar::GetObjectLength() const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 void wxScrollBar::SetPageSize( int pageLength )
 {
@@ -196,7 +191,7 @@ void wxScrollBar::SetPageSize( int pageLength )
   int thumb = (int)(m_adjust->page_size+0.5);
   int range = (int)(m_adjust->upper+0.5);
   SetScrollbar( pos, thumb, range, pageLength );
-};
+}
 
 void wxScrollBar::SetObjectLength( int objectLength )
 {
@@ -204,7 +199,7 @@ void wxScrollBar::SetObjectLength( int objectLength )
   int page = (int)(m_adjust->page_increment+0.5);
   int range = (int)(m_adjust->upper+0.5);
   SetScrollbar( pos, objectLength, range, page );
-};
+}
 
 void wxScrollBar::SetViewLength( int viewLength )
 {
@@ -212,5 +207,5 @@ void wxScrollBar::SetViewLength( int viewLength )
   int thumb = (int)(m_adjust->page_size+0.5);
   int page = (int)(m_adjust->page_increment+0.5);
   SetScrollbar( pos, thumb, viewLength, page );
-};
+}
 
index fd8d17b8d675290fa77f4d70d3746719532aa28c..01440975b1034fad942ee4bd5532ecea317038af 100644 (file)
@@ -57,40 +57,29 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
   wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
   cevent.SetEventObject( win );
   win->ProcessEvent( cevent );
-};
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
 
 wxSlider::wxSlider(void)
 {
-};
-
-wxSlider::wxSlider( wxWindow *parent, wxWindowID id,
-        int value, int minValue, int maxValue,
-        const wxPoint& pos, const wxSize& size,
-        long style,
-/*      const wxValidator& validator = wxDefaultValidator, */
-        const wxString& name )
-{
-  Create( parent, id, value, minValue, maxValue,
-          pos, size, style, name );
-};
+}
 
 wxSlider::~wxSlider(void)
 {
-};
+}
 
 bool wxSlider::Create(wxWindow *parent, wxWindowID id,
         int value, int minValue, int maxValue,
         const wxPoint& pos, const wxSize& size,
-        long style,
-/*      const wxValidator& validator = wxDefaultValidator, */
-        const wxString& name )
+        long style, const wxValidator& validator, const wxString& name )
 {
   m_needParent = TRUE;
   
   PreCreation( parent, id, pos, size, style, name );
   
+  SetValidator( validator );
+
   m_oldPos = 0.0;
 
   if (style & wxSL_VERTICAL == wxSL_VERTICAL)
@@ -110,12 +99,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
   Show( TRUE );
     
   return TRUE;
-};
+}
 
 int wxSlider::GetValue(void) const
 {
   return (int)(m_adjust->value+0.5);
-};
+}
 
 void wxSlider::SetValue( int value )
 {
@@ -125,7 +114,7 @@ void wxSlider::SetValue( int value )
   m_adjust->value = fpos;
   
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
 
 void wxSlider::SetRange( int minValue, int maxValue )
 {
@@ -140,17 +129,17 @@ void wxSlider::SetRange( int minValue, int maxValue )
   m_adjust->upper = fmax;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetMin(void) const
 {
   return (int)(m_adjust->lower+0.5);
-};
+}
 
 int wxSlider::GetMax(void) const
 {
   return (int)(m_adjust->upper+0.5);
-};
+}
 
 void wxSlider::SetPageSize( int pageSize )
 {
@@ -161,12 +150,12 @@ void wxSlider::SetPageSize( int pageSize )
   m_adjust->page_increment = fpage;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetPageSize(void) const
 {
   return (int)(m_adjust->page_increment+0.5);
-};
+}
 
 void wxSlider::SetThumbLength( int len )
 {
@@ -177,71 +166,71 @@ void wxSlider::SetThumbLength( int len )
   m_adjust->page_size = flen;
 
   gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
 
 int wxSlider::GetThumbLength(void) const
 {
   return (int)(m_adjust->page_size+0.5);
-};
+}
 
 void wxSlider::SetLineSize( int WXUNUSED(lineSize) )
 {
-};
+}
 
 int wxSlider::GetLineSize(void) const
 {
   return 0;
-};
+}
 
 // not supported in wxGTK (and GTK)
 
 void wxSlider::GetSize( int *x, int *y ) const
 {
   wxWindow::GetSize( x, y );
-};
+}
 
 void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
   wxWindow::SetSize( x, y, width, height, sizeFlags );
-};
+}
 
 void wxSlider::GetPosition( int *x, int *y ) const
 {
   wxWindow::GetPosition( x, y );
-};
+}
 
 void wxSlider::SetTick( int WXUNUSED(tickPos) )
 {
-};
+}
 
 void wxSlider::SetTickFreq( int WXUNUSED(n), int WXUNUSED(pos) )
 {
-};
+}
 
 int wxSlider::GetTickFreq(void) const
 {
   return 0;
-};
+}
 
 void wxSlider::ClearTicks(void)
 {
-};
+}
 
 void wxSlider::SetSelection( int WXUNUSED(minPos), int WXUNUSED(maxPos) )
 {
-};
+}
 
 int wxSlider::GetSelEnd(void) const
 {
   return 0;
-};
+}
 
 int wxSlider::GetSelStart(void) const
 {
   return 0;
-};
+}
 
 void wxSlider::ClearSel(void)
 {
-};
+}
 
index d1a19473eb7b31f0b477dbfeae5127f0e92cac7c..46d4e1bffb461a14b940978a41068e877b11b8ce 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
 
-void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
+static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
 {
   win->SetModified();
-};
+}
 
 
 BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
@@ -34,31 +34,31 @@ END_EVENT_TABLE()
 
 wxTextCtrl::wxTextCtrl(void) : streambuf()
 {
-    if( allocate() )
-  setp(base(),ebuf());
+  if (allocate()) setp(base(),ebuf());
 
   m_modified = FALSE;
-};
+}
 
 wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
       const wxPoint &pos, const wxSize &size,
-      int style, const wxString &name ) : streambuf()
+      int style, const wxValidator& validator, const wxString &name ) : streambuf()
 {
-  if( allocate() )
-    setp(base(),ebuf());
+  if (allocate()) setp(base(),ebuf());
 
   m_modified = FALSE;
-  Create( parent, id, value, pos, size, style, name );
-};
+  Create( parent, id, value, pos, size, style, validator, name );
+}
 
 bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
       const wxPoint &pos, const wxSize &size,
-      int style, const wxString &name )
+      int style, const wxValidator& validator, const wxString &name )
 {
   m_needParent = TRUE;
 
   PreCreation( parent, id, pos, size, style, name );
 
+  SetValidator( validator );
+
   bool bMultiLine = (style & wxTE_MULTILINE) != 0;
   if ( bMultiLine )
   {
@@ -121,7 +121,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
   {
     gint tmp = 0;
     gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
-  };
+  }
 
   if (style & wxTE_READONLY)
   {
@@ -130,12 +130,12 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
   {
     if ( bMultiLine )
       gtk_text_set_editable( GTK_TEXT(m_text), 1 );
-  };
+  }
 
   Show( TRUE );
 
   return TRUE;
-};
+}
 
 wxString wxTextCtrl::GetValue(void) const
 {
@@ -148,9 +148,9 @@ wxString wxTextCtrl::GetValue(void) const
   else
   {
     tmp = gtk_entry_get_text( GTK_ENTRY(m_text) );
-  };
+  }
   return tmp;
-};
+}
 
 void wxTextCtrl::SetValue( const wxString &value )
 {
@@ -166,8 +166,8 @@ void wxTextCtrl::SetValue( const wxString &value )
   else
   {
     gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
-  };
-};
+  }
+}
 
 void wxTextCtrl::WriteText( const wxString &text )
 {
@@ -181,44 +181,44 @@ void wxTextCtrl::WriteText( const wxString &text )
   else
   {
     gtk_entry_append_text( GTK_ENTRY(m_text), text );
-  };
-};
+  }
+}
 
 bool wxTextCtrl::LoadFile( const wxString &WXUNUSED(file) )
 {
-  wxFAIL_MSG(_("wxTextCtrl::LoadFile not implemented"));
+  wxFAIL_MSG( "wxTextCtrl::LoadFile not implemented" );
 
   return FALSE;
-};
+}
 
 bool wxTextCtrl::SaveFile( const wxString &WXUNUSED(file) )
 {
-  wxFAIL_MSG(_("wxTextCtrl::SaveFile not implemented"));
+  wxFAIL_MSG( "wxTextCtrl::SaveFile not implemented" );
 
   return FALSE;
-};
+}
 
 /*
 wxString wxTextCtrl::GetLineText( long lineNo ) const
 {
-};
+}
 
 
 void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
 {
-};
+}
 
 long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
 {
-};
+}
 
 long wxTextCtrl::XYToPosition( long x, long y )
 {
-};
+}
 
 int wxTextCtrl::GetNumberOfLines(void)
 {
-};
+}
 
 */
 void wxTextCtrl::SetInsertionPoint( long pos )
@@ -228,7 +228,7 @@ void wxTextCtrl::SetInsertionPoint( long pos )
     gtk_text_set_point( GTK_TEXT(m_text), tmp );
   else
     gtk_entry_set_position( GTK_ENTRY(m_text), tmp );
-};
+}
 
 void wxTextCtrl::SetInsertionPointEnd(void)
 {
@@ -238,7 +238,7 @@ void wxTextCtrl::SetInsertionPointEnd(void)
   else
     pos = GTK_ENTRY(m_text)->text_length;
   SetInsertionPoint( pos-1 );
-};
+}
 
 void wxTextCtrl::SetEditable( bool editable )
 {
@@ -246,22 +246,22 @@ void wxTextCtrl::SetEditable( bool editable )
     gtk_text_set_editable( GTK_TEXT(m_text), editable );
   else
     gtk_entry_set_editable( GTK_ENTRY(m_text), editable );
-};
+}
 
 void wxTextCtrl::SetSelection( long from, long to )
 {
   gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
 
 void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
 {
   wxFAIL_MSG(_("wxTextCtrl::ShowPosition not implemented"));
-};
+}
 
 long wxTextCtrl::GetInsertionPoint(void) const
 {
   return (long) GTK_EDITABLE(m_text)->current_pos;
-};
+}
 
 long wxTextCtrl::GetLastPosition(void) const
 {
@@ -271,12 +271,12 @@ long wxTextCtrl::GetLastPosition(void) const
   else
     pos = GTK_ENTRY(m_text)->text_length;
   return (long)pos-1;
-};
+}
 
 void wxTextCtrl::Remove( long from, long to )
 {
   gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
 
 void wxTextCtrl::Replace( long from, long to, const wxString &value )
 {
@@ -284,31 +284,31 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value )
   if (value.IsNull()) return;
   gint pos = (gint)to;
   gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
-};
+}
 
 void wxTextCtrl::Cut(void)
 {
   gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Copy(void)
 {
   gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Paste(void)
 {
   gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
 
 void wxTextCtrl::Delete(void)
 {
   SetValue( "" );
-};
+}
 
 void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
 {
-};
+}
 
 int wxTextCtrl::overflow( int WXUNUSED(c) )
 {
@@ -320,7 +320,7 @@ int wxTextCtrl::overflow( int WXUNUSED(c) )
   setp(pbase(), epptr());
   delete[] txt;
   return EOF;
-};
+}
 
 int wxTextCtrl::sync(void)
 {
@@ -332,12 +332,12 @@ int wxTextCtrl::sync(void)
   setp(pbase(), epptr());
   delete[] txt;
   return 0;
-};
+}
 
 int wxTextCtrl::underflow(void)
 {
   return EOF;
-};
+}
 
 wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
 {
@@ -390,7 +390,7 @@ wxTextCtrl& wxTextCtrl::operator<<(const char c)
 GtkWidget* wxTextCtrl::GetConnectWidget(void)
 {
   return GTK_WIDGET(m_text);
-};
+}
 
 
 
index d829d20532dd501acfa09e4170e463e2015292f0..3fdfdfde0fce7ee89d96d1427db3c61413cafb0a 100644 (file)
@@ -57,6 +57,25 @@ void wxDisplaySize( int *width, int *height )
   if (height) *height = gdk_screen_height();
 }
 
+void wxGetMousePosition( int* x, int* y )
+{
+  wxFAIL_MSG( "GetMousePosition not yet implemented" );
+  if (x) *x = 0;
+  if (y) *y = 0;
+};
+
+bool wxColourDisplay(void)
+{
+  wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+  return TRUE;
+}
+
+int wxDisplayDepth(void)
+{
+  wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+  return 8;
+}
+
 //------------------------------------------------------------------------
 // user and home routines
 //------------------------------------------------------------------------
index 9839c6b049d07b4d5503958a8570fc1f1ad32bc5..9457a59a57cbf194b81e2d8ad35269a29d8f0b1f 100644 (file)
@@ -754,22 +754,16 @@ wxWindow::wxWindow()
   m_resizing = FALSE;
 }
 
-wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
-      const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
-{
-  m_cursor = NULL;
-  Create( parent, id, pos, size, style, name );
-}
-
 bool wxWindow::Create( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
+      long style, const wxString &name  )
 {
   m_isShown = FALSE;
   m_isEnabled = TRUE;
   m_needParent = TRUE;
   
+  m_cursor = NULL;
+  
   PreCreation( parent, id, pos, size, style, name );
   
   m_widget = gtk_scrolled_window_new( NULL, NULL );
@@ -887,8 +881,7 @@ wxWindow::~wxWindow(void)
     m_windowSizer = NULL;
   }
   // If this is a child of a sizer, remove self from parent
-  if (m_sizerParent)
-    m_sizerParent->RemoveChild((wxWindow *)this);
+  if (m_sizerParent) m_sizerParent->RemoveChild((wxWindow *)this);
 
   // Just in case the window has been Closed, but
   // we're then deleting immediately: don't leave
@@ -900,6 +893,7 @@ wxWindow::~wxWindow(void)
   // class
   wxTopLevelWindows.DeleteObject(this);
     
+  if (m_windowValidator) delete m_windowValidator;
 }
 
 void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
@@ -921,7 +915,6 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   if (m_height == -1) m_height = 20;
   m_retCode = 0;
   m_eventHandler = this;
-  m_windowValidator = NULL;
   m_windowId = id;
   m_sizeSet = FALSE;
   if (m_cursor == NULL)
@@ -940,6 +933,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
   m_resizing = FALSE;
+  m_windowValidator = NULL;
 }
 
 void wxWindow::PostCreation(void)
@@ -1580,9 +1574,11 @@ wxValidator *wxWindow::GetValidator(void)
   return m_windowValidator;
 }
 
-void wxWindow::SetValidator( wxValidator *validator )
+void wxWindow::SetValidator( const wxValidator& validator )
 {
-  m_windowValidator = validator;
+  if (m_windowValidator) delete m_windowValidator;
+  m_windowValidator = validator.Clone();
+  if (m_windowValidator) m_windowValidator->SetWindow(this);
 }
 
 bool wxWindow::IsBeingDeleted(void)
@@ -1696,6 +1692,16 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
   // do something ?
 }
 
+wxColour wxWindow::GetForegroundColour(void) const
+{
+  return m_foregroundColour;
+}
+
+void wxWindow::SetForegroundColour( const wxColour &colour )
+{
+  m_foregroundColour = colour;
+}
+
 bool wxWindow::Validate(void)
 {
   wxNode *node = GetChildren()->First();
index 58aefc246fceac463c4524e0113e54d9a8e9bba5..326ffe40611ff182b1cca71b217c03fd881f4678 100644 (file)
@@ -1 +1 @@
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
index 58aefc246fceac463c4524e0113e54d9a8e9bba5..326ffe40611ff182b1cca71b217c03fd881f4678 100644 (file)
@@ -1 +1 @@
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
index e9143391f3fa94c45293dc4c686aa99a29270ea9..ebfa97b553888b448277dc8e86418f7e63d92cde 100644 (file)
@@ -21,6 +21,7 @@
 #include <wx/utils.h>
 #include <wx/frame.h>
 #include <wx/panel.h>
+#include <wx/menu.h>
 #include <wx/serbase.h>
 #include "serwnd.h"