and accessor classes. They allow platform independent direct access
to the platform specific pixel buffer inside of a wx.Bitmap object.
+The beginnings of support for RTL languages has been added, thanks to
+a Google SoC project.
+
DocDeclStr(
int , GetCommand(),
"Get the AcceleratorEntry's command ID.", "");
+
+ DocDeclStr(
+ bool , IsOk() const,
+ "", "");
+
+
+ DocDeclStr(
+ wxString , ToString() const,
+ "Returns a string representation for the this accelerator. The string
+is formatted using the <flags>-<keycode> format where <flags> maybe a
+hyphen-separed list of \"shift|alt|ctrl\"
+", "");
+
+ DocDeclStr(
+ bool , FromString(const wxString &str),
+ "Returns true if the given string correctly initialized this object.", "");
+
+
%property(Command, GetCommand, doc="See `GetCommand`");
%property(Flags, GetFlags, doc="See `GetFlags`");
%property(KeyCode, GetKeyCode, doc="See `GetKeyCode`");
:see: `wx.Exit`", "");
+ DocDeclStr(
+ virtual wxLayoutDirection , GetLayoutDirection() const,
+ "Return the layout direction for the current locale.", "");
+
+
DocDeclStr(
virtual void, ExitMainLoop(),
"Exit the main GUI loop during the next iteration of the main
wxID_CLOSE_ALL,
wxID_PREFERENCES,
+ wxID_EDIT,
wxID_CUT,
wxID_COPY,
wxID_PASTE,
wxID_VIEW_SORTSIZE,
wxID_VIEW_SORTTYPE,
+ wxID_FILE,
wxID_FILE1,
wxID_FILE2,
wxID_FILE3,
// given ID
bool wxIsStockLabel(wxWindowID id, const wxString& label);
+enum wxStockLabelQueryFlag
+{
+ wxSTOCK_NOFLAGS = 0,
+
+ wxSTOCK_WITH_MNEMONIC = 1,
+ wxSTOCK_WITH_ACCELERATOR = 2
+};
+
// Returns label that should be used for given stock UI element (e.g. "&OK"
// for wxID_OK):
wxString wxGetStockLabel(wxWindowID id,
- bool withCodes = true,
- wxString accelerator = wxPyEmptyString);
+ long flags = wxSTOCK_WITH_MNEMONIC);
MustHaveApp(wxBell);
//---------------------------------------------------------------------------
%newgroup
+enum wxLayoutDirection
+{
+ wxLayout_Default,
+ wxLayout_LeftToRight,
+ wxLayout_RightToLeft
+};
+
enum wxLanguage
{
// append any kind of item (normal/check/radio/separator)
wxMenuItem* Append(int id,
- const wxString& text,
+ const wxString& text = wxPyEmptyString,
const wxString& help = wxPyEmptyString,
wxItemKind kind = wxITEM_NORMAL);
// insert an item before given position
wxMenuItem* Insert(size_t pos,
int id,
- const wxString& text,
+ const wxString& text = wxPyEmptyString,
const wxString& help = wxPyEmptyString,
wxItemKind kind = wxITEM_NORMAL);
// prepend any item to the menu
wxMenuItem* Prepend(int id,
- const wxString& text,
+ const wxString& text = wxPyEmptyString,
const wxString& help = wxPyEmptyString,
wxItemKind kind = wxITEM_NORMAL);
// virtual wxSizerItem* PrependSpacer(int size);
// virtual wxSizerItem* PrependStretchSpacer(int prop = 1);
+
DocAStr(Remove,
"Remove(self, item) -> bool",
"Removes an item from the sizer and destroys it. This method does not
}
}
+
+ %Rename(_ReplaceWin,
+ bool, Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive = false ));
+ %Rename(_ReplaceSizer,
+ bool, Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive = false ));
+ %Rename(_ReplaceItem,
+ bool, Replace( size_t index, wxSizerItem *newitem ));
+ %pythoncode {
+ def Replace(self, olditem, item, recursive=False):
+ """
+ Detaches the given ``olditem`` from the sizer and replaces it with
+ ``item`` which can be a window, sizer, or `wx.SizerItem`. The
+ detached child is destroyed only if it is not a window, (because
+ windows are owned by their parent, not the sizer.) The
+ ``recursive`` parameter can be used to search for the given
+ element recursivly in subsizers.
+
+ This method does not cause any layout or resizing to take place,
+ call `Layout` to do so.
+
+ Returns ``True`` if the child item was found and removed.
+ """
+ if isinstance(olditem, wx.Window):
+ return self._ReplaceWin(olditem, item, recursive)
+ elif isinstnace(olditem, wx.Sizer):
+ return self._ReplaceSizer(olditem, item, recursive)
+ elif isinstnace(olditem, int):
+ return self._ReplaceItem(olditem, item)
+ else:
+ raise TypeError("Expected Window, Sizer, or integer for first parameter.")
+ }
+
+
+ DocDeclStr(
+ void , SetContainingWindow(wxWindow *window),
+ "Set (or unset) the window this sizer is used in.", "");
+
+ DocDeclStr(
+ wxWindow *, GetContainingWindow() const,
+ "Get the window this sizer is used in.", "");
+
+
%pythoncode {
def SetItemMinSize(self, item, *args):
"""
autogenerated) id", "");
+ DocDeclStr(
+ virtual wxLayoutDirection , GetLayoutDirection() const,
+ "Get the layout direction (LTR or RTL) for this window. Returns
+``wx.Layout_Default`` if layout direction is not supported.", "");
+
+ DocDeclStr(
+ virtual void , SetLayoutDirection(wxLayoutDirection dir),
+ "Set the layout direction (LTR or RTL) for this window.", "");
+
+
+ DocDeclStr(
+ virtual wxCoord , AdjustForLayoutDirection(wxCoord x,
+ wxCoord width,
+ wxCoord widthTotal) const,
+ "Mirror coordinates for RTL layout if this window uses it and if the
+mirroring is not done automatically like Win32.", "");
+
+
+
// moving/resizing
%property(ExtraStyle, GetExtraStyle, SetExtraStyle, doc="See `GetExtraStyle` and `SetExtraStyle`");
%property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`");
%property(ForegroundColour, GetForegroundColour, SetForegroundColour, doc="See `GetForegroundColour` and `SetForegroundColour`");
- %property(FullTextExtent, GetFullTextExtent, doc="See `GetFullTextExtent`");
%property(GrandParent, GetGrandParent, doc="See `GetGrandParent`");
%property(Handle, GetHandle, doc="See `GetHandle`");
%property(HelpText, GetHelpText, SetHelpText, doc="See `GetHelpText` and `SetHelpText`");
- %property(HelpTextAtPoint, GetHelpTextAtPoint, doc="See `GetHelpTextAtPoint`");
%property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
%property(Label, GetLabel, SetLabel, doc="See `GetLabel` and `SetLabel`");
%property(MaxHeight, GetMaxHeight, doc="See `GetMaxHeight`");
%property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
%property(ScreenPosition, GetScreenPosition, doc="See `GetScreenPosition`");
%property(ScreenRect, GetScreenRect, doc="See `GetScreenRect`");
- %property(ScrollPos, GetScrollPos, SetScrollPos, doc="See `GetScrollPos` and `SetScrollPos`");
- %property(ScrollRange, GetScrollRange, doc="See `GetScrollRange`");
- %property(ScrollThumb, GetScrollThumb, doc="See `GetScrollThumb`");
%property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
%property(Sizer, GetSizer, SetSizer, doc="See `GetSizer` and `SetSizer`");
- %property(TextExtent, GetTextExtent, doc="See `GetTextExtent`");
%property(ThemeEnabled, GetThemeEnabled, SetThemeEnabled, doc="See `GetThemeEnabled` and `SetThemeEnabled`");
%property(ToolTip, GetToolTip, SetToolTip, doc="See `GetToolTip` and `SetToolTip`");
%property(UpdateClientRect, GetUpdateClientRect, doc="See `GetUpdateClientRect`");
%property(WindowStyleFlag, GetWindowStyleFlag, SetWindowStyleFlag, doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`");
%property(WindowVariant, GetWindowVariant, SetWindowVariant, doc="See `GetWindowVariant` and `SetWindowVariant`");
+ %property(Shown, IsShown, Show, doc="See `IsShown` and `Show`");
+ %property(Enabled, IsEnabled, Enable, doc="See `IsEnabled` and `Enable`");
+ %property(TopLevel, IsTopLevel, doc="See `IsTopLevel`");
+
};
DEC_PYCALLBACK__INTCOLOUR(SetColour);
virtual void DrawSash(wxDC& dc,
+ wxWindow* window,
int orientation,
const wxRect& rect)
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawSash"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)",
- odc, orientation, orect));
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiO)",
+ odc, owin, orientation, orect));
Py_DECREF(odc);
Py_DECREF(orect);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawSash(dc, orientation, rect);
+ wxDefaultDockArt::DrawSash(dc, window, orientation, rect);
}
virtual void DrawBackground(wxDC& dc,
+ wxWindow* window,
int orientation,
const wxRect& rect)
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawBackground"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)",
- odc, orientation, orect));
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiO)",
+ odc, owin, orientation, orect));
Py_DECREF(odc);
Py_DECREF(orect);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawBackground(dc, orientation, rect);
+ wxDefaultDockArt::DrawBackground(dc, window, orientation, rect);
}
virtual void DrawCaption(wxDC& dc,
+ wxWindow* window,
const wxString& text,
const wxRect& rect,
wxPaneInfo& pane)
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawCaption"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* otext = wx2PyString(text);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOO)",
- odc, otext, orect, opane));
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOO)",
+ odc, owin, otext, orect, opane));
Py_DECREF(odc);
Py_DECREF(otext);
Py_DECREF(orect);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawCaption(dc, text, rect, pane);
+ wxDefaultDockArt::DrawCaption(dc, window, text, rect, pane);
}
virtual void DrawGripper(wxDC& dc,
+ wxWindow* window,
const wxRect& rect,
wxPaneInfo& pane)
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawGripper"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", odc, orect, opane));
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOO)", odc, owin, orect, opane));
Py_DECREF(odc);
Py_DECREF(orect);
Py_DECREF(opane);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawGripper(dc, rect, pane);
+ wxDefaultDockArt::DrawGripper(dc, window, rect, pane);
}
virtual void DrawBorder(wxDC& dc,
+ wxWindow* window,
const wxRect& rect,
wxPaneInfo& pane)
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawBorder"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", odc, orect, opane));
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawBorder(dc, rect, pane);
+ wxDefaultDockArt::DrawBorder(dc, window, rect, pane);
}
virtual void DrawPaneButton(wxDC& dc,
+ wxWindow* window,
int button,
int button_state,
const wxRect& rect,
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawPaneButton"))) {
PyObject* odc = wxPyMake_wxObject(&dc, false);
+ PyObject* owin = wxPyMake_wxObject(window, false);
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiIOO)",
- odc, button, button_state,
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiIOO)",
+ odc, owin, button, button_state,
orect, opane));
Py_DECREF(odc);
Py_DECREF(orect);
}
wxPyEndBlockThreads(blocked);
if (! found)
- wxDefaultDockArt::DrawPaneButton(dc, button, button_state, rect, pane);
+ wxDefaultDockArt::DrawPaneButton(dc, window, button, button_state, rect, pane);
}
PYPRIVATE;