Add IsOk's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6a591c4317
commit
6c2dd16f55
@ -154,7 +154,8 @@ items or or of 3-tuples (flags, keyCode, cmdID)
|
|||||||
wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
|
wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
|
||||||
~wxAcceleratorTable();
|
~wxAcceleratorTable();
|
||||||
|
|
||||||
bool Ok() const;
|
bool IsOk() const;
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,8 +178,9 @@ bit depths, the behaviour is platform dependent.", "",
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
int , GetWidth(),
|
int , GetWidth(),
|
||||||
"Gets the width of the bitmap in pixels.", "");
|
"Gets the width of the bitmap in pixels.", "");
|
||||||
@ -306,7 +307,7 @@ the ``type`` parameter.", "");
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : false; }
|
bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : false; }
|
||||||
@ -745,7 +746,7 @@ passed then BLACK is used.
|
|||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) {
|
wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) {
|
||||||
if ( !colour.Ok() )
|
if ( !colour.IsOk() )
|
||||||
return new wxMask(bitmap, *wxBLACK);
|
return new wxMask(bitmap, *wxBLACK);
|
||||||
else
|
else
|
||||||
return new wxMask(bitmap, colour);
|
return new wxMask(bitmap, colour);
|
||||||
|
@ -102,8 +102,9 @@ uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
|
|||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
bool , Ok(),
|
bool , IsOk(),
|
||||||
"Returns True if the brush is initialised and valid.", "");
|
"Returns True if the brush is initialised and valid.", "");
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
@ -111,7 +112,7 @@ uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
|
|||||||
void MacSetTheme(short macThemeBrush);
|
void MacSetTheme(short macThemeBrush);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
|
%property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
|
||||||
%property(Stipple, GetStipple, SetStipple, doc="See `GetStipple` and `SetStipple`");
|
%property(Stipple, GetStipple, SetStipple, doc="See `GetStipple` and `SetStipple`");
|
||||||
|
@ -95,9 +95,10 @@ public:
|
|||||||
"Returns the Alpha value.", "");
|
"Returns the Alpha value.", "");
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
bool , Ok(),
|
bool , IsOk(),
|
||||||
"Returns True if the colour object is valid (the colour has been
|
"Returns True if the colour object is valid (the colour has been
|
||||||
initialised with RGB values).", "");
|
initialised with RGB values).", "");
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
void , Set(byte red, byte green, byte blue, byte alpha=wxALPHA_OPAQUE),
|
void , Set(byte red, byte green, byte blue, byte alpha=wxALPHA_OPAQUE),
|
||||||
@ -172,7 +173,7 @@ is returned if the pixel is invalid (on X, unallocated).", "");
|
|||||||
int green = -1;
|
int green = -1;
|
||||||
int blue = -1;
|
int blue = -1;
|
||||||
int alpha = wxALPHA_OPAQUE;
|
int alpha = wxALPHA_OPAQUE;
|
||||||
if (self->Ok()) {
|
if (self->IsOk()) {
|
||||||
red = self->Red();
|
red = self->Red();
|
||||||
green = self->Green();
|
green = self->Green();
|
||||||
blue = self->Blue();
|
blue = self->Blue();
|
||||||
@ -199,7 +200,9 @@ is returned if the pixel is invalid (on X, unallocated).", "");
|
|||||||
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
|
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
|
||||||
def __str__(self): return str(self.Get(True))
|
def __str__(self): return str(self.Get(True))
|
||||||
def __repr__(self): return 'wx.Colour' + str(self.Get(True))
|
def __repr__(self): return 'wx.Colour' + str(self.Get(True))
|
||||||
def __nonzero__(self): return self.Ok()
|
def __len__(self): return len(self.Get())
|
||||||
|
def __getitem__(self, index): return self.Get()[index]
|
||||||
|
def __nonzero__(self): return self.IsOk()
|
||||||
__safe_for_unpickling__ = True
|
__safe_for_unpickling__ = True
|
||||||
def __reduce__(self): return (Colour, self.Get(True))
|
def __reduce__(self): return (Colour, self.Get(True))
|
||||||
}
|
}
|
||||||
|
@ -140,10 +140,11 @@ On MacOS the cursor is resized to 16x16 if it was larger.",
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
bool , Ok(),
|
bool , IsOk(),
|
||||||
"", "");
|
"", "");
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
@ -617,8 +617,10 @@ public:
|
|||||||
|
|
||||||
// is the date valid (True even for non initialized objects)?
|
// is the date valid (True even for non initialized objects)?
|
||||||
inline bool IsValid() const;
|
inline bool IsValid() const;
|
||||||
%pythoncode { Ok = IsValid }
|
%pythoncode { IsOk = IsValid }
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() };
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
|
%pythoncode { def __nonzero__(self): return self.IsOk() };
|
||||||
|
|
||||||
|
|
||||||
// get the number of seconds since the Unix epoch - returns (time_t)-1
|
// get the number of seconds since the Unix epoch - returns (time_t)-1
|
||||||
|
@ -707,8 +707,9 @@ converting a height, for example.", "");
|
|||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
virtual bool , Ok() const,
|
virtual bool , IsOk() const,
|
||||||
"Returns true if the DC is ok to use.", "");
|
"Returns true if the DC is ok to use.", "");
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -971,7 +972,7 @@ box doesn't contain anything.", "");
|
|||||||
// See below for implementation
|
// See below for implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() };
|
%pythoncode { def __nonzero__(self): return self.IsOk() };
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@ -1588,7 +1589,8 @@ public:
|
|||||||
wxMetaFile(const wxString& filename = wxPyEmptyString);
|
wxMetaFile(const wxString& filename = wxPyEmptyString);
|
||||||
~wxMetaFile();
|
~wxMetaFile();
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
bool SetClipboard(int width = 0, int height = 0);
|
bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
wxSize GetSize();
|
wxSize GetSize();
|
||||||
@ -1599,7 +1601,7 @@ public:
|
|||||||
const wxString& GetFileName() const;
|
const wxString& GetFileName() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
};
|
};
|
||||||
|
|
||||||
// bool wxMakeMetaFilePlaceable(const wxString& filename,
|
// bool wxMakeMetaFilePlaceable(const wxString& filename,
|
||||||
|
@ -656,9 +656,10 @@ the closest size is found using a binary search.
|
|||||||
|
|
||||||
// was the font successfully created?
|
// was the font successfully created?
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
bool , Ok() const,
|
bool , IsOk() const,
|
||||||
"Returns ``True`` if this font was successfully created.", "");
|
"Returns ``True`` if this font was successfully created.", "");
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { Ok = IsOk }
|
||||||
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
|
|
||||||
// comparison
|
// comparison
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
|
void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
int GetWidth();
|
int GetWidth();
|
||||||
int GetHeight();
|
int GetHeight();
|
||||||
int GetDepth();
|
int GetDepth();
|
||||||
@ -77,7 +78,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
void CopyFromBitmap(const wxBitmap& bmp);
|
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(Depth, GetDepth, SetDepth, doc="See `GetDepth` and `SetDepth`");
|
||||||
%property(Height, GetHeight, SetHeight, doc="See `GetHeight` and `SetHeight`");
|
%property(Height, GetHeight, SetHeight, doc="See `GetHeight` and `SetHeight`");
|
||||||
@ -106,7 +107,7 @@ public:
|
|||||||
|
|
||||||
// returns True if this object is valid/initialized
|
// returns True if this object is valid/initialized
|
||||||
bool IsOk() const;
|
bool IsOk() const;
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
// set/get the icon file name
|
// set/get the icon file name
|
||||||
void SetFileName(const wxString& filename);
|
void SetFileName(const wxString& filename);
|
||||||
|
@ -668,8 +668,9 @@ object, using a MIME type string to specify the image file format.", "",
|
|||||||
|
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
bool , Ok(),
|
bool , IsOk(),
|
||||||
"Returns true if image data is present.", "");
|
"Returns true if image data is present.", "");
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
DocDeclStr(
|
DocDeclStr(
|
||||||
int , GetWidth(),
|
int , GetWidth(),
|
||||||
@ -1035,7 +1036,7 @@ range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees", "");
|
|||||||
"Converts a color in HSV color space to RGB color space.", "");
|
"Converts a color in HSV color space to RGB color space.", "");
|
||||||
|
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(AlphaBuffer, GetAlphaBuffer, SetAlphaBuffer, doc="See `GetAlphaBuffer` and `SetAlphaBuffer`");
|
%property(AlphaBuffer, GetAlphaBuffer, SetAlphaBuffer, doc="See `GetAlphaBuffer` and `SetAlphaBuffer`");
|
||||||
%property(AlphaData, GetAlphaData, SetAlphaData, doc="See `GetAlphaData` and `SetAlphaData`");
|
%property(AlphaData, GetAlphaData, SetAlphaData, doc="See `GetAlphaData` and `SetAlphaData`");
|
||||||
|
@ -154,6 +154,9 @@ public:
|
|||||||
// NB: this function will _not_ generate PAGE_CHANGING/ED events
|
// NB: this function will _not_ generate PAGE_CHANGING/ED events
|
||||||
virtual int SetSelection(size_t n)/* = 0*/;
|
virtual int SetSelection(size_t n)/* = 0*/;
|
||||||
|
|
||||||
|
|
||||||
|
// acts as SetSelection but does not generate events
|
||||||
|
virtual int ChangeSelection(size_t n)/* = 0*/;
|
||||||
|
|
||||||
// cycle thru the pages
|
// cycle thru the pages
|
||||||
void AdvanceSelection(bool forward = true);
|
void AdvanceSelection(bool forward = true);
|
||||||
@ -273,6 +276,13 @@ public:
|
|||||||
static wxVisualAttributes
|
static wxVisualAttributes
|
||||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
|
// returns false if the change to nPage is vetoed by the program
|
||||||
|
bool SendPageChangingEvent(int nPage);
|
||||||
|
|
||||||
|
// sends the event about page change from old to new (or GetSelection() if
|
||||||
|
// new is -1)
|
||||||
|
void SendPageChangedEvent(int nPageOld, int nPageNew = -1);
|
||||||
|
|
||||||
%property(RowCount, GetRowCount, doc="See `GetRowCount`");
|
%property(RowCount, GetRowCount, doc="See `GetRowCount`");
|
||||||
%property(ThemeBackgroundColour, GetThemeBackgroundColour, doc="See `GetThemeBackgroundColour`");
|
%property(ThemeBackgroundColour, GetThemeBackgroundColour, doc="See `GetThemeBackgroundColour`");
|
||||||
};
|
};
|
||||||
|
@ -33,9 +33,10 @@ public:
|
|||||||
"GetRGB(self, int pixel) -> (R,G,B)");
|
"GetRGB(self, int pixel) -> (R,G,B)");
|
||||||
|
|
||||||
int GetColoursCount() const;
|
int GetColoursCount() const;
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(ColoursCount, GetColoursCount, doc="See `GetColoursCount`");
|
%property(ColoursCount, GetColoursCount, doc="See `GetColoursCount`");
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,8 @@ public:
|
|||||||
int GetStyle();
|
int GetStyle();
|
||||||
int GetWidth();
|
int GetWidth();
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
void SetCap(int cap_style);
|
void SetCap(int cap_style);
|
||||||
void SetColour(wxColour& colour);
|
void SetColour(wxColour& colour);
|
||||||
@ -112,7 +113,7 @@ public:
|
|||||||
bool __eq__(const wxPen* other) { return other ? (*self == *other) : false; }
|
bool __eq__(const wxPen* other) { return other ? (*self == *other) : false; }
|
||||||
bool __ne__(const wxPen* other) { return other ? (*self != *other) : true; }
|
bool __ne__(const wxPen* other) { return other ? (*self != *other) : true; }
|
||||||
}
|
}
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(Cap, GetCap, SetCap, doc="See `GetCap` and `SetCap`");
|
%property(Cap, GetCap, SetCap, doc="See `GetCap` and `SetCap`");
|
||||||
%property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
|
%property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
|
||||||
|
@ -70,7 +70,8 @@ public:
|
|||||||
bool GetCollate();
|
bool GetCollate();
|
||||||
int GetOrientation();
|
int GetOrientation();
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
const wxString& GetPrinterName();
|
const wxString& GetPrinterName();
|
||||||
bool GetColour();
|
bool GetColour();
|
||||||
@ -98,7 +99,7 @@ public:
|
|||||||
wxString GetFilename() const;
|
wxString GetFilename() const;
|
||||||
void SetFilename( const wxString &filename );
|
void SetFilename( const wxString &filename );
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
//char* GetPrivData() const;
|
//char* GetPrivData() const;
|
||||||
//int GetPrivDataLen() const;
|
//int GetPrivDataLen() const;
|
||||||
@ -201,7 +202,8 @@ public:
|
|||||||
|
|
||||||
wxPrintData& GetPrintData();
|
wxPrintData& GetPrintData();
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
void SetDefaultInfo(bool flag);
|
void SetDefaultInfo(bool flag);
|
||||||
void SetDefaultMinMargins(bool flag);
|
void SetDefaultMinMargins(bool flag);
|
||||||
@ -221,7 +223,7 @@ public:
|
|||||||
// Use paper id in wxPrintData to set this object's paper size
|
// Use paper id in wxPrintData to set this object's paper size
|
||||||
void CalculatePaperSizeFromId();
|
void CalculatePaperSizeFromId();
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(DefaultInfo, GetDefaultInfo, SetDefaultInfo, doc="See `GetDefaultInfo` and `SetDefaultInfo`");
|
%property(DefaultInfo, GetDefaultInfo, SetDefaultInfo, doc="See `GetDefaultInfo` and `SetDefaultInfo`");
|
||||||
%property(DefaultMinMargins, GetDefaultMinMargins, SetDefaultMinMargins, doc="See `GetDefaultMinMargins` and `SetDefaultMinMargins`");
|
%property(DefaultMinMargins, GetDefaultMinMargins, SetDefaultMinMargins, doc="See `GetDefaultMinMargins` and `SetDefaultMinMargins`");
|
||||||
@ -314,13 +316,14 @@ public:
|
|||||||
bool GetEnableHelp() const;
|
bool GetEnableHelp() const;
|
||||||
|
|
||||||
// Is this data OK for showing the print dialog?
|
// Is this data OK for showing the print dialog?
|
||||||
bool Ok() const;
|
bool IsOk() const;
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
|
|
||||||
|
|
||||||
wxPrintData& GetPrintData();
|
wxPrintData& GetPrintData();
|
||||||
void SetPrintData(const wxPrintData& printData);
|
void SetPrintData(const wxPrintData& printData);
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(AllPages, GetAllPages, SetAllPages, doc="See `GetAllPages` and `SetAllPages`");
|
%property(AllPages, GetAllPages, SetAllPages, doc="See `GetAllPages` and `SetAllPages`");
|
||||||
%property(Collate, GetCollate, SetCollate, doc="See `GetCollate` and `SetCollate`");
|
%property(Collate, GetCollate, SetCollate, doc="See `GetCollate` and `SetCollate`");
|
||||||
@ -692,13 +695,14 @@ public:
|
|||||||
int GetMaxPage();
|
int GetMaxPage();
|
||||||
int GetMinPage();
|
int GetMinPage();
|
||||||
|
|
||||||
bool Ok();
|
bool IsOk();
|
||||||
|
%pythoncode { Ok = IsOk }
|
||||||
void SetOk(bool ok);
|
void SetOk(bool ok);
|
||||||
|
|
||||||
virtual bool Print(bool interactive);
|
virtual bool Print(bool interactive);
|
||||||
virtual void DetermineScaling();
|
virtual void DetermineScaling();
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.Ok() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
|
|
||||||
%property(Canvas, GetCanvas, SetCanvas, doc="See `GetCanvas` and `SetCanvas`");
|
%property(Canvas, GetCanvas, SetCanvas, doc="See `GetCanvas` and `SetCanvas`");
|
||||||
%property(CurrentPage, GetCurrentPage, SetCurrentPage, doc="See `GetCurrentPage` and `SetCurrentPage`");
|
%property(CurrentPage, GetCurrentPage, SetCurrentPage, doc="See `GetCurrentPage` and `SetCurrentPage`");
|
||||||
|
Loading…
Reference in New Issue
Block a user