changes the behaviour of the latter.
@beginStyleTable
- @style{wxBORDER_DEFAULT}:
+ @style{wxBORDER_DEFAULT}
The window class will decide the kind of border to show, if any.
- @style{wxBORDER_SIMPLE}:
+ @style{wxBORDER_SIMPLE}
Displays a thin border around the window. wxSIMPLE_BORDER is the
old name for this style.
- @style{wxBORDER_SUNKEN}:
+ @style{wxBORDER_SUNKEN}
Displays a sunken border. wxSUNKEN_BORDER is the old name for this
style.
- @style{wxBORDER_RAISED}:
+ @style{wxBORDER_RAISED}
Displays a raised border. wxRAISED_BORDER is the old name for this
style.
- @style{wxBORDER_STATIC}:
+ @style{wxBORDER_STATIC}
Displays a border suitable for a static control. wxSTATIC_BORDER
is the old name for this style. Windows only.
- @style{wxBORDER_THEME}:
+ @style{wxBORDER_THEME}
Displays a native border suitable for a control, on the current
platform. On Windows XP or Vista, this will be a themed border; on
most other platforms a sunken border will be used. For more
information for themed borders on Windows, please see Themed
borders on Windows.
- @style{wxBORDER_NONE}:
+ @style{wxBORDER_NONE}
Displays no border, overriding the default border style for the
window. wxNO_BORDER is the old name for this style.
- @style{wxBORDER_DOUBLE}:
+ @style{wxBORDER_DOUBLE}
This style is obsolete and should not be used.
- @style{wxTRANSPARENT_WINDOW}:
+ @style{wxTRANSPARENT_WINDOW}
The window is transparent, that is, it will not receive paint
events. Windows only.
- @style{wxTAB_TRAVERSAL}:
+ @style{wxTAB_TRAVERSAL}
Use this to enable tab traversal for non-dialog windows.
- @style{wxWANTS_CHARS}:
+ @style{wxWANTS_CHARS}
Use this to indicate that the window wants to get all char/key
events for all keys - even for keys like TAB or ENTER which are
usually used for dialog navigation and which wouldn't be generated
the arrows or etc., but would still like to have normal keyboard
navigation take place, you should call Navigate in response to the
key events for Tab and Shift-Tab.
- @style{wxNO_FULL_REPAINT_ON_RESIZE}:
+ @style{wxNO_FULL_REPAINT_ON_RESIZE}
On Windows, this style used to disable repainting the window
completely when its size is changed. Since this behaviour is now
the default, the style is now obsolete and no longer has an effect.
- @style{wxVSCROLL}:
+ @style{wxVSCROLL}
Use this style to enable a vertical scrollbar. Notice that this
style cannot be used with native controls which don't support
scrollbars nor with top-level windows in most ports.
- @style{wxHSCROLL}:
+ @style{wxHSCROLL}
Use this style to enable a horizontal scrollbar. The same
limitations as for wxVSCROLL apply to this style.
- @style{wxALWAYS_SHOW_SB}:
+ @style{wxALWAYS_SHOW_SB}
If a window has scrollbars, disable them instead of hiding them
when they are not needed (i.e. when the size of the window is big
enough to not require the scrollbars to navigate it). This style is
currently implemented for wxMSW, wxGTK and wxUniversal and does
nothing on the other platforms.
- @style{wxCLIP_CHILDREN}:
+ @style{wxCLIP_CHILDREN}
Use this style to eliminate flicker caused by the background being
repainted, then children being painted over them. Windows only.
- @style{wxFULL_REPAINT_ON_RESIZE}:
+ @style{wxFULL_REPAINT_ON_RESIZE}
Use this style to force a complete redraw of the window whenever it
is resized instead of redrawing just the part of the window
affected by resizing. Note that this was the behaviour by default
@endStyleTable
@beginExtraStyleTable
- @style{wxWS_EX_VALIDATE_RECURSIVELY}:
+ @style{wxWS_EX_VALIDATE_RECURSIVELY}
By default, Validate/TransferDataTo/FromWindow() only work on
direct children of the window (compatible behaviour). Set this flag
to make them recursively descend into all subwindows.
- @style{wxWS_EX_BLOCK_EVENTS}:
+ @style{wxWS_EX_BLOCK_EVENTS}
wxCommandEvents and the objects of the derived classes are
forwarded to the parent window and so on recursively by default.
Using this flag for the given window allows to block this
propagation at this window, i.e. prevent the events from being
propagated further upwards. Dialogs have this flag on by default.
- @style{wxWS_EX_TRANSIENT}:
+ @style{wxWS_EX_TRANSIENT}
Don't use this window as an implicit parent for the other windows:
this must be used with transient windows as otherwise there is the
risk of creating a dialog/frame with this window as a parent which
would lead to a crash if the parent is destroyed before the child.
- @style{wxWS_EX_PROCESS_IDLE}:
+ @style{wxWS_EX_PROCESS_IDLE}
This window should always process idle events, even if the mode set
by wxIdleEvent::SetMode is wxIDLE_PROCESS_SPECIFIED.
- @style{wxWS_EX_PROCESS_UI_UPDATES}:
+ @style{wxWS_EX_PROCESS_UI_UPDATES}
This window should always process UI update events, even if the
mode set by wxUpdateUIEvent::SetMode is
wxUPDATE_UI_PROCESS_SPECIFIED.
Gets the size which best suits the window: for a control, it would be
the minimal size which doesn't truncate the control, for a panel - the
same size as it would have after a call to Fit().
+
+ The default implementation of this function is designed for use in container
+ windows, such as wxPanel, and works something like this:
+ -# If the window has a sizer then it is used to calculate the best size.
+ -# Otherwise if the window has layout constraints then those are used to
+ calculate the best size.
+ -# Otherwise if the window has children then the best size is set to be large
+ enough to show all the children.
+ -# Otherwise if there are no children then the window's minimal size will be
+ used as its best size.
+ -# Otherwise if there is no minimal size set, then the current size is used
+ for the best size.
+
+ @see @ref overview_windowsizing
*/
virtual wxSize DoGetBestSize() const;
wxWindow* parent = NULL);
/**
- Sizes the window so that it fits around its subwindows. This function won't do
- anything if there are no subwindows and will only really work correctly if
- sizers are used for the subwindows layout. Also, if the window has exactly one
- subwindow it is better (faster and the result is more precise as Fit adds some
- margin to account for fuzziness of its calculations) to call
+ Sizes the window so that it fits around its subwindows.
+
+ This function won't do anything if there are no subwindows and will only really
+ work correctly if sizers are used for the subwindows layout.
+
+ Also, if the window has exactly one subwindow it is better (faster and the result
+ is more precise as Fit() adds some margin to account for fuzziness of its calculations)
+ to call:
+
+ @begincode
+ window->SetClientSize(child->GetSize());
+ @endcode
+
+ instead of calling Fit().
- instead of calling Fit.
+ @see @ref overview_windowsizing
*/
virtual void Fit();
wxAccessible* GetAccessible();
/**
- This method is deprecated, use GetEffectiveMinSize()
- instead.
+ This method is deprecated, use GetEffectiveMinSize() instead.
*/
wxSize GetAdjustedBestSize() const;
ignore under other platforms. Under Mac, it will change the size of the
returned font. See SetWindowVariant()
for more about this.
- This static method is "overridden'' in many derived classes and so calling,
+ This static method is "overridden" in many derived classes and so calling,
for example, wxButton::GetClassDefaultAttributes() will typically
return the values appropriate for a button which will be normally different
from those returned by, say, wxListCtrl::GetClassDefaultAttributes().
the call is automatically dispatched to the correct class (as usual with
virtual functions) and you don't have to specify the class name explicitly.
The other one is that in the future this function could return different
- results, for example it might return a different font for an "Ok'' button
+ results, for example it might return a different font for an "Ok" button
than for a generic button if the users GUI is configured to show such buttons
in bold font. Of course, the down side is that it is impossible to call this
function without actually having an object to apply it to whereas the static
wxDropTarget* GetDropTarget() const;
/**
- Merges the window's best size into the min size and returns the
- result. This is the value used by sizers to determine the appropriate
+ Merges the window's best size into the min size and returns the result.
+ This is the value used by sizers to determine the appropriate
ammount of space to allocate for the widget.
- @see GetBestSize(), SetInitialSize()
+ @see GetBestSize(), SetInitialSize(), @ref overview_windowsizing
*/
wxSize GetEffectiveMinSize() 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
+ 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
/**
Invokes the constraint-based layout algorithm or the sizer-based algorithm
for this window.
- See SetAutoLayout(): when auto
- layout is on, this function gets called automatically when the window is
- resized.
+
+ See SetAutoLayout(): when auto layout is on, this function gets called automatically
+ when the window is resized.
+
+ @see @ref overview_windowsizing
*/
void Layout();
/**
A @e smart SetSize that will fill in default size components with the
- window's @e best size values. Also sets the window's minsize to
- the value passed in for use with sizers. This means that if a full or
- partial size is passed to this function then the sizers will use that
- size instead of the results of GetBestSize to determine the minimum
- needs of the window for layout.
+ window's @e best size values.
+
+ Also sets the window's minsize to the value passed in for use with sizers.
+ This means that if a full or partial size is passed to this function then
+ the sizers will use that size instead of the results of GetBestSize() to
+ determine the minimum needs of the window for layout.
+
Most controls will use this to set their initial size, and their min
size to the passed in value (if any.)
- @see SetSize(), GetBestSize(), GetEffectiveMinSize()
+ @see SetSize(), GetBestSize(), GetEffectiveMinSize(),
+ @ref overview_windowsizing
*/
void SetInitialSize(const wxSize& size = wxDefaultSize);