wxtoplevelwindowwxtoplevelwindow is a common base class for wxdialog and wxframe. it is an abstract base class meaning that you never work with objects of this class directly, but all of its methods are also applicable for the two classes above. derived from
wxwindow include files <wx/toplevel.h> members
wxtoplevelwindow::cansettransparent
wxtoplevelwindow::cansettransparentvirtual bool cansettransparent() returns true if the platform supports making the window translucent. see also wxtoplevelwindow::settransparent
wxtoplevelwindow::enableclosebuttonbool enableclosebutton(bool enable = true) enables or disables the close button (most often in the right upper corner of a dialog) and the close entry of the system menu (most often in the left upper corner of the dialog). currently only implemented for wxmsw and wxgtk. returns true if operation was successful. this may be wrong on x11 (including gtk+) where the window manager may not support this operation and there is no way to find out.
wxtoplevelwindow::getdefaultitemwxwindow * getdefaultitem() const returns a pointer to the button which is the default for this window, or null. the default button is the one activated by pressing the enter key.
wxtoplevelwindow::geticonconst wxicon& geticon() const returns the standard icon of the window. the icon will be invalid if it hadn't been previously set by seticon. see also
wxtoplevelwindow::geticonsconst wxiconbundle& geticons() const returns all icons associated with the window, there will be none of them if neither seticon nor seticons had been called before. use geticon to get the main icon of the window. see also
wxtoplevelwindow::gettitlewxstring gettitle() const gets a string containing the window title. see also
wxtoplevelwindow::handlesettingchangevirtual bool handlesettingchange(wxwparam wparam, wxlparam lparam) unique to the wxwince port. responds to showing/hiding sip (soft input panel) area and resize window accordingly. override this if you want to avoid resizing or do additional operations.
wxtoplevelwindow::isactivebool isactive() const returns true if this window is currently active, i.e. if the user is currently working with it.
wxtoplevelwindow::isalwaysmaximizedvirtual bool isalwaysmaximized() const returns true if this window is expected to be always maximized, either due to platform policy or due to local policy regarding particular class.
wxtoplevelwindow::iconizevoid iconize(bool iconize) iconizes or restores the window. parameters iconize
see also wxtoplevelwindow::isiconized, wxtoplevelwindow::maximize.
wxtoplevelwindow::isfullscreenbool isfullscreen() returns true if the window is in fullscreen mode. see also wxtoplevelwindow::showfullscreen
wxtoplevelwindow::isiconizedbool isiconized() const returns true if the window is iconized.
wxtoplevelwindow::ismaximizedbool ismaximized() const returns true if the window is maximized.
wxtoplevelwindow::isusingnativedecorationsbool isusingnativedecorations() const this method is specific to wxuniversal port returns true if this window is using native decorations, false if we draw them ourselves. see also
usenativedecorations,
wxtoplevelwindow::maximizevoid maximize(bool maximize) maximizes or restores the window. parameters maximize
see also
wxtoplevelwindow::requestuserattentionvoid requestuserattention(int flags = wxuser_attention_info) use a system-dependent way to attract users attention to the window when it is in background. flags may have the value of either wxuser_attention_info (default) or wxuser_attention_error which results in a more drastic action. when in doubt, use the default value. note that this function should normally be only used when the application is not already in foreground. this function is currently implemented for win32 where it flashes the window icon in the taskbar, and for wxgtk with task bars supporting it.
wxtoplevelwindow::setdefaultitemvoid setdefaultitem(wxwindow *win) changes the default item for the panel, usually win is a button. see also
wxtoplevelwindow::seticonvoid seticon(const wxicon& icon) sets the icon for this window. parameters icon
remarks the window takes a 'copy' of icon, but since it uses reference counting, the copy is very quick. it is safe to delete icon after calling this function. see also wxicon.
wxtoplevelwindow::seticonsvoid seticons(const wxiconbundle& icons) sets several icons of different sizes for this window: this allows to use different icons for different situations (e.g. task switching bar, taskbar, window title bar) instead of scaling, with possibly bad looking results, the only icon set by seticon. parameters icons
see also
wxtoplevelwindow::setleftmenuvoid setleftmenu(int id = wxid_any, const wxstring& label = wxemptystring, wxmenu * submenu = null) sets action or menu activated by pressing left hardware button on the smart phones. unavailable on full keyboard machines. parameters id
label
submenu
see also wxtoplevelwindow::setrightmenu.
wxtoplevelwindow::setmaxsizevoid setmaxsize(const wxsize& size) a simpler interface for setting the size hints than setsizehints.
wxtoplevelwindow::setminsizevoid setminsize(const wxsize& size) a simpler interface for setting the size hints than setsizehints.
wxtoplevelwindow::setsizehintsvirtual void setsizehints(int minw, int minh, int maxw=-1, int maxh=-1, int incw=-1, int inch=-1) void setsizehints(const wxsize& minsize, const wxsize& maxsize=wxdefaultsize, const wxsize& incsize=wxdefaultsize) 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 default values will be used. incw
inch
incsize
remarks if this function is called, the user will not be able to size the window outside the given bounds. the resizing increments are only significant under motif or xt.
wxtoplevelwindow::setrightmenuvoid setrightmenu(int id = wxid_any, const wxstring& label = wxemptystring, wxmenu * submenu = null) sets action or menu activated by pressing right hardware button on the smart phones. unavailable on full keyboard machines. parameters id
label
submenu
see also wxtoplevelwindow::setleftmenu.
wxtoplevelwindow::setshapebool setshape(const wxregion& region) if the platform supports it, sets the shape of the window to that depicted by region. the system will not display or respond to any mouse event for the pixels that lie outside of the region. to reset the window to the normal rectangular shape simply call setshape again with an empty region. returns true if the operation is successful.
wxtoplevelwindow::settitlevirtual void settitle(const wxstring& title) sets the window title. parameters title
see also
wxtoplevelwindow::settransparentvirtual bool settransparent(int alpha) if the platform supports it will set the window to be translucent parameters alpha
returns true if the transparency was successfully changed.
wxtoplevelwindow::shouldpreventappexitvirtual bool shouldpreventappexit() const this virtual function is not meant to be called directly but can be overridden to return false (it returns true by default) to allow the application to close even if this, presumably not very important, window is still opened. by default, the application stays alive as long as there are any open top level windows.
wxtoplevelwindow::showfullscreenbool showfullscreen(bool show, long style = wxfullscreen_all) depending on the value of show parameter the window is either shown full screen or restored to its normal state. style is a bit list containing some or all of the following values, which indicate what elements of the window to hide in full-screen mode:
this function has not been tested with mdi frames. note that showing a window full screen also actually show()s if it hadn't been shown yet. see also wxtoplevelwindow::isfullscreen
wxtoplevelwindow::usenativedecorationsvoid usenativedecorations(bool native = true) this method is specific to wxuniversal port use native or custom-drawn decorations for this window only. notice that to have any effect this method must be called before really creating the window, i.e. two step creation must be used: myframe *frame = new myframe; // use default ctor frame->usenativedecorations(false); // change from default "true" frame->create(parent, title, ...); // really create the framesee also
usenativedecorationsbydefault,
wxtoplevelwindow::usenativedecorationsbydefaultvoid usenativedecorationsbydefault(bool native = true) this method is specific to wxuniversal port top level windows in wxuniversal port can use either system-provided window decorations (i.e. title bar and various icons, buttons and menus in it) or draw the decorations themselves. by default the system decorations are used if they are available, but this method can be called with native set to false to change this for all windows created after this point. also note that if wxdecor environment variable is set, then custom decorations are used by default and so it may make sense to call this method with default argument if the application can't use custom decorations at all for some reason. see also
|