]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/stattool.i
Changes for recent htmlhelp updates
[wxWidgets.git] / wxPython / src / stattool.i
index 960762c2c73281fd1c0ff0061d616e236af9881e..55f29ef21d0dc40d72fc762b96f2cedda1d35e5a 100644 (file)
 %pragma(python) code = "import wx"
 
 
-%{
-    static wxString wxPyEmptyStr("");
-%}
-
 //---------------------------------------------------------------------------
 
 class wxStatusBar : public wxWindow {
@@ -110,18 +106,20 @@ public:
     bool IsEnabled();
     bool IsToggled();
     bool CanBeToggled();
-    const wxBitmap& GetBitmap1();
-    const wxBitmap& GetBitmap2();
-    const wxBitmap& GetBitmap();
+    const wxBitmap& GetNormalBitmap();
+    const wxBitmap& GetDisabledBitmap();
+    wxBitmap GetBitmap();
+    wxString GetLabel();
     wxString GetShortHelp();
     wxString GetLongHelp();
     bool Enable(bool enable);
-    bool Toggle(bool toggle);
+    void Toggle();
     bool SetToggle(bool toggle);
     bool SetShortHelp(const wxString& help);
     bool SetLongHelp(const wxString& help);
-    void SetBitmap1(const wxBitmap& bmp);
-    void SetBitmap2(const wxBitmap& bmp);
+    void SetNormalBitmap(const wxBitmap& bmp);
+    void SetDisabledBitmap(const wxBitmap& bmp);
+    void SetLabel(const wxString& label);
     void Detach();
     void Attach(wxToolBarBase *tbar);
 
@@ -143,6 +141,13 @@ public:
             self->SetClientData(new wxPyUserData(clientData));
         }
     }
+
+    %pragma(python) addtoclass="
+    GetBitmap1 = GetNormalBitmap
+    GetBitmap2 = GetDisabledBitmap
+    SetBitmap1 = SetNormalBitmap
+    SetBitmap2 = SetDisabledBitmap
+    "
 };
 
 
@@ -159,8 +164,8 @@ public:
                                    const wxBitmap& pushedBitmap = wxNullBitmap,
                                    int isToggle = FALSE,
                                    PyObject *clientData = NULL,
-                                   const wxString& shortHelpString = wxPyEmptyStr,
-                                   const wxString& longHelpString = wxPyEmptyStr) {
+                                   const wxString& shortHelpString = wxEmptyString,
+                                   const wxString& longHelpString = wxEmptyString) {
             wxPyUserData* udata = NULL;
             if (clientData)
                 udata = new wxPyUserData(clientData);
@@ -171,8 +176,8 @@ public:
         // This one is easier to use...
         wxToolBarToolBase *AddSimpleTool(int id,
                                          const wxBitmap& bitmap,
-                                         const wxString& shortHelpString = wxPyEmptyStr,
-                                         const wxString& longHelpString = wxPyEmptyStr,
+                                         const wxString& shortHelpString = wxEmptyString,
+                                         const wxString& longHelpString = wxEmptyString,
                                          int isToggle = FALSE) {
             return self->AddTool(id, bitmap, wxNullBitmap, isToggle, NULL,
                                  shortHelpString, longHelpString);
@@ -186,8 +191,8 @@ public:
                                       const wxBitmap& pushedBitmap = wxNullBitmap,
                                       int isToggle = FALSE,
                                       PyObject *clientData = NULL,
-                                      const wxString& shortHelpString = wxPyEmptyStr,
-                                      const wxString& longHelpString = wxPyEmptyStr) {
+                                      const wxString& shortHelpString = wxEmptyString,
+                                      const wxString& longHelpString = wxEmptyString) {
             wxPyUserData* udata = NULL;
             if (clientData)
                 udata = new wxPyUserData(clientData);
@@ -199,8 +204,8 @@ public:
         wxToolBarToolBase *InsertSimpleTool(size_t pos,
                                             int id,
                                             const wxBitmap& bitmap,
-                                            const wxString& shortHelpString = wxPyEmptyStr,
-                                            const wxString& longHelpString = wxPyEmptyStr,
+                                            const wxString& shortHelpString = wxEmptyString,
+                                            const wxString& longHelpString = wxEmptyString,
                                             int isToggle = FALSE) {
             return self->InsertTool(pos, id, bitmap, wxNullBitmap, isToggle, NULL,
                                     shortHelpString, longHelpString);
@@ -228,8 +233,8 @@ public:
 
     %addmethods {
         // convert the ClientData back to a PyObject
-        PyObject* GetToolClientData(int index) {
-            wxPyUserData* udata = (wxPyUserData*)self->GetToolClientData(index);
+        PyObject* GetToolClientData(int id) {
+            wxPyUserData* udata = (wxPyUserData*)self->GetToolClientData(id);
             if (udata) {
                 Py_INCREF(udata->m_obj);
                 return udata->m_obj;
@@ -239,8 +244,8 @@ public:
             }
         }
 
-        void SetToolClientData(int index, PyObject* clientData) {
-            self->SetToolClientData(index, new wxPyUserData(clientData));
+        void SetToolClientData(int id, PyObject* clientData) {
+            self->SetToolClientData(id, new wxPyUserData(clientData));
         }
     }
 
@@ -270,6 +275,12 @@ public:
     wxSize GetToolBitmapSize();
     wxSize GetToolSize();
 
+    // returns a (non separator) tool containing the point (x, y) or NULL if
+    // there is no tool at this point (corrdinates are client)
+    wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
+
+    // return TRUE if this is a vertical toolbar, otherwise FALSE
+    bool IsVertical();
 };