1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/toplevel.h
3 // Purpose: wxTopLevelWindow
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - more than minimal functionality
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALMOS_TOPLEVEL_H_
13 #define _WX_PALMOS_TOPLEVEL_H_
15 // ----------------------------------------------------------------------------
16 // wxTopLevelWindowPalm
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxTopLevelWindowPalm
: public wxTopLevelWindowBase
22 // constructors and such
23 wxTopLevelWindowPalm() { Init(); }
25 wxTopLevelWindowPalm(wxWindow
*parent
,
27 const wxString
& title
,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
,
30 long style
= wxDEFAULT_FRAME_STYLE
,
31 const wxString
& name
= wxFrameNameStr
)
35 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
38 bool Create(wxWindow
*parent
,
40 const wxString
& title
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 long style
= wxDEFAULT_FRAME_STYLE
,
44 const wxString
& name
= wxFrameNameStr
);
46 virtual ~wxTopLevelWindowPalm();
48 // implement base class pure virtuals
50 virtual void SetTitle( const wxString
& title
);
51 virtual wxString
GetTitle() const;
53 virtual void Maximize(bool maximize
= true);
54 virtual bool IsMaximized() const;
55 virtual void Iconize(bool iconize
= true);
56 virtual bool IsIconized() const;
57 virtual void SetIcons(const wxIconBundle
& icons
);
58 virtual void Restore();
61 virtual bool SetShape(const wxRegion
& region
);
64 virtual bool Show(bool show
= true);
66 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
67 virtual bool IsFullScreen() const { return m_fsIsShowing
; }
69 // wxPalm only: EnableCloseButton(false) may be used to remove the "Close"
70 // button from the title bar
71 bool EnableCloseButton(bool enable
= true);
73 // implementation from now on
74 // --------------------------
77 void OnActivate(wxActivateEvent
& event
);
79 // called by wxWindow whenever it gets focus
80 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
81 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
83 // interface to native frame structure
84 WXFORMPTR
GetForm() const;
86 // handle native events
87 bool HandleControlSelect(WXEVENTPTR event
);
88 bool HandleControlRepeat(WXEVENTPTR event
);
89 bool HandleSize(WXEVENTPTR event
);
91 virtual WXWINHANDLE
GetWinHandle() const;
94 // common part of all ctors
97 // getting and setting sizes
98 virtual void DoGetSize( int *width
, int *height
) const;
100 // common part of Iconize(), Maximize() and Restore()
101 void DoShowWindow(int nShowCmd
);
103 // translate wxWidgets flags to Windows ones
104 virtual WXDWORD
PalmGetStyle(long flags
, WXDWORD
*exstyle
) const;
106 // is the window currently iconized?
109 // should the frame be maximized when it will be shown? set by Maximize()
110 // when it is called while the frame is hidden
111 bool m_maximizeOnShow
;
113 // Data to save/restore when calling ShowFullScreen
114 long m_fsStyle
; // Passed to ShowFullScreen
116 long m_fsOldWindowStyle
;
117 bool m_fsIsMaximized
;
120 // the last focused child: we restore focus to it on activation
121 wxWindow
*m_winLastFocused
;
123 DECLARE_EVENT_TABLE()
124 wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm
);
127 #endif // _WX_PALMOS_TOPLEVEL_H_