Added __nonzero__ method to more classes that have a Ok or IsOk

method.  This allows code like "if obj: ..." to be the same as
"if obj.Ok: ..."


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-04-10 19:38:11 +00:00
parent d2d844fa99
commit 88cd49f777
6 changed files with 33 additions and 6 deletions

View File

@@ -379,6 +379,8 @@ public:
void SetSize(const wxSize& size);
void Show(int show = TRUE);
void Hide();
%pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
%inline %{
@@ -1050,6 +1052,8 @@ public:
bool SetCapture(wxWindow* win, int pollingFreq = 0);
bool ReleaseCapture();
%pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
//----------------------------------------------------------------------
@@ -1083,11 +1087,13 @@ public:
class wxWave : public wxObject
{
public:
wxWave(const wxString& fileName, bool isResource = FALSE);
~wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE);
~wxWave();
bool IsOk() const;
bool Play(bool async = TRUE, bool looped = FALSE) const;
bool IsOk() const;
bool Play(bool async = TRUE, bool looped = FALSE) const;
%pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
%new wxWave* wxWaveData(const wxString& data);