X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/src/_icon.i diff --git a/wxPython/src/_icon.i b/wxPython/src/_icon.i index bd112d3d98..d117a99ff6 100644 --- a/wxPython/src/_icon.i +++ b/wxPython/src/_icon.i @@ -20,23 +20,27 @@ //--------------------------------------------------------------------------- +MustHaveApp(wxIcon); + class wxIcon : public wxGDIObject { public: - wxIcon(const wxString& name, long flags, + wxIcon(const wxString& name, wxBitmapType type, int desiredWidth = -1, int desiredHeight = -1); ~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; @@ -51,13 +55,15 @@ public: #ifndef __WXMAC__ - bool LoadFile(const wxString& name, long flags); + bool LoadFile(const wxString& name, wxBitmapType type); #endif // wxGDIImage methods #ifdef __WXMSW__ long GetHandle(); - void SetHandle(long handle); + %extend { + void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); } + } #endif bool Ok(); int GetWidth(); @@ -93,7 +99,7 @@ public: ~wxIconLocation(); - // returns true if this object is valid/initialized + // returns True if this object is valid/initialized bool IsOk() const; %pythoncode { def __nonzero__(self): return self.Ok() } @@ -132,10 +138,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(); @@ -147,7 +153,7 @@ 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,