%extend {
wxVisualAttributes() { return new wxVisualAttributes; }
~wxVisualAttributes() { delete self; }
- }
+ }
// the font used for control label/text inside it
wxFont font;
MustHaveApp(wxWindow);
MustHaveApp(wxWindow::FindFocus);
MustHaveApp(wxWindow::GetCapture);
-MustHaveApp(wxWindow::GetClassDefaultAttributes);
+
+// This one is not restricted to wxWindow
+MustHaveApp(GetClassDefaultAttributes);
class wxWindow : public wxEvtHandler
{
public:
%pythonAppend wxWindow "self._setOORInfo(self)"
%pythonAppend wxWindow() ""
+ %typemap(out) wxWindow*; // turn off this typemap
DocCtorStr(
wxWindow(wxWindow* parent, const wxWindowID id=-1,
"Precreate a Window for 2-phase creation.", "",
PreWindow);
+ // Turn it back on again
+ %typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, $owner); }
+
DocDeclStr(
bool , Create(wxWindow* parent, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
DocDeclStr(
- bool , Close( bool force = False ),
+ bool , Close( bool force = false ),
"This function simply generates a EVT_CLOSE event whose handler usually
tries to close the window. It doesn't close the window itself,
however. If force is False (the default) then the window's close
- %nokwargs SetSizeHints;
DocStr(SetSizeHints,
"Allows specification of minimum and maximum window sizes, and window
size increments. If a pair of values is not set (or set to -1), the
:see: `GetMinSize`, `GetMaxSize`, `SetMinSize`, `SetMaxSize`
");
- void SetSizeHints( const wxSize& minSize,
- const wxSize& maxSize=wxDefaultSize,
- const wxSize& incSize=wxDefaultSize);
virtual void SetSizeHints( int minW, int minH,
int maxW = -1, int maxH = -1,
int incW = -1, int incH = -1 );
+ %name(SetSizeHintsSz) void SetSizeHints( const wxSize& minSize,
+ const wxSize& maxSize=wxDefaultSize,
+ const wxSize& incSize=wxDefaultSize);
- %nokwargs SetVirtualSizeHints;
DocStr(SetVirtualSizeHints,
"Allows specification of minimum and maximum virtual window sizes. If a
pair of values is not set (or set to -1), the default values will be
used. If this function is called, the user will not be able to size
the virtual area of the window outside the given bounds.", "");
- void SetVirtualSizeHints( const wxSize& minSize,
- const wxSize& maxSize=wxDefaultSize);
virtual void SetVirtualSizeHints( int minW, int minH,
int maxW = -1, int maxH = -1 );
+ %name(SetVirtualSizeHintsSz)void SetVirtualSizeHints(
+ const wxSize& minSize, const wxSize& maxSize=wxDefaultSize);
+
+
DocDeclStr(
virtual wxSize , GetMaxSize() const,
// ------------
DocDeclStr(
- virtual bool , Show( bool show = True ),
+ virtual bool , Show( bool show = true ),
"Shows or hides the window. You may need to call Raise for a top level
window if you want to bring it to top, although this is not needed if
Show is called immediately after the frame creation. Returns True if
DocDeclStr(
- virtual bool , Enable( bool enable = True ),
+ virtual bool , Enable( bool enable = true ),
"Enable or disable the window for user input. Note that when a parent
window is disabled, all of its children are disabled as well and they
are reenabled again when the parent is. Returns true if the window
DocDeclStr(
- virtual void , MakeModal(bool modal = True),
+ virtual void , MakeModal(bool modal = true),
"Disables all other windows in the application so that the user can
only interact with this window. Passing False will reverse this
effect.", "");
"Does keyboard navigation from this window to another, by sending a
`wx.NavigationKeyEvent`.", "
- :param flags: A combination of the ``IsForward`` and ``WinChange``
- values in the `wx.NavigationKeyEvent` class, which determine
- if the navigation should be in forward or reverse order, and
- if it should be able to cross parent window boundaries, such
- as between notebook pages or MDI child frames. Typically the
- status of the Shift key (for forward or reverse) or the
- Control key (for WinChange) would be used to determine how to
- set the flags.
+ :param flags: A combination of the ``IsForward`` or ``IsBackward``
+ and the ``WinChange`` values in the `wx.NavigationKeyEvent`
+ class, which determine if the navigation should be in forward
+ or reverse order, and if it should be able to cross parent
+ window boundaries, such as between notebook pages or MDI child
+ frames. Typically the status of the Shift key (for forward or
+ backward) or the Control key (for WinChange) would be used to
+ determine how to set the flags.
One situation in which you may wish to call this method is from a text
control custom keypress handler to do the default navigation behaviour
for the tab key, since the standard default behaviour for a multiline
text control with the wx.TE_PROCESS_TAB style is to insert a tab and
not navigate to the next control.");
+
+
+
+ DocDeclStr(
+ void , MoveAfterInTabOrder(wxWindow *win),
+ "Moves this window in the tab navigation order after the specified
+sibling window. This means that when the user presses the TAB key on
+that other window, the focus switches to this window.
+
+The default tab order is the same as creation order. This function
+and `MoveBeforeInTabOrder` allow to change it after creating all the
+windows.
+", "");
+
+
+ DocDeclStr(
+ void , MoveBeforeInTabOrder(wxWindow *win),
+ "Same as `MoveAfterInTabOrder` except that it inserts this window just
+before win instead of putting it right after it.", "");
+
+
+
// parent/children relations
// -------------------------
DocDeclStr(
- wxEvtHandler *, PopEventHandler( bool deleteHandler = False ),
+ wxEvtHandler *, PopEventHandler( bool deleteHandler = false ),
"Removes and returns the top-most event handler on the event handler
stack. If deleteHandler is True then the wx.EvtHandler object will be
destroyed after it is popped.", "");
%#if wxUSE_HOTKEY
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
%#else
- return False;
+ return false;
%#endif
}
#if wxUSE_HOTKEY
return self->UnregisterHotKey(hotkeyId);
#else
- return False;
+ return false;
#endif
}
}
// -------------------
DocDeclStr(
- virtual void , Refresh( bool eraseBackground = True,
+ virtual void , Refresh( bool eraseBackground = true,
const wxRect *rect = NULL ),
"Mark the specified rectangle (or the whole window) as \"dirty\" so it
will be repainted. Causes an EVT_PAINT event to be generated and sent
applications on the system.", "");
DocDeclStr(
- void , SetDefaultBackgroundColour(const wxColour& colour),
+ void , SetOwnBackgroundColour(const wxColour& colour),
"", "");
not be used at all.", "");
DocDeclStr(
- void , SetDefaultForegroundColour(const wxColour& colour),
+ void , SetOwnForegroundColour(const wxColour& colour),
"", "");
colour or other colour, or it may not be used at all.", "");
+ // Set/get the background style.
+ // Pass one of wxBG_STYLE_SYSTEM, wxBG_STYLE_COLOUR, wxBG_STYLE_CUSTOM
+ DocDeclStr(
+ virtual bool , SetBackgroundStyle(wxBackgroundStyle style),
+ "Returns the background style of the window. The background style
+indicates how the background of the window is drawn.
+
+ ====================== ========================================
+ wx.BG_STYLE_SYSTEM The background colour or pattern should
+ be determined by the system
+ wx.BG_STYLE_COLOUR The background should be a solid colour
+ wx.BG_STYLE_CUSTOM The background will be implemented by the
+ application.
+ ====================== ========================================
+
+On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
+a custom background, such as a tiled bitmap. Currently the style has
+no effect on other platforms.
+
+:see: `GetBackgroundStyle`, `SetBackgroundColour`", "");
+
+ DocDeclStr(
+ virtual wxBackgroundStyle , GetBackgroundStyle() const,
+ "Returns the background style of the window.
+
+:see: `SetBackgroundStyle`", "");
+
DocDeclStr(
"Sets the font for this window.", "");
DocDeclStr(
- void , SetDefaultFont(const wxFont& font),
+ void , SetOwnFont(const wxFont& font),
"", "");
}
}
+ DocStr(
+ AssociateHandle,
+ "Associate the window with a new native handle", "");
+ %extend {
+ void AssociateHandle(long handle) {
+ self->AssociateHandle((WXWidget)handle);
+ }
+ }
+
+
+ DocDeclStr(
+ virtual void , DissociateHandle(),
+ "Dissociate the current native handle from the window", "");
+
#ifdef __WXMSW__
int position,
int thumbSize,
int range,
- bool refresh = True ),
+ bool refresh = true ),
"Sets the scrollbar properties of a built-in scrollbar.",
"
:param orientation: Determines the scrollbar whose page size is to
");
DocDeclStr(
- virtual void , SetScrollPos( int orientation, int pos, bool refresh = True ),
+ virtual void , SetScrollPos( int orientation, int pos, bool refresh = true ),
"Sets the position of one of the built-in scrollbars.", "");
DocDeclStr(
DocDeclStr(
- void , SetSizer(wxSizer *sizer, bool deleteOld = True ),
+ void , SetSizer(wxSizer *sizer, bool deleteOld = true ),
"Sets the window to have the given layout sizer. The window will then
own the object, and will take care of its deletion. If an existing
layout sizer object is already owned by the window, it will be deleted
if the deleteOld parameter is true. Note that this function will also
call SetAutoLayout implicitly with a True parameter if the sizer is
-non-NoneL and False otherwise.", "");
+non-None, and False otherwise.", "");
DocDeclStr(
- void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = True ),
+ void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ),
"The same as SetSizer, except it also sets the size hints for the
window based on the sizer's minimum size.", "");
By 'intelligently' the following is meant: by default, all windows use
their own default attributes. However if some of the parent's
attributes are explicitly changed (that is, using SetFont and not
-SetDefaultFont) and if the corresponding attribute hadn't been
+SetOwnFont) and if the corresponding attribute hadn't been
explicitly set for this window itself, then this window takes the same
value as used by the parent. In addition, if the window overrides
ShouldInheritColours to return false, the colours will not be changed
no matter what and only the font might.
-This rather complicated logic is necessary in order to accomodate the
-different usage scenarius. The most common one is when all default
+This rather complicated logic is necessary in order to accommodate the
+different usage scenarios. The most common one is when all default
attributes are used and in this case, nothing should be inherited as
in modern GUIs different controls use different fonts (and colours)
than their siblings so they can't inherit the same value from the