X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab1f7d2aa9cb1857cf87e105ebbd36a92676bbde..89d1e2eeab15869685246c20dc260432ea548ea6:/wxPython/src/_icon.i?ds=sidebyside diff --git a/wxPython/src/_icon.i b/wxPython/src/_icon.i index f43e09910b..0e3ff73d7a 100644 --- a/wxPython/src/_icon.i +++ b/wxPython/src/_icon.i @@ -30,15 +30,17 @@ public: ~wxIcon(); // alternate constructors - %name(EmptyIcon) wxIcon(); - %name(IconFromLocation) wxIcon(const wxIconLocation& loc); + %RenameCtor(EmptyIcon, wxIcon()); + %RenameCtor(IconFromLocation, wxIcon(const wxIconLocation& loc)); %extend { - %name(IconFromBitmap) wxIcon(const wxBitmap& bmp) { + %RenameCtor(IconFromBitmap, wxIcon(const wxBitmap& bmp)) + { wxIcon* icon = new wxIcon(); icon->CopyFromBitmap(bmp); return icon; } - %name(IconFromXPMData) wxIcon(PyObject* listOfStrings) { + %RenameCtor(IconFromXPMData, wxIcon(PyObject* listOfStrings)) + { char** cArray = NULL; wxIcon* icon; @@ -63,7 +65,8 @@ public: void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); } } #endif - bool Ok(); + bool IsOk(); + %pythoncode { Ok = IsOk } int GetWidth(); int GetHeight(); int GetDepth(); @@ -75,7 +78,12 @@ public: #endif void CopyFromBitmap(const wxBitmap& bmp); - %pythoncode { def __nonzero__(self): return self.Ok() } + %pythoncode { def __nonzero__(self): return self.IsOk() } + + %property(Depth, GetDepth, SetDepth, doc="See `GetDepth` and `SetDepth`"); + %property(Height, GetHeight, SetHeight, doc="See `GetHeight` and `SetHeight`"); + %property(Width, GetWidth, SetWidth, doc="See `GetWidth` and `SetWidth`"); + }; //--------------------------------------------------------------------------- @@ -99,7 +107,7 @@ public: // returns True if this object is valid/initialized bool IsOk() const; - %pythoncode { def __nonzero__(self): return self.Ok() } + %pythoncode { def __nonzero__(self): return self.IsOk() } // set/get the icon file name void SetFileName(const wxString& filename); @@ -122,6 +130,10 @@ public: #endif } } + + %property(FileName, GetFileName, SetFileName, doc="See `GetFileName` and `SetFileName`"); + %property(Index, GetIndex, SetIndex, doc="See `GetIndex` and `SetIndex`"); + }; @@ -136,10 +148,10 @@ public: wxIconBundle(); // initializes the bundle with the icon(s) found in the file - %name(IconBundleFromFile) wxIconBundle( const wxString& file, long type ); + %RenameCtor(IconBundleFromFile, wxIconBundle( const wxString& file, long type )); // initializes the bundle with a single icon - %name(IconBundleFromIcon)wxIconBundle( const wxIcon& icon ); + %RenameCtor(IconBundleFromIcon, wxIconBundle( const wxIcon& icon )); ~wxIconBundle(); @@ -151,12 +163,14 @@ public: // adds all the icons contained in the file to the collection, // if the collection already contains icons with the same // width and height, they are replaced - %name(AddIconFromFile)void AddIcon( const wxString& file, long type ); + %Rename(AddIconFromFile,void, AddIcon( const wxString& file, long type )); // returns the icon with the given size; if no such icon exists, // returns the icon with size wxSYS_ICON_[XY]; if no such icon exists, // returns the first icon in the bundle const wxIcon& GetIcon( const wxSize& size ) const; + + %property(Icon, GetIcon, doc="See `GetIcon`"); }; //---------------------------------------------------------------------------