X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/adaaa68635b4c8a4d8c5284add40366ea3eefb07..89a7e1ff98e58687eef2bf8ec94bf7190208167f:/interface/wx/toplevel.h?ds=sidebyside diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index 4dcac9e2e3..acb79b1c72 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -42,6 +42,25 @@ enum directly, but all of its methods are also applicable for the two classes above. + Note that the instances of wxTopLevelWindow are managed by wxWidgets in the + internal top level window list. + + @beginEventEmissionTable + @event{EVT_ACTIVATE(id, func)} + Process a @c wxEVT_MAXIMIZE event. See wxMaximizeEvent. + @event{EVT_MOVE(func)} + Process a @c wxEVT_MOVE event, which is generated when a window is moved. + See wxMoveEvent. + @event{EVT_MOVE_START(func)} + Process a @c wxEVT_MOVE_START event, which is generated when the user starts + to move or size a window. wxMSW only. + See wxMoveEvent. + @event{EVT_MOVE_END(func)} + Process a @c wxEVT_MOVE_END event, which is generated when the user stops + moving or sizing a window. wxMSW only. + See wxMoveEvent. + @endEventTable + @library{wxcore} @category{managedwnd} @@ -50,6 +69,42 @@ enum class wxTopLevelWindow : public wxWindow { public: + /** + Default ctor. + */ + wxTopLevelWindow(); + + /** + Constructor creating the top level window. + */ + wxTopLevelWindow(wxWindow *parent, + wxWindowID winid, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + + /** + Destructor. Remember that wxTopLevelWindows do not get immediately + destroyed when the user (or the app) closes them; they have a + @b delayed destruction. + + See @ref overview_windowdeletion for more info. + */ + virtual ~wxTopLevelWindow(); + + /** + Creates the top level window. + */ + bool Create(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + /** Returns @true if the platform supports making the window translucent. @@ -84,7 +139,7 @@ public: (including GTK+) where the window manager may not support this operation and there is no way to find out. */ - bool EnableCloseButton(bool enable = true); + virtual bool EnableCloseButton(bool enable = true); /** Returns a pointer to the button which is the default for this window, or @@ -99,7 +154,7 @@ public: @see GetIcons() */ - const wxIcon GetIcon() const; + wxIcon GetIcon() const; /** Returns all icons associated with the window, there will be none of them @@ -108,14 +163,14 @@ public: @see wxIconBundle */ - const wxIconBundle GetIcons() const; + const wxIconBundle& GetIcons() const; /** Gets a string containing the window title. @see SetTitle() */ - wxString GetTitle() const; + virtual wxString GetTitle() const; /** Unique to the wxWinCE port. Responds to showing/hiding SIP (soft input @@ -133,7 +188,7 @@ public: @see IsIconized(), Maximize(), wxIconizeEvent. */ - void Iconize(bool iconize); + virtual void Iconize(bool iconize = true); /** Returns @true if this window is currently active, i.e. if the user is @@ -153,17 +208,17 @@ public: @see ShowFullScreen() */ - bool IsFullScreen(); + virtual bool IsFullScreen() const; /** Returns @true if the window is iconized. */ - bool IsIconized() const; + virtual bool IsIconized() const; /** Returns @true if the window is maximized. */ - bool IsMaximized() const; + virtual bool IsMaximized() const; /** This method is specific to wxUniversal port. @@ -176,6 +231,12 @@ public: */ bool IsUsingNativeDecorations() const; + /** + See wxWindow::SetAutoLayout(): when auto layout is on, this function gets + called automatically when the window is resized. + */ + virtual bool Layout(); + /** Maximizes or restores the window. @@ -184,7 +245,7 @@ public: @see Iconize() */ - void Maximize(bool maximize); + virtual void Maximize(bool maximize = true); /** Use a system-dependent way to attract users attention to the window when @@ -210,7 +271,7 @@ public: @see GetDefaultItem() */ - void SetDefaultItem(wxWindow* win); + wxWindow* SetDefaultItem(wxWindow* win); /** Sets the icon for this window. @@ -222,7 +283,9 @@ public: reference counting, the copy is very quick. It is safe to delete @a icon after calling this function. - @see wxIcon + @note In wxMSW, @a icon must be either 16x16 or 32x32 icon. + + @see wxIcon, SetIcons() */ void SetIcon(const wxIcon& icon); @@ -235,7 +298,10 @@ public: @param icons The icons to associate with this window. - @see wxIconBundle. + @note In wxMSW, @a icons must contain a 16x16 or 32x32 icon, + preferably both. + + @see wxIconBundle */ virtual void SetIcons(const wxIconBundle& icons); @@ -275,7 +341,7 @@ public: Identifier for this button. @param label Text to be displayed on the screen area dedicated to this hardware - button. + button. @param subMenu The menu to be opened after pressing this hardware button. @@ -299,6 +365,14 @@ public: size increments. If a pair of values is not set (or set to -1), no constraints will be used. + @param minW + The minimum width. + @param minH + The minimum height. + @param maxW + The maximum width. + @param maxH + The maximum height. @param incW Specifies the increment for sizing the width (GTK/Motif/Xt only). @param incH @@ -310,16 +384,19 @@ public: wxWindow::SetSize(). */ - virtual void SetSizeHints(int minW, int minH, int maxW = -1, - int maxH = -1, - int incW = -1, - int incH = -1); + virtual void SetSizeHints(int minW, int minH, + int maxW = -1, int maxH = -1, + int incW = -1, int incH = -1); /** Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), no constraints will be used. + @param minSize + The minimum size of the window. + @param maxSize + The maximum size of the window. @param incSize Increment size (only taken into account under X11-based ports such as wxGTK/wxMotif/wxX11). @@ -352,7 +429,7 @@ public: fully transparent, and a value of 255 sets the window to be fully opaque. */ - virtual bool SetTransparent(int alpha); + virtual bool SetTransparent(wxByte alpha); /** This virtual function is not meant to be called directly but can be @@ -383,7 +460,7 @@ public: @see IsFullScreen() */ - bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); + virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); /** This method is specific to wxUniversal port. @@ -417,7 +494,7 @@ public: 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 UseNativeDecorations() */ void UseNativeDecorationsByDefault(bool native = true);