1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/toplevel.h
3 // Purpose: wxTopLevelWindow
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALMOS_TOPLEVEL_H_
13 #define _WX_PALMOS_TOPLEVEL_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "toplevel.h"
23 // ----------------------------------------------------------------------------
24 // wxTopLevelWindowPalm
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxTopLevelWindowPalm
: public wxTopLevelWindowBase
30 // constructors and such
31 wxTopLevelWindowPalm() { Init(); }
33 wxTopLevelWindowPalm(wxWindow
*parent
,
35 const wxString
& title
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxDEFAULT_FRAME_STYLE
,
39 const wxString
& name
= wxFrameNameStr
)
43 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
46 bool Create(wxWindow
*parent
,
48 const wxString
& title
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
,
51 long style
= wxDEFAULT_FRAME_STYLE
,
52 const wxString
& name
= wxFrameNameStr
);
54 bool Create(wxWindow
*parent
,
56 const wxString
& title
,
63 virtual ~wxTopLevelWindowPalm();
65 // implement base class pure virtuals
66 virtual void Maximize(bool maximize
= TRUE
);
67 virtual bool IsMaximized() const;
68 virtual void Iconize(bool iconize
= TRUE
);
69 virtual bool IsIconized() const;
70 virtual void SetIcon(const wxIcon
& icon
);
71 virtual void SetIcons(const wxIconBundle
& icons
);
72 virtual void Restore();
75 virtual bool SetShape(const wxRegion
& region
);
78 virtual bool Show(bool show
= TRUE
);
80 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
81 virtual bool IsFullScreen() const { return m_fsIsShowing
; }
83 // wxPalm only: EnableCloseButton(FALSE) may be used to remove the "Close"
84 // button from the title bar
85 bool EnableCloseButton(bool enable
= TRUE
);
87 // implementation from now on
88 // --------------------------
91 void OnActivate(wxActivateEvent
& event
);
93 // called by wxWindow whenever it gets focus
94 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
95 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
98 // common part of all ctors
101 // create a new frame, return FALSE if it couldn't be created
102 bool CreateFrame(const wxString
& title
,
106 // create a new dialog using the given dialog template from resources,
107 // return FALSE if it couldn't be created
108 bool CreateDialog(const void *dlgTemplate
,
109 const wxString
& title
,
113 // common part of Iconize(), Maximize() and Restore()
114 void DoShowWindow(int nShowCmd
);
116 // translate wxWidgets flags to Windows ones
117 virtual WXDWORD
PalmGetStyle(long flags
, WXDWORD
*exstyle
) const;
119 // choose the right parent to use with CreateWindow()
120 virtual WXHWND
PalmGetParent() const;
122 // is the window currently iconized?
125 // should the frame be maximized when it will be shown? set by Maximize()
126 // when it is called while the frame is hidden
127 bool m_maximizeOnShow
;
129 // Data to save/restore when calling ShowFullScreen
130 long m_fsStyle
; // Passed to ShowFullScreen
132 long m_fsOldWindowStyle
;
133 bool m_fsIsMaximized
;
136 // the last focused child: we restore focus to it on activation
137 wxWindow
*m_winLastFocused
;
139 DECLARE_EVENT_TABLE()
140 DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm
)
143 static Boolean
FrameFormHandleEvent(EventType
* pEvent
);
145 #endif // _WX_PALMOS_TOPLEVEL_H_