]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/controls.i
Did splitting of wxEntry for wxMSW. Not nearly as complex as wxGTK
[wxWidgets.git] / utils / wxPython / src / controls.i
index 5504ddf43bc7328b1476131f974642879928dc9c..129a23b1d37f7db37d5f2d6d4f89cbc14d000162 100644 (file)
@@ -18,6 +18,7 @@
 #include <wx/spinbutt.h>
 #include <wx/dynarray.h>
 #include <wx/statline.h>
 #include <wx/spinbutt.h>
 #include <wx/dynarray.h>
 #include <wx/statline.h>
+//#include <wx/toggbutt.h>
 
 #ifdef __WXMSW__
 #if wxUSE_OWNER_DRAWN
 
 #ifdef __WXMSW__
 #if wxUSE_OWNER_DRAWN
@@ -59,13 +60,22 @@ wxValidator wxDefaultValidator;
 
 class wxControl : public wxWindow {
 public:
 
 class wxControl : public wxWindow {
 public:
-#ifdef __WXMSW__
+    wxControl(wxWindow *parent,
+                       wxWindowID id,
+                       const wxPoint& pos=wxPyDefaultPosition,
+                       const wxSize& size=wxPyDefaultSize,
+                       long style=0,
+                       const wxValidator& validator=wxPyDefaultValidator,
+                       const char* name="control");
+
+    %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+
     void Command(wxCommandEvent& event);
     void Command(wxCommandEvent& event);
-#endif
     wxString GetLabel();
     void SetLabel(const wxString& label);
 };
 
     wxString GetLabel();
     void SetLabel(const wxString& label);
 };
 
+
 //----------------------------------------------------------------------
 
 class wxButton : public wxControl {
 //----------------------------------------------------------------------
 
 class wxButton : public wxControl {
@@ -80,8 +90,17 @@ public:
     %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
 
     void SetDefault();
     %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
 
     void SetDefault();
+    void SetBackgroundColour(const wxColour& colour);
+    void SetForegroundColour(const wxColour& colour);
 };
 
 };
 
+
+%inline %{
+    wxSize wxButton_GetDefaultSize() {
+        return wxButton::GetDefaultSize();
+    }
+%}
+
 //----------------------------------------------------------------------
 
 class wxBitmapButton : public wxButton {
 //----------------------------------------------------------------------
 
 class wxBitmapButton : public wxButton {
@@ -106,6 +125,31 @@ public:
 
 };
 
 
 };
 
+//----------------------------------------------------------------------
+
+//  class wxToggleButton : public wxControl {
+//  public:
+//      wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label,
+//                     const wxPoint& pos = wxPyDefaultPosition,
+//                     const wxSize& size = wxPyDefaultSize, long style = 0,
+//                     const wxValidator& validator = wxPyDefaultValidator,
+//                     const char* name = "toggle");
+//      void SetValue(bool value);
+//      bool GetValue() const ;
+//      void SetLabel(const wxString& label);
+//  };
+
+//  class wxBitmapToggleButton : public wxToggleButton {
+//  public:
+//      wxBitmapToggleButton(wxWindow *parent, wxWindowID id, const wxBitmap *label,
+//                           const wxPoint& pos = wxPyDefaultPosition,
+//                           const wxSize& size = wxPyDefaultSize, long style = 0,
+//                           const wxValidator& validator = wxPyDefaultValidator,
+//                           const char *name = "toggle");
+//      void SetLabel(const wxBitmap& bitmap);
+//  };
+
+
 //----------------------------------------------------------------------
 
 class wxCheckBox : public wxControl {
 //----------------------------------------------------------------------
 
 class wxCheckBox : public wxControl {
@@ -130,7 +174,7 @@ public:
     wxChoice(wxWindow *parent, wxWindowID id,
              const wxPoint& pos = wxPyDefaultPosition,
              const wxSize& size = wxPyDefaultSize,
     wxChoice(wxWindow *parent, wxWindowID id,
              const wxPoint& pos = wxPyDefaultPosition,
              const wxSize& size = wxPyDefaultSize,
-             int LCOUNT=0, wxString* LIST=NULL,
+             int LCOUNT=0, wxString* choices=NULL,
              long style = 0,
              const wxValidator& validator = wxPyDefaultValidator,
              char* name = "choice");
              long style = 0,
              const wxValidator& validator = wxPyDefaultValidator,
              char* name = "choice");
@@ -157,7 +201,7 @@ public:
     wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
                const wxPoint& pos = wxPyDefaultPosition,
                const wxSize& size = wxPyDefaultSize,
     wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
                const wxPoint& pos = wxPyDefaultPosition,
                const wxSize& size = wxPyDefaultSize,
-               int LCOUNT=0, wxString* LIST=NULL,
+               int LCOUNT=0, wxString* choices=NULL,
                long style = 0,
                const wxValidator& validator = wxPyDefaultValidator,
                char* name = "comboBox");
                long style = 0,
                const wxValidator& validator = wxPyDefaultValidator,
                char* name = "comboBox");
@@ -262,7 +306,7 @@ public:
     wxListBox(wxWindow* parent, wxWindowID id,
               const wxPoint& pos = wxPyDefaultPosition,
               const wxSize& size = wxPyDefaultSize,
     wxListBox(wxWindow* parent, wxWindowID id,
               const wxPoint& pos = wxPyDefaultPosition,
               const wxSize& size = wxPyDefaultSize,
-              int LCOUNT, wxString* LIST = NULL,
+              int LCOUNT, wxString* choices = NULL,
               long style = 0,
               const wxValidator& validator = wxPyDefaultValidator,
               char* name = "listBox");
               long style = 0,
               const wxValidator& validator = wxPyDefaultValidator,
               char* name = "listBox");
@@ -291,13 +335,13 @@ public:
       }
     }
 
       }
     }
 
-    void InsertItems(int LCOUNT, wxString* LIST, int pos);
+    void InsertItems(int LCOUNT, wxString* choices, int pos);
 
     wxString GetString(int n);
     wxString GetStringSelection();
     int Number();
     bool Selected(const int n);
 
     wxString GetString(int n);
     wxString GetStringSelection();
     int Number();
     bool Selected(const int n);
-    void Set(int LCOUNT, wxString* LIST);
+    void Set(int LCOUNT, wxString* choices);
     // TODO:    void SetClientData(const int n, char* data);
     void SetFirstItem(int n);
     %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
     // TODO:    void SetClientData(const int n, char* data);
     void SetFirstItem(int n);
     %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
@@ -315,7 +359,7 @@ public:
                    const wxPoint& pos = wxPyDefaultPosition,
                    const wxSize& size = wxPyDefaultSize,
                    int LCOUNT = 0,
                    const wxPoint& pos = wxPyDefaultPosition,
                    const wxSize& size = wxPyDefaultSize,
                    int LCOUNT = 0,
-                   wxString* LIST = NULL,
+                   wxString* choices = NULL,
                    long style = 0,
                    const wxValidator& validator = wxPyDefaultValidator,
                    char* name = "listBox");
                    long style = 0,
                    const wxValidator& validator = wxPyDefaultValidator,
                    char* name = "listBox");
@@ -324,7 +368,7 @@ public:
 
     bool  IsChecked(int uiIndex);
     void  Check(int uiIndex, int bCheck = TRUE);
 
     bool  IsChecked(int uiIndex);
     void  Check(int uiIndex, int bCheck = TRUE);
-    void InsertItems(int LCOUNT, wxString* LIST, int pos);
+    void InsertItems(int LCOUNT, wxString* choices, int pos);
 
     int GetItemHeight();
 };
 
     int GetItemHeight();
 };
@@ -403,6 +447,7 @@ public:
     int GetPageSize();
     int GetThumbPosition();
     int GetThumbSize();
     int GetPageSize();
     int GetThumbPosition();
     int GetThumbSize();
+    %name(GetThumbLength) int GetThumbSize();  // to match the docs
     void SetThumbPosition(int viewStart);
     void SetScrollbar(int position, int thumbSize,
                       int range,    int pageSize,
     void SetThumbPosition(int viewStart);
     void SetScrollbar(int position, int thumbSize,
                       int range,    int pageSize,
@@ -452,7 +497,7 @@ public:
                const wxString& label,
                const wxPoint& point = wxPyDefaultPosition,
                const wxSize& size = wxPyDefaultSize,
                const wxString& label,
                const wxPoint& point = wxPyDefaultPosition,
                const wxSize& size = wxPyDefaultSize,
-               int LCOUNT = 0, wxString* LIST = NULL,
+               int LCOUNT = 0, wxString* choices = NULL,
                int majorDimension = 0,
                long style = wxRA_HORIZONTAL,
                const wxValidator& validator = wxPyDefaultValidator,
                int majorDimension = 0,
                long style = wxRA_HORIZONTAL,
                const wxValidator& validator = wxPyDefaultValidator,