X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb719f2e29bd20effa3259d2d7dead9fd857442c..553f7d8f5608f18b99864cc36d46452d2e1ff05b:/include/wx/toplevel.h diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index cdabc86695..b1b2f3c7fd 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -14,10 +14,6 @@ #ifndef _WX_TOPLEVEL_BASE_H_ #define _WX_TOPLEVEL_BASE_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "toplevelbase.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -25,8 +21,8 @@ #include "wx/window.h" #include "wx/iconbndl.h" -// the default names for various classs -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; +// the default names for various classes +extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[]; class WXDLLEXPORT wxTopLevelWindowBase; @@ -71,7 +67,7 @@ class WXDLLEXPORT wxTopLevelWindowBase; #elif defined(__WINCE_STANDARDSDK__) #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX) #else - #define wxDEFAULT_FRAME_STYLE (0) + #define wxDEFAULT_FRAME_STYLE (wxNO_BORDER) #endif #else // !__WXWINCE__ #define wxDEFAULT_FRAME_STYLE \ @@ -158,13 +154,10 @@ public: // return true if the frame is in fullscreen mode virtual bool IsFullScreen() const = 0; - /* - for now we already have them in wxWindow, but this is wrong: these - methods really only make sense for wxTopLevelWindow! - + // the title of the top level window: the text which the + // window shows usually at the top of the frame/dialog in dedicated bar virtual void SetTitle(const wxString& title) = 0; virtual wxString GetTitle() const = 0; - */ // Set the shape of the window to the given region. // Returns true if the platform supports this feature (and the @@ -175,6 +168,19 @@ public: // inactive (should be called when a background event occurs) virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); + // Is this the active frame (highlighted in the taskbar)? + virtual bool IsActive() + { return (wxGetTopLevelParent(FindFocus()) == this); } + +#if defined(__SMARTPHONE__) + virtual void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL) = 0; + virtual void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL) = 0; +#endif // __SMARTPHONE__ + + // centre the window on screen: this is just a shortcut + void CentreOnScreen(int dir = wxBOTH) { DoCentre(dir | wxCENTRE_ON_SCREEN); } + void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } + // implementation only from now on // ------------------------------- @@ -186,7 +192,10 @@ public: // event handlers void OnCloseWindow(wxCloseEvent& event); - void OnSize(wxSizeEvent& event); + void OnSize(wxSizeEvent& WXUNUSED(event)) { DoLayout(); } + + // Get rect to be used to center top-level children + virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h); // this should go away, but for now it's called from docview.cpp, // so should be there for all platforms @@ -195,12 +204,27 @@ public: // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; + // Reserved for future use + virtual void ReservedTopLevelWindowFunc1() {} + virtual void ReservedTopLevelWindowFunc2() {} + virtual void ReservedTopLevelWindowFunc3() {} + virtual void ReservedTopLevelWindowFunc4() {} + virtual void ReservedTopLevelWindowFunc5() {} + virtual void ReservedTopLevelWindowFunc6() {} + virtual void ReservedTopLevelWindowFunc7() {} + virtual void ReservedTopLevelWindowFunc8() {} + virtual void ReservedTopLevelWindowFunc9() {} + protected: // the frame client to screen translation should take account of the // toolbar which may shift the origin of the client area virtual void DoClientToScreen(int *x, int *y) const; virtual void DoScreenToClient(int *x, int *y) const; + // add support for wxCENTRE_ON_SCREEN + virtual void DoCentre(int dir); + + // test whether this window makes part of the frame // (menubar, toolbar and statusbar are excluded from automatic layout) virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const @@ -213,6 +237,10 @@ protected: // send the iconize event, return true if processed bool SendIconizeEvent(bool iconized = true); + // do TLW-specific layout: we resize our unique child to fill the entire + // client area + void DoLayout(); + // Get the default size for the new window if no explicit size given. If // there are better default sizes then these can be changed, just as long // as they are not too small for TLWs (and not larger than screen). @@ -229,12 +257,18 @@ protected: // include the real class declaration -#if defined(__WXMSW__) +#if defined(__WXPALMOS__) + #include "wx/palmos/toplevel.h" + #define wxTopLevelWindowNative wxTopLevelWindowPalm +#elif defined(__WXMSW__) #include "wx/msw/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMSW -#elif defined(__WXGTK__) +#elif defined(__WXGTK20__) #include "wx/gtk/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowGTK +#elif defined(__WXGTK__) + #include "wx/gtk1/toplevel.h" + #define wxTopLevelWindowNative wxTopLevelWindowGTK #elif defined(__WXX11__) #include "wx/x11/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowX11