X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b39c3fa09a936e6a3f386a67c0fc7cfd84df0168..6231770f8935b3a2c5e27a32b9103287076d9191:/wxPython/src/_statusbar.i diff --git a/wxPython/src/_statusbar.i b/wxPython/src/_statusbar.i index 50013980d5..8cc9caab24 100644 --- a/wxPython/src/_statusbar.i +++ b/wxPython/src/_statusbar.i @@ -22,7 +22,15 @@ %newgroup; +enum { + wxSB_NORMAL, + wxSB_FLAT, + wxSB_RAISED +}; + + + // wxStatusBar: a window near the bottom of the frame used for status info MustHaveApp(wxStatusBar); class wxStatusBar : public wxWindow @@ -35,7 +43,7 @@ public: wxStatusBar(wxWindow* parent, wxWindowID id = -1, long style = wxDEFAULT_STATUSBAR_STYLE, const wxString& name = wxPyStatusLineNameStr); - %name(PreStatusBar)wxStatusBar(); + %RenameCtor(PreStatusBar, wxStatusBar()); // Turn it back on again %typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, $owner); } @@ -62,8 +70,16 @@ public: // minus the sum of fixed width fields) is divided between the fields with // negative width according to the abs value of the width (field with width // -2 grows twice as much as one with width -1 &c) - virtual void SetStatusWidths(int widths, const int* widths_field); // uses typemap in _toplvl.i + virtual void SetStatusWidths(int widths, const int* widths_field); + + // Set the field style. Use either wxSB_NORMAL (default) for a standard 3D + // border around a field, wxSB_FLAT for no border around a field, so that it + // appears flat or wxSB_POPOUT to make the field appear raised. + // Setting field styles only works on wxMSW + virtual void SetStatusStyles(int styles, const int* styles_field); + + // Get the position and size of the field's internal bounding rectangle %extend { wxRect GetFieldRect(int i) { @@ -82,6 +98,25 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %pythoncode { + def GetFields(self): + """Return a list of field values in the status bar. """ + return [self.GetStatusText(i) for i in range(self.GetFieldsCount())] + + def SetFields(self, items): + """Set the values of the statusbar fields from a list of strings. """ + self.SetFieldsCount(len(items)) + for i in range(len(items)): + self.SetStatusText(items[i], i) + } + + %property(BorderX, GetBorderX, doc="See `GetBorderX`"); + %property(BorderY, GetBorderY, doc="See `GetBorderY`"); + %property(FieldRect, GetFieldRect, doc="See `GetFieldRect`"); + %property(Fields, GetFields, SetFields, doc="See `GetFields` and `SetFields`"); + %property(FieldsCount, GetFieldsCount, SetFieldsCount, doc="See `GetFieldsCount` and `SetFieldsCount`"); + %property(StatusText, GetStatusText, SetStatusText, doc="See `GetStatusText` and `SetStatusText`"); };