wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
~wxAcceleratorTable();
- bool Ok() const;
+ bool IsOk() const;
+ %pythoncode { Ok = IsOk }
};
}
#endif
- bool Ok();
-
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
+
DocDeclStr(
int , GetWidth(),
"Gets the width of the bitmap in pixels.", "");
#endif
#endif
- %pythoncode { def __nonzero__(self): return self.Ok() }
+ %pythoncode { def __nonzero__(self): return self.IsOk() }
%extend {
bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : false; }
%extend {
wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) {
- if ( !colour.Ok() )
+ if ( !colour.IsOk() )
return new wxMask(bitmap, *wxBLACK);
else
return new wxMask(bitmap, colour);
DocDeclStr(
- bool , Ok(),
+ bool , IsOk(),
"Returns True if the brush is initialised and valid.", "");
+ %pythoncode { Ok = IsOk }
#ifdef __WXMAC__
void MacSetTheme(short macThemeBrush);
#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(Stipple, GetStipple, SetStipple, doc="See `GetStipple` and `SetStipple`");
"Returns the Alpha value.", "");
DocDeclStr(
- bool , Ok(),
+ bool , IsOk(),
"Returns True if the colour object is valid (the colour has been
initialised with RGB values).", "");
+ %pythoncode { Ok = IsOk }
DocDeclStr(
void , Set(byte red, byte green, byte blue, byte alpha=wxALPHA_OPAQUE),
int green = -1;
int blue = -1;
int alpha = wxALPHA_OPAQUE;
- if (self->Ok()) {
+ if (self->IsOk()) {
red = self->Red();
green = self->Green();
blue = self->Blue();
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return 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
def __reduce__(self): return (Colour, self.Get(True))
}
#endif
DocDeclStr(
- bool , Ok(),
+ bool , IsOk(),
"", "");
+ %pythoncode { Ok = IsOk }
- %pythoncode { def __nonzero__(self): return self.Ok() }
+ %pythoncode { def __nonzero__(self): return self.IsOk() }
#ifdef __WXMSW__
// is the date valid (True even for non initialized objects)?
inline bool IsValid() const;
- %pythoncode { Ok = IsValid }
- %pythoncode { def __nonzero__(self): return self.Ok() };
+ %pythoncode { IsOk = IsValid }
+ %pythoncode { Ok = IsOk }
+
+ %pythoncode { def __nonzero__(self): return self.IsOk() };
// get the number of seconds since the Unix epoch - returns (time_t)-1
DocDeclStr(
- virtual bool , Ok() const,
+ virtual bool , IsOk() const,
"Returns true if the DC is ok to use.", "");
+ %pythoncode { Ok = IsOk }
// See below for implementation
}
- %pythoncode { def __nonzero__(self): return self.Ok() };
+ %pythoncode { def __nonzero__(self): return self.IsOk() };
#ifdef __WXMSW__
wxMetaFile(const wxString& filename = wxPyEmptyString);
~wxMetaFile();
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
bool SetClipboard(int width = 0, int height = 0);
wxSize GetSize();
const wxString& GetFileName() const;
#endif
- %pythoncode { def __nonzero__(self): return self.Ok() }
+ %pythoncode { def __nonzero__(self): return self.IsOk() }
};
// bool wxMakeMetaFilePlaceable(const wxString& filename,
// was the font successfully created?
DocDeclStr(
- bool , Ok() const,
+ bool , IsOk() const,
"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
void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
}
#endif
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
int GetWidth();
int GetHeight();
int GetDepth();
#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`");
// 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);
DocDeclStr(
- bool , Ok(),
+ bool , IsOk(),
"Returns true if image data is present.", "");
+ %pythoncode { Ok = IsOk }
DocDeclStr(
int , GetWidth(),
"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(AlphaData, GetAlphaData, SetAlphaData, doc="See `GetAlphaData` and `SetAlphaData`");
// NB: this function will _not_ generate PAGE_CHANGING/ED events
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
void AdvanceSelection(bool forward = true);
static wxVisualAttributes
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(ThemeBackgroundColour, GetThemeBackgroundColour, doc="See `GetThemeBackgroundColour`");
};
"GetRGB(self, int pixel) -> (R,G,B)");
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`");
};
int GetStyle();
int GetWidth();
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
void SetCap(int cap_style);
void SetColour(wxColour& colour);
bool __eq__(const wxPen* other) { return other ? (*self == *other) : false; }
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(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
bool GetCollate();
int GetOrientation();
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
const wxString& GetPrinterName();
bool GetColour();
wxString GetFilename() const;
void SetFilename( const wxString &filename );
- %pythoncode { def __nonzero__(self): return self.Ok() }
+ %pythoncode { def __nonzero__(self): return self.IsOk() }
//char* GetPrivData() const;
//int GetPrivDataLen() const;
wxPrintData& GetPrintData();
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
void SetDefaultInfo(bool flag);
void SetDefaultMinMargins(bool flag);
// Use paper id in wxPrintData to set this object's paper size
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(DefaultMinMargins, GetDefaultMinMargins, SetDefaultMinMargins, doc="See `GetDefaultMinMargins` and `SetDefaultMinMargins`");
bool GetEnableHelp() const;
// Is this data OK for showing the print dialog?
- bool Ok() const;
+ bool IsOk() const;
+ %pythoncode { Ok = IsOk }
wxPrintData& GetPrintData();
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(Collate, GetCollate, SetCollate, doc="See `GetCollate` and `SetCollate`");
int GetMaxPage();
int GetMinPage();
- bool Ok();
+ bool IsOk();
+ %pythoncode { Ok = IsOk }
void SetOk(bool ok);
virtual bool Print(bool interactive);
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(CurrentPage, GetCurrentPage, SetCurrentPage, doc="See `GetCurrentPage` and `SetCurrentPage`");