- %pythonAppend Destroy "args[0].thisown = 0"
+ %pythonPrepend Destroy "args[0].this.own(False)"
DocDeclStr(
virtual bool , Destroy(),
"Destroys the window safely. Frames and dialogs are not destroyed
MoveXY);
DocDeclStr(
- void , SetBestFittingSize(const wxSize& size=wxDefaultSize),
+ void , SetInitialSize(const wxSize& size=wxDefaultSize),
"A 'Smart' SetSize that will fill in default size components with the
window's *best size* values. Also set's the minsize for use with sizers.", "");
-
+ %pythoncode { SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`') }
DocDeclStr(
DocDeclStr(
- wxSize , GetBestFittingSize() const,
+ wxSize , GetEffectiveMinSize() const,
"This function will merge the window's best size into the window's
minimum size, giving priority to the min size components, and returns
the results.
", "");
-
+ %pythoncode { GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.') }
- DocDeclStr(
- wxSize , GetAdjustedBestSize() const,
- "This method is similar to GetBestSize, except in one
-thing. GetBestSize should return the minimum untruncated size of the
-window, while this method will return the largest of BestSize and any
-user specified minimum size. ie. it is the minimum size the window
-should currently be drawn at, not the minimal size it can possibly
-tolerate.", "");
+ %pythoncode {
+ def GetAdjustedBestSize(self):
+ s = self.GetBestSize()
+ return wx.Size(max(s.width, self.GetMinWidth()),
+ max(s.height, self.GetMinHeight()))
+ GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
+ }
-
DocDeclStr(
void , Center( int direction = wxBOTH ),
"Centers the window. The parameter specifies the direction for
"", "");
DocDeclStr(
- void , SetMinSize(const wxSize& minSize),
+ virtual void , SetMinSize(const wxSize& minSize),
"A more convenient method than `SetSizeHints` for setting just the
min size.", "");
DocDeclStr(
- void , SetMaxSize(const wxSize& maxSize),
+ virtual void , SetMaxSize(const wxSize& maxSize),
"A more convenient method than `SetSizeHints` for setting just the
max size.", "");
+// void SetScrollHelper( wxScrollHelper *sh );
+// wxScrollHelper *GetScrollHelper();
+
+
// window state
// ------------
"Returns true if the window is enabled for input, false otherwise.", "");
DocDeclStr(
- virtual bool , IsVisible() const,
+ virtual bool , IsShownOnScreen() const,
"Returns ``True`` if the window is physically visible on the screen,
i.e. it is shown and all its parents up to the toplevel window are
shown as well.", "");
DocDeclStr(
void , SetEventHandler( wxEvtHandler *handler ),
"Sets the event handler for this window. An event handler is an object
-that is capable of processing the events sent to a window. By default,
-the window is its own event handler, but an application may wish to
-substitute another, for example to allow central implementation of
-event-handling for a variety of different window classes.
+that is capable of processing the events sent to a window. (In other
+words, is able to dispatch the events to handler function.) By
+default, the window is its own event handler, but an application may
+wish to substitute another, for example to allow central
+implementation of event-handling for a variety of different window
+classes.
It is usually better to use `wx.Window.PushEventHandler` since this sets
up a chain of event handlers, where an event not handled by one event
-handler is handed to the next one in the chain.", "");
+handler is handed off to the next one in the chain.", "");
DocDeclStr(
void , PushEventHandler( wxEvtHandler *handler ),
"Pushes this event handler onto the event handler stack for the window.
An event handler is an object that is capable of processing the events
-sent to a window. By default, the window is its own event handler, but
-an application may wish to substitute another, for example to allow
-central implementation of event-handling for a variety of different
-window classes.
+sent to a window. (In other words, is able to dispatch the events to
+handler function.) By default, the window is its own event handler,
+but an application may wish to substitute another, for example to
+allow central implementation of event-handling for a variety of
+different window classes.
wx.Window.PushEventHandler allows an application to set up a chain of
event handlers, where an event not handled by one event handler is
-handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
-remove the event handler.", "");
+handed to the next one in the chain. Use `wx.Window.PopEventHandler`
+to remove the event handler. Ownership of the handler is *not* given
+to the window, so you should be sure to pop the handler before the
+window is destroyed and either let PopEventHandler destroy it, or call
+its Destroy method yourself.", "");
DocDeclStr(
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.", "");
+destroyed after it is popped, and ``None`` will be returned instead.", "");
DocDeclStr(
bool , RemoveEventHandler(wxEvtHandler *handler),
"Find the given handler in the event handler chain and remove (but not
-delete) it from the event handler chain, return True if it was found
+delete) it from the event handler chain, returns True if it was found
and False otherwise (this also results in an assert failure so this
function should only be called when the handler is supposed to be
there.)", "");
window instead of waiting for the EVT_PAINT event to happen, (normally
this would usually only happen when the flow of control returns to the
event loop.) Notice that this function doesn't refresh the window and
-does nothing if the window has been already repainted. Use Refresh
+does nothing if the window has been already repainted. Use `Refresh`
first if you want to immediately redraw the window (or some portion of
it) unconditionally.", "");
a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
for all controls so it is mostly just a hint to wxWindows and not a
mandatory directive.", "");
+
+
+ DocDeclStr(
+ virtual bool , IsFrozen() const,
+ "Returns ``True`` if the window has been frozen and not thawed yet.
+
+:see: `Freeze` and `Thaw`", "");
+
DocDeclStr(
virtual void , Thaw(),
"Reenables window updating after a previous call to Freeze. Calls to
"Call this function to prepare the device context for drawing a
scrolled image. It sets the device origin according to the current
scroll position.", "");
+
+ DocDeclStr(
+ virtual bool , IsDoubleBuffered() const,
+ "Returns ``True`` if the window contents is double-buffered by the
+system, i.e. if any drawing done on the window is really done on a
+temporary backing surface and transferred to the screen all at once
+later.", "");
DocDeclStr(
%property(AutoLayout, GetAutoLayout, SetAutoLayout, doc="See `GetAutoLayout` and `SetAutoLayout`");
%property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`");
%property(BackgroundStyle, GetBackgroundStyle, SetBackgroundStyle, doc="See `GetBackgroundStyle` and `SetBackgroundStyle`");
- %property(BestFittingSize, GetBestFittingSize, SetBestFittingSize, doc="See `GetBestFittingSize` and `SetBestFittingSize`");
+ %property(EffectiveMinSize, GetEffectiveMinSize, doc="See `GetEffectiveMinSize`");
%property(BestSize, GetBestSize, doc="See `GetBestSize`");
%property(BestVirtualSize, GetBestVirtualSize, doc="See `GetBestVirtualSize`");
%property(Border, GetBorder, doc="See `GetBorder`");
%property(HelpText, GetHelpText, SetHelpText, doc="See `GetHelpText` and `SetHelpText`");
%property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
%property(Label, GetLabel, SetLabel, doc="See `GetLabel` and `SetLabel`");
+ %property(LayoutDirection, GetLayoutDirection, SetLayoutDirection, doc="See `GetLayoutDirection` and `SetLayoutDirection`");
%property(MaxHeight, GetMaxHeight, doc="See `GetMaxHeight`");
%property(MaxSize, GetMaxSize, SetMaxSize, doc="See `GetMaxSize` and `SetMaxSize`");
%property(MaxWidth, GetMaxWidth, doc="See `GetMaxWidth`");