2.5.3.2
-------
+New factory based printing framework. (TODO: Say more about this!)
+
+wx.Sizer Add, Insert, and Prepend funcitons now return a reference to the
+wx.SizerItem that was added to the sizer.
+
+Added wx.Sizer.GetItem method which returns the wx.SizerItem for the given
+wx.Window, wx.Sizer or position index.
+
+wxMSW: wx.RadioButtons in the same group no longer have to be
+consecutive (there may be intervening controls). Without this fix, an
+out-of-sync assert is generated when clicking on a radio button and
+then calling GetValue().
+
+XRC:
+ - added 'icon' property to wxFrame and wxDialog
+ - no longer ignores menu bitmaps on non-MSW platforms
+
+wxMSW: fix for [ 1052989 ] TextCtrl.SetBackgroundColour(wx.NullColour)
+bug.
+
+Added wx.PasswordEntryDialog analagous to wx.TextEntryDialog, allows
+detecting entering an empty string vs. cancel unlike the
+wx.GetPasswordFromUser dialog function.
+
+
OGL patch from Shane Holloway:
Two simple problems found in the new python ogl code. First is
Fixed GetSaveData and SetSaveData in wx.lib.multisash to not depend on
the default way that class objectss are converted to strings.
+Fixed problem in StyledTextCtrl.Set[H|V]ScrollBar that could leave the
+internal scrollbar visible.
+
+Added wx.StandardPaths which provides methods for determining standard
+system paths for each platform.
+
+
+
2.5.3.1
%rename(VideoMode) wxVideoMode;
%rename(DefaultVideoMode) wxDefaultVideoMode;
%rename(Display) wxDisplay;
+%rename(StandardPaths) wxStandardPaths;
#endif
%rename(MultiChoiceDialog) wxMultiChoiceDialog;
%rename(SingleChoiceDialog) wxSingleChoiceDialog;
%rename(TextEntryDialog) wxTextEntryDialog;
+%rename(PasswordEntryDialog) wxPasswordEntryDialog;
%rename(FontData) wxFontData;
%rename(FontDialog) wxFontDialog;
%rename(MessageDialog) wxMessageDialog;
%rename(PyPrintPreview) wxPyPrintPreview;
%rename(PyPreviewFrame) wxPyPreviewFrame;
%rename(PyPreviewControlBar) wxPyPreviewControlBar;
+%rename(PrintFactory) wxPrintFactory;
+%rename(PrintNativeDataBase) wxPrintNativeDataBase;
#endif
}
-#ifdef __WXMSW__
- void SetPalette(wxPalette& palette);
-#endif
-
// wxGDIImage methods
#ifdef __WXMSW__
long GetHandle();
-#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const;
+#ifdef __WXMSW__
virtual void SetPalette(const wxPalette& palette);
#endif
void , SetFilterIndex(int filterIndex),
"Sets the default filter index, starting from zero.", "");
-
DocDeclStr(
wxString , GetMessage() const,
"Returns the message that will be displayed on the dialog.", "");
const wxString& message,
const wxString& caption = wxPyGetTextFromUserPromptStr,
const wxString& defaultValue = wxPyEmptyString,
- long style = wxOK | wxCANCEL | wxCENTRE,
+ long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition),
"Constructor. Use ShowModal method to show the dialog.", "");
//---------------------------------------------------------------------------
+MAKE_CONST_WXSTRING(GetPasswordFromUserPromptStr);
+
+class wxPasswordEntryDialog : public wxTextEntryDialog
+{
+public:
+ wxPasswordEntryDialog(wxWindow *parent,
+ const wxString& message,
+ const wxString& caption = wxPyGetPasswordFromUserPromptStr,
+ const wxString& value = wxPyEmptyString,
+ long style = wxTextEntryDialogStyle,
+ const wxPoint& pos = wxDefaultPosition);
+};
+
+//---------------------------------------------------------------------------
+
DocStr(wxFontData,
"This class holds a variety of information related to font dialogs and
%extend {
DocAStr(Add,
"Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
-int border=0, userData=None)",
+int border=0, userData=None) -> wx.GBSizerItem",
"Adds an item to the sizer at the grid cell *pos*, optionally spanning
more than one row or column as specified with *span*. The remaining
Returns True if the item was successfully placed at the given cell
position, False if something was already there.
", "");
- bool Add( PyObject* item,
- const wxGBPosition& pos,
- const wxGBSpan& span = wxDefaultSpan,
- int flag = 0,
- int border = 0,
- PyObject* userData = NULL ) {
+ wxGBSizerItem* Add( PyObject* item,
+ const wxGBPosition& pos,
+ const wxGBSpan& span = wxDefaultSpan,
+ int flag = 0,
+ int border = 0,
+ PyObject* userData = NULL ) {
wxPyUserData* data = NULL;
bool blocked = wxPyBeginBlockThreads();
// Now call the real Add method if a valid item type was found
if ( info.window )
- return self->Add(info.window, pos, span, flag, border, data);
+ return (wxGBSizerItem*)self->Add(info.window, pos, span, flag, border, data);
else if ( info.sizer )
- return self->Add(info.sizer, pos, span, flag, border, data);
+ return (wxGBSizerItem*)self->Add(info.sizer, pos, span, flag, border, data);
else if (info.gotSize)
- return self->Add(info.size.GetWidth(), info.size.GetHeight(),
- pos, span, flag, border, data);
- return false;
+ return (wxGBSizerItem*)self->Add(info.size.GetWidth(), info.size.GetHeight(),
+ pos, span, flag, border, data);
+ return NULL;
}
}
DocDeclAStrName(
- bool , Add( wxGBSizerItem *item ),
- "Add(self, GBSizerItem item) -> bool",
+ wxGBSizerItem* , Add( wxGBSizerItem *item ),
+ "Add(self, GBSizerItem item) -> wx.GBSizerItem",
"Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
the item was successfully placed at its given cell position, False if
something was already there.", "",
wxRect(const wxPoint& pos, const wxSize& size),
"Create a new Rect from a position and size.", "",
RectPS);
-
+
+ DocCtorStrName(
+ wxRect(const wxSize& size),
+ "Create a new Rect from a size only.", "",
+ RectS);
+
~wxRect();
int GetX() const;
DocDeclA(
bool, GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT),
- "GetRGB(int pixel) -> (R,G,B)");
+ "GetRGB(self, int pixel) -> (R,G,B)");
bool Ok();
int GetQuality();
wxPrintBin GetBin();
+ wxPrintMode GetPrintMode() const;
void SetNoCopies(int v);
void SetCollate(bool flag);
void SetPaperSize(const wxSize& sz);
void SetQuality(int quality);
void SetBin(wxPrintBin bin);
+ void SetPrintMode(wxPrintMode printMode);
+
+ wxString GetFilename() const;
+ void SetFilename( const wxString &filename );
+
+ %pythoncode { def __nonzero__(self): return self.Ok() }
+
+
+ // NOTE: These are now inside of #if WXWIN_COMPATIBILITY_2_4, so be
+ // prepared to remove them...
+
// PostScript-specific data
const wxString& GetPrinterCommand();
const wxString& GetPrinterOptions();
const wxString& GetPreviewCommand();
- const wxString& GetFilename();
const wxString& GetFontMetricPath();
double GetPrinterScaleX();
double GetPrinterScaleY();
long GetPrinterTranslateX();
long GetPrinterTranslateY();
- wxPrintMode GetPrintMode();
-
void SetPrinterCommand(const wxString& command);
void SetPrinterOptions(const wxString& options);
void SetPreviewCommand(const wxString& command);
- void SetFilename(const wxString& filename);
void SetFontMetricPath(const wxString& path);
void SetPrinterScaleX(double x);
void SetPrinterScaleY(double y);
void SetPrinterTranslateX(long x);
void SetPrinterTranslateY(long y);
void SetPrinterTranslation(long x, long y);
- void SetPrintMode(wxPrintMode printMode);
-
- wxOutputStream* GetOutputStream();
- void SetOutputStream(wxOutputStream* outputstream);
- %pythoncode { def __nonzero__(self): return self.Ok() }
};
//---------------------------------------------------------------------------
bool GetSelection() const;
bool GetCollate() const;
bool GetPrintToFile() const;
+
+ // WXWIN_COMPATIBILITY_2_4
bool GetSetupDialog() const;
+ void SetSetupDialog(bool flag);
void SetFromPage(int v);
void SetToPage(int v);
void SetSelection(bool flag);
void SetCollate(bool flag);
void SetPrintToFile(bool flag);
- void SetSetupDialog(bool flag);
void EnablePrintToFile(bool flag);
void EnableSelection(bool flag);
wxPrintData& GetPrintData();
-// %addmethods {
-// %new wxPrintData* GetPrintData() {
-// return new wxPrintData(self->GetPrintData()); // force a copy
-// }
-// }
void SetPrintData(const wxPrintData& printData);
%pythoncode { def __nonzero__(self): return self.Ok() }
wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL);
- wxPrintDialogData& GetPrintDialogData();
+ // TODO?: wxPrintDialog(wxWindow *parent, wxPrintData* data);
+
+ virtual int ShowModal();
+
+ virtual wxPrintDialogData& GetPrintDialogData();
+ virtual wxPrintData& GetPrintData();
%newobject GetPrintDC;
- wxDC* GetPrintDC();
- int ShowModal();
+ virtual wxDC *GetPrintDC();
+
};
wxPrinter(wxPrintDialogData* data = NULL);
~wxPrinter();
- void CreateAbortWindow(wxWindow* parent, wxPyPrintout* printout);
- wxPrintDialogData& GetPrintDialogData();
- bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=true);
- wxDC* PrintDialog(wxWindow *parent);
- void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message);
- bool Setup(wxWindow *parent);
- bool GetAbort();
+ virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
+ virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message);
+
+ virtual bool Setup(wxWindow *parent);
+ virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
+ virtual wxDC* PrintDialog(wxWindow *parent);
+
+ virtual wxPrintDialogData& GetPrintDialogData() const;
+ bool GetAbort();
static wxPrinterError GetLastError();
};
void base_SetZoomControl(int zoom);
};
+//---------------------------------------------------------------------------
+// wxPrintFactory
+//---------------------------------------------------------------------------
+
+class wxPrintFactory
+{
+public:
+ // wxPrintFactory() {} *** It's an ABC
+ // virtual ~wxPrintFactory();
+
+ virtual wxPrinterBase *CreatePrinter( wxPrintDialogData* data );
+
+ %nokwargs CreatePrintPreview;
+ virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
+ wxPrintout *printout = NULL,
+ wxPrintDialogData *data = NULL );
+ virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
+ wxPrintout *printout,
+ wxPrintData *data );
+
+ %nokwargs CreatePrintDialog;
+ virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
+ wxPrintDialogData *data = NULL );
+ virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
+ wxPrintData *data );
+
+ // What to do and what to show in the wxPrintDialog
+ // a) Use the generic print setup dialog or a native one?
+ virtual bool HasPrintSetupDialog();
+ virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
+
+ // b) Provide the "print to file" option ourselves or via print setup?
+ virtual bool HasOwnPrintToFile();
+
+ // c) Show current printer
+ virtual bool HasPrinterLine();
+ virtual wxString CreatePrinterLine();
+
+ // d) Show Status line for current printer?
+ virtual bool HasStatusLine();
+ virtual wxString CreateStatusLine();
+
+
+ virtual wxPrintNativeDataBase *CreatePrintNativeData();
+
+ static void SetPrintFactory( wxPrintFactory *factory );
+ static wxPrintFactory *GetFactory();
+ //static wxPrintFactory *m_factory;
+};
+
+// class wxNativePrintFactory: public wxPrintFactory
+// {
+// public:
+// virtual wxPrinterBase *CreatePrinter( wxPrintDialogData *data );
+
+// virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
+// wxPrintout *printout = NULL,
+// wxPrintDialogData *data = NULL );
+// virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
+// wxPrintout *printout,
+// wxPrintData *data );
+
+// virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
+// wxPrintDialogData *data = NULL );
+// virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
+// wxPrintData *data );
+
+// virtual bool HasPrintSetupDialog();
+// virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
+// virtual bool HasOwnPrintToFile();
+// virtual bool HasPrinterLine();
+// virtual wxString CreatePrinterLine();
+// virtual bool HasStatusLine();
+// virtual wxString CreateStatusLine();
+
+// virtual wxPrintNativeDataBase *CreatePrintNativeData();
+// };
+
+
+class wxPrintNativeDataBase: public wxObject
+{
+public:
+ wxPrintNativeDataBase();
+ virtual ~wxPrintNativeDataBase() {}
+
+ virtual bool TransferTo( wxPrintData &data ) = 0;
+ virtual bool TransferFrom( const wxPrintData &data ) = 0;
+
+ virtual bool Ok() const = 0;
+
+ int m_ref;
+};
+
+
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void Clear();
-#ifndef __WXMAC__
bool Offset(wxCoord x, wxCoord y);
-#endif
wxRegionContain Contains(wxCoord x, wxCoord y);
%name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
DocDeclStr(
float , GetRatio(),
"Set the ratio item attribute.", "");
+
+ DocDeclStr(
+ wxRect , GetRect(),
+ "Returns the rectangle that the sizer item should occupy", "");
DocDeclStr(
DocAStr(Add,
"Add(self, item, int proportion=0, int flag=0, int border=0,
- PyObject userData=None)",
+ PyObject userData=None) -> wx.SizerItem",
"Appends a child item to the sizer.", "
is more complex than the *proportion* and *flag* will allow for.
");
- void Add(PyObject* item, int proportion=0, int flag=0, int border=0,
- PyObject* userData=NULL) {
+ wxSizerItem* Add(PyObject* item, int proportion=0, int flag=0, int border=0,
+ PyObject* userData=NULL) {
wxPyUserData* data = NULL;
bool blocked = wxPyBeginBlockThreads();
// Now call the real Add method if a valid item type was found
if ( info.window )
- self->Add(info.window, proportion, flag, border, data);
+ return self->Add(info.window, proportion, flag, border, data);
else if ( info.sizer )
- self->Add(info.sizer, proportion, flag, border, data);
+ return self->Add(info.sizer, proportion, flag, border, data);
else if (info.gotSize)
- self->Add(info.size.GetWidth(), info.size.GetHeight(),
- proportion, flag, border, data);
+ return self->Add(info.size.GetWidth(), info.size.GetHeight(),
+ proportion, flag, border, data);
+ else
+ return NULL;
}
-// virtual void AddSpacer(int size);
-// virtual void AddStretchSpacer(int prop = 1);
+// virtual wxSizerItem* AddSpacer(int size);
+// virtual wxSizerItem* AddStretchSpacer(int prop = 1);
DocAStr(Insert,
"Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
- PyObject userData=None)",
+ PyObject userData=None) -> wx.SizerItem",
"Inserts a new item into the list of items managed by this sizer before
the item at index *before*. See `Add` for a description of the parameters.", "");
- void Insert(int before, PyObject* item, int proportion=0, int flag=0,
- int border=0, PyObject* userData=NULL) {
+ wxSizerItem* Insert(int before, PyObject* item, int proportion=0, int flag=0,
+ int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL;
bool blocked = wxPyBeginBlockThreads();
// Now call the real Insert method if a valid item type was found
if ( info.window )
- self->Insert(before, info.window, proportion, flag, border, data);
+ return self->Insert(before, info.window, proportion, flag, border, data);
else if ( info.sizer )
- self->Insert(before, info.sizer, proportion, flag, border, data);
+ return self->Insert(before, info.sizer, proportion, flag, border, data);
else if (info.gotSize)
- self->Insert(before, info.size.GetWidth(), info.size.GetHeight(),
- proportion, flag, border, data);
+ return self->Insert(before, info.size.GetWidth(), info.size.GetHeight(),
+ proportion, flag, border, data);
+ else
+ return NULL;
}
-// virtual void InsertSpacer(size_t index, int size);
-// virtual void InsertStretchSpacer(size_t index, int prop = 1);
+// virtual wxSizerItem* InsertSpacer(size_t index, int size);
+// virtual wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
DocAStr(Prepend,
"Prepend(self, item, int proportion=0, int flag=0, int border=0,
- PyObject userData=None)",
+ PyObject userData=None) -> wx.SizerItem",
"Adds a new item to the begining of the list of sizer items managed by
this sizer. See `Add` for a description of the parameters.", "");
- void Prepend(PyObject* item, int proportion=0, int flag=0, int border=0,
- PyObject* userData=NULL) {
+ wxSizerItem* Prepend(PyObject* item, int proportion=0, int flag=0, int border=0,
+ PyObject* userData=NULL) {
wxPyUserData* data = NULL;
bool blocked = wxPyBeginBlockThreads();
// Now call the real Prepend method if a valid item type was found
if ( info.window )
- self->Prepend(info.window, proportion, flag, border, data);
+ return self->Prepend(info.window, proportion, flag, border, data);
else if ( info.sizer )
- self->Prepend(info.sizer, proportion, flag, border, data);
+ return self->Prepend(info.sizer, proportion, flag, border, data);
else if (info.gotSize)
- self->Prepend(info.size.GetWidth(), info.size.GetHeight(),
- proportion, flag, border, data);
+ return self->Prepend(info.size.GetWidth(), info.size.GetHeight(),
+ proportion, flag, border, data);
+ else
+ return NULL;
}
-// virtual void PrependSpacer(int size);
-// virtual void PrependStretchSpacer(int prop = 1);
+// virtual wxSizerItem* PrependSpacer(int size);
+// virtual wxSizerItem* PrependStretchSpacer(int prop = 1);
DocAStr(Remove,
"Remove(self, item) -> bool",
}
+ DocAStr(GetItem,
+ "GetItem(self, item) -> wx.SizerItem",
+ "Returns the `wx.SizerItem` which holds the *item* given. The *item*
+parameter can be either a window, a sizer, or the zero-based index of
+the item to be detached.", "");
+ wxSizerItem* GetItem(PyObject* item) {
+ bool blocked = wxPyBeginBlockThreads();
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
+ wxPyEndBlockThreads(blocked);
+ if ( info.window )
+ return self->GetItem(info.window);
+ else if ( info.sizer )
+ return self->GetItem(info.sizer);
+ else if ( info.gotPos )
+ return self->GetItem(info.pos);
+ else
+ return NULL;
+ }
+
+
void _SetItemMinSize(PyObject* item, const wxSize& size) {
bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
}
DocDeclAStrName(
- void , Add( wxSizerItem *item ),
+ wxSizerItem* , Add( wxSizerItem *item ),
"AddItem(self, SizerItem item)",
"Adds a `wx.SizerItem` to the sizer.", "",
AddItem);
DocDeclAStrName(
- void , Insert( size_t index, wxSizerItem *item ),
+ wxSizerItem* , Insert( size_t index, wxSizerItem *item ),
"InsertItem(self, int index, SizerItem item)",
"Inserts a `wx.SizerItem` to the sizer at the position given by *index*.", "",
InsertItem);
DocDeclAStrName(
- void , Prepend( wxSizerItem *item ),
+ wxSizerItem* , Prepend( wxSizerItem *item ),
"PrependItem(self, SizerItem item)",
"Prepends a `wx.SizerItem` to the sizer.", "",
PrependItem);
wxObject* GetParent() { return m_parent; }
wxObject* GetInstance() { return m_instance; }
wxWindow* GetParentAsWindow() { return m_parentAsWindow; }
- wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
+// wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
// turn some protected methods into public via delegation
wxObject* GetParent() { return m_parent; }
wxObject* GetInstance() { return m_instance; }
wxWindow* GetParentAsWindow() { return m_parentAsWindow; }
- wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
+// wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
// Returns true if the node has a property class equal to classname,
wxWindow* GetGridColLabelWindow();
wxWindow* GetGridCornerLabelWindow();
+ // Allow adjustment of scroll increment. The default is (15, 15).
+ void SetScrollLineX(int x);
+ void SetScrollLineY(int y);
+ int GetScrollLineX() const;
+ int GetScrollLineY() const;
+
+ int GetScrollX(int x) const;
+ int GetScrollY(int y) const;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
void PreviewText(const wxString &htmltext, const wxString& basepath = wxPyEmptyString);
void PrintFile(const wxString &htmlfile);
void PrintText(const wxString &htmltext, const wxString& basepath = wxPyEmptyString);
- void PrinterSetup();
+// void PrinterSetup();
void PageSetup();
void SetHeader(const wxString& header, int pg = wxPAGE_ALL);
void SetFooter(const wxString& footer, int pg = wxPAGE_ALL);
if node.GetName() == "bitmap":
return True
+ if node.GetName() == "icon":
+ return True
+
# URLs in wxHtmlWindow:
if node.GetName() == "url":
return True
wxRectPtr = wx._core.RectPtr
wxRectPP = wx._core.RectPP
wxRectPS = wx._core.RectPS
+wxRectS = wx._core.RectS
wxIntersectRect = wx._core.IntersectRect
wxPoint2D = wx._core.Point2D
wxPoint2DPtr = wx._core.Point2DPtr
wxSingleChoiceDialogPtr = wx._windows.SingleChoiceDialogPtr
wxTextEntryDialog = wx._windows.TextEntryDialog
wxTextEntryDialogPtr = wx._windows.TextEntryDialogPtr
+wxGetPasswordFromUserPromptStr = wx._windows.GetPasswordFromUserPromptStr
+wxPasswordEntryDialog = wx._windows.PasswordEntryDialog
+wxPasswordEntryDialogPtr = wx._windows.PasswordEntryDialogPtr
wxFontData = wx._windows.FontData
wxFontDataPtr = wx._windows.FontDataPtr
wxFontDialog = wx._windows.FontDialog
wxPyPreviewFramePtr = wx._windows.PyPreviewFramePtr
wxPyPreviewControlBar = wx._windows.PyPreviewControlBar
wxPyPreviewControlBarPtr = wx._windows.PyPreviewControlBarPtr
+wxPrintFactory = wx._windows.PrintFactory
+wxPrintFactoryPtr = wx._windows.PrintFactoryPtr
+wxPrintFactory_SetPrintFactory = wx._windows.PrintFactory_SetPrintFactory
+wxPrintFactory_GetFactory = wx._windows.PrintFactory_GetFactory
+wxPrintNativeDataBase = wx._windows.PrintNativeDataBase
+wxPrintNativeDataBasePtr = wx._windows.PrintNativeDataBasePtr
d = globals()