X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..6caa0f5cd18fe9fb39c207d5f31fa5633479a822:/wxPython/src/_toolbar.i?ds=sidebyside diff --git a/wxPython/src/_toolbar.i b/wxPython/src/_toolbar.i index e2c32e77a8..f7e886494e 100644 --- a/wxPython/src/_toolbar.i +++ b/wxPython/src/_toolbar.i @@ -15,9 +15,8 @@ //--------------------------------------------------------------------------- -%{ - DECLARE_DEF_STRING(ToolBarNameStr); -%} +MAKE_CONST_WXSTRING_NOSWIG(ToolBarNameStr); + //--------------------------------------------------------------------------- %newgroup; @@ -35,6 +34,11 @@ enum wxToolBarToolStyle enum { wxTB_HORIZONTAL, wxTB_VERTICAL, + wxTB_TOP, + wxTB_LEFT, + wxTB_BOTTOM, + wxTB_RIGHT, + wxTB_3DBUTTONS, wxTB_FLAT, wxTB_DOCKABLE, @@ -44,6 +48,7 @@ enum { wxTB_NOALIGN, wxTB_HORZ_LAYOUT, wxTB_HORZ_TEXT, + wxTB_NO_TOOLTIPS }; @@ -60,13 +65,13 @@ class wxToolBarToolBase : public wxObject { public: // wxToolBarToolBase(wxToolBarBase *tbar = (wxToolBarBase *)NULL, // int id = wxID_SEPARATOR, -// const wxString& label = wxEmptyString, +// const wxString& label = wxPyEmptyString, // const wxBitmap& bmpNormal = wxNullBitmap, // const wxBitmap& bmpDisabled = wxNullBitmap, // wxItemKind kind = wxITEM_NORMAL, // wxObject *clientData = (wxObject *) NULL, -// const wxString& shortHelpString = wxEmptyString, -// const wxString& longHelpString = wxEmptyString) +// const wxString& shortHelpString = wxPyEmptyString, +// const wxString& longHelpString = wxPyEmptyString) // ~wxToolBarToolBase(); int GetId(); @@ -122,6 +127,19 @@ public: SetBitmap1 = SetNormalBitmap SetBitmap2 = SetDisabledBitmap } + + %property(Bitmap, GetBitmap, doc="See `GetBitmap`"); + %property(ClientData, GetClientData, SetClientData, doc="See `GetClientData` and `SetClientData`"); + %property(Control, GetControl, doc="See `GetControl`"); + %property(DisabledBitmap, GetDisabledBitmap, SetDisabledBitmap, doc="See `GetDisabledBitmap` and `SetDisabledBitmap`"); + %property(Id, GetId, doc="See `GetId`"); + %property(Kind, GetKind, doc="See `GetKind`"); + %property(Label, GetLabel, SetLabel, doc="See `GetLabel` and `SetLabel`"); + %property(LongHelp, GetLongHelp, SetLongHelp, doc="See `GetLongHelp` and `SetLongHelp`"); + %property(NormalBitmap, GetNormalBitmap, SetNormalBitmap, doc="See `GetNormalBitmap` and `SetNormalBitmap`"); + %property(ShortHelp, GetShortHelp, SetShortHelp, doc="See `GetShortHelp` and `SetShortHelp`"); + %property(Style, GetStyle, doc="See `GetStyle`"); + %property(ToolBar, GetToolBar, doc="See `GetToolBar`"); }; @@ -283,6 +301,7 @@ public: %# For consistency with the backwards compatible methods above, here are %# some non-'Label' versions of the Check and Radio methods + def AddCheckTool(self, id, bitmap, bmpDisabled = wx.NullBitmap, shortHelp = '', longHelp = '', @@ -303,9 +322,8 @@ public: shortHelp, longHelp, clientData) } - // TODO? - //wxToolBarToolBase *AddTool (wxToolBarToolBase *tool); - //wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool); + %Rename(AddToolItem, wxToolBarToolBase*, AddTool (wxToolBarToolBase *tool)); + %Rename(InsertToolItem, wxToolBarToolBase*, InsertTool (size_t pos, wxToolBarToolBase *tool)); wxToolBarToolBase *AddControl(wxControl *control); wxToolBarToolBase *InsertControl(size_t pos, wxControl *control); @@ -354,7 +372,7 @@ public: void SetToolLongHelp(int id, const wxString& helpString); wxString GetToolLongHelp(int id); - %name(SetMarginsXY) void SetMargins(int x, int y); + %Rename(SetMarginsXY, void, SetMargins(int x, int y)); void SetMargins(const wxSize& size); void SetToolPacking(int packing); void SetToolSeparation(int separation); @@ -376,34 +394,88 @@ public: // 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 + // find the tool by id + wxToolBarToolBase *FindById(int toolid) const; + + // return True if this is a vertical toolbar, otherwise False bool IsVertical(); + + size_t GetToolsCount() const; + + %property(Margins, GetMargins, SetMargins, doc="See `GetMargins` and `SetMargins`"); + %property(MaxCols, GetMaxCols, doc="See `GetMaxCols`"); + %property(MaxRows, GetMaxRows, doc="See `GetMaxRows`"); + %property(ToolBitmapSize, GetToolBitmapSize, SetToolBitmapSize, doc="See `GetToolBitmapSize` and `SetToolBitmapSize`"); + %property(ToolMargins, GetToolMargins, doc="See `GetToolMargins`"); + %property(ToolPacking, GetToolPacking, SetToolPacking, doc="See `GetToolPacking` and `SetToolPacking`"); + %property(ToolSeparation, GetToolSeparation, SetToolSeparation, doc="See `GetToolSeparation` and `SetToolSeparation`"); + %property(ToolSize, GetToolSize, doc="See `GetToolSize`"); + %property(ToolsCount, GetToolsCount, doc="See `GetToolsCount`"); }; +MustHaveApp(wxToolBar); + class wxToolBar : public wxToolBarBase { public: - %addtofunc wxToolBar "self._setOORInfo(self)" - %addtofunc wxToolBar() "" - + %pythonAppend wxToolBar "self._setOORInfo(self)" + %pythonAppend wxToolBar() "" + %typemap(out) wxToolBar*; // turn off this typemap + wxToolBar(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, const wxString& name = wxPyToolBarNameStr); - %name(PreToolBar)wxToolBar(); + %RenameCtor(PreToolBar, wxToolBar()); + + // Turn it back on again + %typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); } bool Create(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, const wxString& name = wxPyToolBarNameStr); - wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y); + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); +}; + +//--------------------------------------------------------------------------- + +#if 0 +%{ +#include +%} + +MustHaveApp(wxToolBar); +class wxButtonToolBar : public wxToolBarBase +{ +public: + %pythonAppend wxButtonToolBar "self._setOORInfo(self)" + %pythonAppend wxButtonToolBar() "" + + wxButtonToolBar(wxWindow *parent, + wxWindowID id=-1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyToolBarNameStr); + %RenameCtor(PreButtonToolBar, wxButtonToolBar()); + + + bool Create(wxWindow *parent, + wxWindowID id=-1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyToolBarNameStr); }; +#endif //---------------------------------------------------------------------------