+
+ // enable/disable close button [x]
+ virtual bool EnableCloseButton(bool WXUNUSED(enable) ) { return false; }
+
+ // Attracts the users attention to this window if the application is
+ // 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)?
+ //
+ // A TLW is active only if it contains the currently focused window.
+ virtual bool IsActive() { return IsDescendant(FindFocus()); }
+
+ // this function may be overridden to return false to allow closing the
+ // application even when this top level window is still open
+ //
+ // notice that the window is still closed prior to the application exit and
+ // so it can still veto it even if it returns false from here
+ virtual bool ShouldPreventAppExit() const { return true; }
+
+
+#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); }
+
+ // Get the default size for a new top level window. This is used when
+ // creating a wxTLW under some platforms if no explicit size given.
+ static wxSize GetDefaultSize();
+
+
+ // default item access: we have a permanent default item which is the one
+ // set by the user code but we may also have a temporary default item which
+ // would be chosen if the user pressed "Enter" now but the default action
+ // reverts to the "permanent" default as soon as this temporary default
+ // item loses focus
+
+ // get the default item, temporary or permanent
+ wxWindow *GetDefaultItem() const
+ { return m_winTmpDefault ? m_winTmpDefault : m_winDefault; }
+
+ // set the permanent default item, return the old default
+ wxWindow *SetDefaultItem(wxWindow *win)
+ { wxWindow *old = GetDefaultItem(); m_winDefault = win; return old; }
+
+ // return the temporary default item, can be NULL
+ wxWindow *GetTmpDefaultItem() const { return m_winTmpDefault; }
+
+ // set a temporary default item, SetTmpDefaultItem(NULL) should be called
+ // soon after a call to SetTmpDefaultItem(window), return the old default
+ wxWindow *SetTmpDefaultItem(wxWindow *win)
+ { wxWindow *old = GetDefaultItem(); m_winTmpDefault = win; return old; }
+
+
+ // implementation only from now on
+ // -------------------------------
+
+ // override some base class virtuals
+ virtual bool Destroy();
+ virtual bool IsTopLevel() const { return true; }
+ virtual bool IsTopNavigationDomain() const { return true; }
+ virtual bool IsVisible() const { return IsShown(); }
+
+ // event handlers
+ void OnCloseWindow(wxCloseEvent& 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
+ void OnActivate(wxActivateEvent &WXUNUSED(event)) { }
+
+ // do the window-specific processing after processing the update event
+ virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
+
+ // a different API for SetSizeHints
+ virtual void SetMinSize(const wxSize& minSize);
+ virtual void SetMaxSize(const wxSize& maxSize);
+
+ virtual void OSXSetModified(bool modified) { m_modified = modified; }
+ virtual bool OSXIsModified() const { return m_modified; }
+
+ virtual void SetRepresentedFilename(const wxString& WXUNUSED(filename)) { }
+
+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);
+
+ // no need to do client to screen translation to get our position in screen
+ // coordinates: this is already the case
+ virtual void DoGetScreenPosition(int *x, int *y) const
+ {
+ DoGetPosition(x, y);
+ }
+
+ // 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
+ { return false; }
+
+ // check if we should exit the program after deleting this window
+ bool IsLastBeforeExit() const;
+
+ // 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();
+
+ static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; }
+ static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; }
+
+
+ // the frame icon
+ wxIconBundle m_icons;
+
+ // a default window (usually a button) or NULL
+ wxWindowRef m_winDefault;
+
+ // a temporary override of m_winDefault, use the latter if NULL
+ wxWindowRef m_winTmpDefault;
+
+ bool m_modified;
+
+ wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase);
+ DECLARE_EVENT_TABLE()