+ Transfers values from child controls to data areas specified by their
+ validators. Returns @false if a transfer failed.
+
+ If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
+ the method will also call TransferDataFromWindow() of all child windows.
+
+ @see TransferDataToWindow(), wxValidator, Validate()
+ */
+ virtual bool TransferDataFromWindow();
+
+ /**
+ Transfers values to child controls from data areas specified by their
+ validators.
+
+ If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
+ the method will also call TransferDataToWindow() of all child windows.
+
+ @return Returns @false if a transfer failed.
+
+ @see TransferDataFromWindow(), wxValidator, Validate()
+ */
+ virtual bool TransferDataToWindow();
+
+ /**
+ Validates the current values of the child controls using their validators.
+ If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
+ the method will also call Validate() of all child windows.
+
+ @return Returns @false if any of the validations failed.
+
+ @see TransferDataFromWindow(), TransferDataToWindow(),
+ wxValidator
+ */
+ virtual bool Validate();
+
+ //@}
+
+
+ /**
+ @name wxWindow properties functions
+ */
+ //@{
+
+ /**
+ Returns the identifier of the window.
+
+ @remarks Each window has an integer identifier. If the application
+ has not provided one (or the default wxID_ANY) a unique
+ identifier with a negative value will be generated.
+
+ @see SetId(), @ref overview_windowids
+ */
+ wxWindowID GetId() const;
+
+ /**
+ Generic way of getting a label from any window, for
+ identification purposes.
+
+ @remarks The interpretation of this function differs from class to class.
+ For frames and dialogs, the value returned is the
+ title. For buttons or static text controls, it is the
+ button text. This function can be useful for
+ meta-programs (such as testing tools or special-needs
+ access programs) which need to identify windows by name.
+ */
+ virtual wxString GetLabel() const;
+
+ /**
+ Returns the layout direction for this window,
+ Note that @c wxLayout_Default is returned if layout direction is not supported.
+ */
+ virtual wxLayoutDirection GetLayoutDirection() const;
+
+ /**
+ Returns the window's name.
+
+ @remarks This name is not guaranteed to be unique; it is up to the
+ programmer to supply an appropriate name in the window
+ constructor or via SetName().
+
+ @see SetName()
+ */
+ virtual wxString GetName() const;
+
+ /**
+ Returns the value previously passed to SetWindowVariant().
+ */
+ wxWindowVariant GetWindowVariant() const;
+
+ /**
+ Sets the identifier of the window.
+
+ @remarks Each window has an integer identifier. If the application has
+ not provided one, an identifier will be generated.
+ Normally, the identifier should be provided on creation
+ and should not be modified subsequently.
+
+ @see GetId(), @ref overview_windowids
+ */
+ void SetId(wxWindowID winid);
+
+ /**
+ Sets the window's label.
+
+ @param label
+ The window label.
+
+ @see GetLabel()
+ */
+ virtual void SetLabel(const wxString& label);
+
+ /**
+ Sets the layout direction for this window.
+ */
+ virtual void SetLayoutDirection(wxLayoutDirection dir);
+
+ /**
+ Sets the window's name.
+
+ @param name
+ A name to set for the window.
+
+ @see GetName()
+ */
+ virtual void SetName(const wxString& name);
+
+ /**
+ This function can be called under all platforms but only does anything under
+ Mac OS X 10.3+ currently. Under this system, each of the standard control can
+ exist in several sizes which correspond to the elements of wxWindowVariant enum.
+
+ By default the controls use the normal size, of course, but this function can
+ be used to change this.
+ */
+ void SetWindowVariant(wxWindowVariant variant);
+
+ /**
+ Gets the accelerator table for this window. See wxAcceleratorTable.
+ */
+ wxAcceleratorTable* GetAcceleratorTable();
+
+ /**
+ Returns the accessible object for this window, if any.
+ See also wxAccessible.
+ */
+ wxAccessible* GetAccessible();
+
+ /**
+ Sets the accelerator table for this window. See wxAcceleratorTable.
+ */
+ virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
+
+ /**
+ Sets the accessible for this window. Any existing accessible for this window
+ will be deleted first, if not identical to @e accessible.
+ See also wxAccessible.
+ */
+ void SetAccessible(wxAccessible* accessible);
+
+ //@}
+
+
+ /**
+ @name Window deletion functions
+ */
+ //@{
+
+ /**
+ This function simply generates a wxCloseEvent whose handler usually tries
+ to close the window. It doesn't close the window itself, however.
+
+ @param force
+ @false if the window's close handler should be able to veto the destruction
+ of this window, @true if it cannot.
+
+ @remarks Close calls the close handler for the window, providing an
+ opportunity for the window to choose whether to destroy
+ the window. Usually it is only used with the top level
+ windows (wxFrame and wxDialog classes) as the others
+ are not supposed to have any special OnClose() logic.
+ The close handler should check whether the window is being deleted
+ forcibly, using wxCloseEvent::CanVeto, in which case it should
+ destroy the window using wxWindow::Destroy.
+ Note that calling Close does not guarantee that the window will
+ be destroyed; but it provides a way to simulate a manual close
+ of a window, which may or may not be implemented by destroying
+ the window. The default implementation of wxDialog::OnCloseWindow
+ does not necessarily delete the dialog, since it will simply
+ simulate an wxID_CANCEL event which is handled by the appropriate
+ button event handler and may do anything at all.
+ To guarantee that the window will be destroyed, call
+ wxWindow::Destroy instead
+
+ @see @ref overview_windowdeletion "Window Deletion Overview",
+ Destroy(), wxCloseEvent
+ */
+ bool Close(bool force = false);
+
+ /**
+ Destroys the window safely. Use this function instead of the delete operator,
+ since different window classes can be destroyed differently. Frames and dialogs
+ are not destroyed immediately when this function is called -- they are added
+ to a list of windows to be deleted on idle time, when all the window's events
+ have been processed. This prevents problems with events being sent to
+ non-existent windows.
+
+ @return @true if the window has either been successfully deleted, or it
+ has been added to the list of windows pending real deletion.
+ */
+ virtual bool Destroy();
+
+ /**
+ Returns true if this window is in process of being destroyed.
+
+ Top level windows are not deleted immediately but are rather
+ scheduled for later destruction to give them time to process any
+ pending messages; see Destroy() description.
+
+ This function returns @true if this window, or one of its parent
+ windows, is scheduled for destruction and can be useful to avoid
+ manipulating it as it's usually useless to do something with a window
+ which is on the point of disappearing anyhow.
+ */
+ bool IsBeingDeleted() const;
+
+ //@}
+
+
+
+ /**
+ @name Drag and drop functions
+ */
+ //@{
+
+ /**
+ Returns the associated drop target, which may be @NULL.
+
+ @see SetDropTarget(), @ref overview_dnd
+ */
+ virtual wxDropTarget* GetDropTarget() const;
+
+ /**
+ Associates a drop target with this window.
+ If the window already has a drop target, it is deleted.
+
+ @see GetDropTarget(), @ref overview_dnd
+ */
+ virtual void SetDropTarget(wxDropTarget* target);
+
+ /**
+ Enables or disables eligibility for drop file events (OnDropFiles).
+
+ @param accept
+ If @true, the window is eligible for drop file events.
+ If @false, the window will not accept drop file events.
+
+ @remarks Windows only until version 2.8.9, available on all platforms
+ since 2.8.10. Cannot be used together with SetDropTarget() on
+ non-Windows platforms.
+
+ @see SetDropTarget()
+ */
+ virtual void DragAcceptFiles(bool accept);
+
+ //@}
+
+
+ /**
+ @name Constraints, sizers and window layouting functions
+ */
+ //@{
+
+ /**
+ Returns the sizer of which this window is a member, if any, otherwise @NULL.
+ */
+ wxSizer* GetContainingSizer() const;
+
+ /**
+ Returns the sizer associated with the window by a previous call to
+ SetSizer(), or @NULL.
+ */
+ wxSizer* GetSizer() const;
+
+ /**
+ 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 constraints object is already owned by the
+ window, it will be deleted if the @a deleteOld parameter is @true.
+
+ Note that this function will also call SetAutoLayout() implicitly with @true
+ parameter if the @a sizer is non-@NULL and @false otherwise so that the
+ sizer will be effectively used to layout the window children whenever
+ it is resized.
+
+ @param sizer
+ The sizer to set. Pass @NULL to disassociate and conditionally delete
+ the window's sizer. See below.
+ @param deleteOld
+ If @true (the default), this will delete any pre-existing sizer.
+ Pass @false if you wish to handle deleting the old sizer yourself
+ but remember to do it yourself in this case to avoid memory leaks.
+
+ @remarks SetSizer enables and disables Layout automatically.
+ */
+ void SetSizer(wxSizer* sizer, bool deleteOld = true);
+
+ /**
+ This method calls SetSizer() and then wxSizer::SetSizeHints which sets the initial
+ window size to the size needed to accommodate all sizer elements and sets the
+ size hints which, if this window is a top level one, prevent the user from
+ resizing it to be less than this minimial size.
+ */
+ void SetSizerAndFit(wxSizer* sizer, bool deleteOld = true);
+
+ /**
+ Returns a pointer to the window's layout constraints, or @NULL if there are none.
+ */
+ wxLayoutConstraints* GetConstraints() const;
+
+ /**
+ Sets the window to have the given layout constraints. The window
+ will then own the object, and will take care of its deletion.
+ If an existing layout constraints object is already owned by the
+ window, it will be deleted.
+
+ @param constraints
+ The constraints to set. Pass @NULL to disassociate and delete the window's
+ constraints.
+
+ @remarks You must call SetAutoLayout() to tell a window to use
+ the constraints automatically in OnSize; otherwise, you
+ must override OnSize and call Layout() explicitly. When
+ setting both a wxLayoutConstraints and a wxSizer, only
+ the sizer will have effect.
+ */
+ void SetConstraints(wxLayoutConstraints* constraints);
+
+ /**
+ Invokes the constraint-based layout algorithm or the sizer-based algorithm
+ for this window.
+
+ This function does not get called automatically when the window is resized
+ because lots of windows deriving from wxWindow does not need this functionality.
+ If you want to have Layout() called automatically, you should derive
+ from wxPanel (see wxPanel::Layout).
+
+ @see @ref overview_windowsizing
+ */
+ virtual bool Layout();
+
+ /**
+ Determines whether the Layout() function will be called automatically
+ when the window is resized.
+
+ This method is called implicitly by SetSizer() but if you use SetConstraints()
+ you should call it manually or otherwise the window layout won't be correctly
+ updated when its size changes.
+
+ @param autoLayout
+ Set this to @true if you wish the Layout() function to be called
+ automatically when the window is resized.
+
+ @see SetSizer(), SetConstraints()
+ */
+ void SetAutoLayout(bool autoLayout);
+
+ bool GetAutoLayout() const;
+
+ //@}
+
+
+
+ /**
+ @name Mouse functions
+ */
+ //@{
+
+ /**
+ Directs all mouse input to this window.
+ Call ReleaseMouse() to release the capture.
+
+ Note that wxWidgets maintains the stack of windows having captured the mouse
+ and when the mouse is released the capture returns to the window which had had
+ captured it previously and it is only really released if there were no previous
+ window. In particular, this means that you must release the mouse as many times
+ as you capture it, unless the window receives the wxMouseCaptureLostEvent event.
+
+ Any application which captures the mouse in the beginning of some operation
+ must handle wxMouseCaptureLostEvent and cancel this operation when it receives
+ the event. The event handler must not recapture mouse.
+
+ @see ReleaseMouse(), wxMouseCaptureLostEvent
+ */
+ void CaptureMouse();
+
+ /**
+ Returns the caret() associated with the window.
+ */
+ wxCaret* GetCaret() const;
+
+ /**
+ Return the cursor associated with this window.
+
+ @see SetCursor()
+ */
+ const wxCursor& GetCursor() const;
+
+ /**
+ Returns @true if this window has the current mouse capture.
+
+ @see CaptureMouse(), ReleaseMouse(), wxMouseCaptureLostEvent,
+ wxMouseCaptureChangedEvent
+ */
+ virtual bool HasCapture() const;
+
+ /**
+ Releases mouse input captured with CaptureMouse().
+
+ @see CaptureMouse(), HasCapture(), ReleaseMouse(),
+ wxMouseCaptureLostEvent, wxMouseCaptureChangedEvent
+ */
+ void ReleaseMouse();
+
+ /**
+ Sets the caret() associated with the window.
+ */
+ void SetCaret(wxCaret* caret);
+
+ /**
+ Sets the window's cursor. Notice that the window cursor also sets it for the
+ children of the window implicitly.
+
+ The @a cursor may be @c wxNullCursor in which case the window cursor will
+ be reset back to default.
+
+ @param cursor
+ Specifies the cursor that the window should normally display.
+
+ @see ::wxSetCursor, wxCursor
+ */
+ virtual bool SetCursor(const wxCursor& cursor);
+
+ /**
+ Moves the pointer to the given position on the window.
+
+ @note Apple Human Interface Guidelines forbid moving the mouse cursor
+ programmatically so you should avoid using this function in Mac
+ applications (and probably avoid using it under the other
+ platforms without good reason as well).
+
+ @param x
+ The new x position for the cursor.
+ @param y
+ The new y position for the cursor.
+ */
+ virtual void WarpPointer(int x, int y);
+
+ //@}
+
+
+
+
+ /**
+ @name Miscellaneous functions
+ */
+ //@{
+
+ wxHitTest HitTest(wxCoord x, wxCoord y) const;
+ wxHitTest HitTest(const wxPoint& pt) const;
+
+ /**
+ Get the window border style from the given flags: this is different from
+ simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to
+ translate wxBORDER_DEFAULT to something reasonable
+ */
+ wxBorder GetBorder(long flags) const;
+
+ /**
+ Get border for the flags of this window
+ */
+ wxBorder GetBorder() const;
+
+
+ /**
+ Does the window-specific updating after processing the update event.
+ This function is called by UpdateWindowUI() in order to check return
+ values in the wxUpdateUIEvent and act appropriately.
+ For example, to allow frame and dialog title updating, wxWidgets
+ implements this function as follows:
+
+ @code
+ // do the window-specific processing after processing the update event
+ void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
+ {
+ if ( event.GetSetEnabled() )
+ Enable(event.GetEnabled());
+
+ if ( event.GetSetText() )
+ {
+ if ( event.GetText() != GetTitle() )
+ SetTitle(event.GetText());
+ }
+ }
+ @endcode
+ */
+ virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
+
+ /**
+ Returns the platform-specific handle of the physical window.
+ Cast it to an appropriate handle, such as @b HWND for Windows,
+ @b Widget for Motif, @b GtkWidget for GTK or @b WinHandle for PalmOS.
+
+ @beginWxPerlOnly
+ This method will return an integer in wxPerl.
+ @endWxPerlOnly
+ */
+ virtual WXWidget GetHandle() const;
+
+ /**
+ This method should be overridden to return @true if this window has
+ multiple pages. All standard class with multiple pages such as
+ wxNotebook, wxListbook and wxTreebook already override it to return @true
+ and user-defined classes with similar behaviour should also do so, to
+ allow the library to handle such windows appropriately.
+ */
+ virtual bool HasMultiplePages() const;
+
+ /**
+ This function is (or should be, in case of custom controls) called during
+ window creation to intelligently set up the window visual attributes, that is
+ the font and the foreground and background colours.
+
+ By "intelligently" the following is meant: by default, all windows use their
+ own @ref GetClassDefaultAttributes() default attributes.
+ However if some of the parents attributes are explicitly (that is, using
+ SetFont() and not wxWindow::SetOwnFont) changed 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 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 parent. However it was also deemed
+ desirable to allow to simply change the attributes of all children at once by
+ just changing the font or colour of their common parent, hence in this case we
+ do inherit the parents attributes.
+ */
+ virtual void InheritAttributes();
+
+ /**
+ Sends an @c wxEVT_INIT_DIALOG event, whose handler usually transfers data
+ to the dialog via validators.
+ */
+ virtual void InitDialog();
+
+ /**
+ 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.
+
+ @see wxBufferedDC
+ */
+ virtual bool IsDoubleBuffered() const;
+
+ void SetDoubleBuffered(bool on);
+
+ /**
+ Returns @true if the window is retained, @false otherwise.
+
+ @remarks Retained windows are only available on X platforms.
+ */
+ virtual bool IsRetained() const;
+
+ /**
+ Returns @true if this window is intrinsically enabled, @false otherwise,
+ i.e. if @ref Enable() Enable(@false) had been called. This method is
+ mostly used for wxWidgets itself, user code should normally use
+ IsEnabled() instead.
+ */
+ bool IsThisEnabled() const;
+
+ /**
+ Returns @true if the given window is a top-level one. Currently all frames and
+ dialogs are considered to be top-level windows (even if they have a parent
+ window).
+ */
+ virtual bool IsTopLevel() const;
+
+ /**
+ Disables all other windows in the application so that
+ the user can only interact with this window.
+
+ @param modal
+ If @true, this call disables all other windows in the application so that
+ the user can only interact with this window. If @false, the effect is
+ reversed.
+ */
+ virtual void MakeModal(bool modal = true);
+
+
+ /**
+ This virtual function is normally only used internally, but
+ sometimes an application may need it to implement functionality
+ that should not be disabled by an application defining an OnIdle
+ handler in a derived class.
+
+ This function may be used to do delayed painting, for example,
+ and most implementations call UpdateWindowUI()
+ in order to send update events to the window in idle time.
+ */
+ virtual void OnInternalIdle();
+
+ /**
+ Registers a system wide hotkey. Every time the user presses the hotkey
+ registered here, this window will receive a hotkey event.
+
+ It will receive the event even if the application is in the background
+ and does not have the input focus because the user is working with some
+ other application.