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 WXDLLEXPORT 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
49 virtual void Maximize(bool maximize
= true);
50 virtual bool IsMaximized() const;
51 virtual void Iconize(bool iconize
= true);
52 virtual bool IsIconized() const;
53 virtual void SetIcon(const wxIcon
& icon
);
54 virtual void SetIcons(const wxIconBundle
& icons
);
55 virtual void Restore();
58 virtual bool SetShape(const wxRegion
& region
);
61 virtual bool Show(bool show
= true);
63 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
64 virtual bool IsFullScreen() const { return m_fsIsShowing
; }
66 // wxPalm only: EnableCloseButton(false) may be used to remove the "Close"
67 // button from the title bar
68 bool EnableCloseButton(bool enable
= true);
70 // implementation from now on
71 // --------------------------
74 void OnActivate(wxActivateEvent
& event
);
76 // called by wxWindow whenever it gets focus
77 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
78 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
80 // interface to native frame structure
81 WXFORMPTR
GetForm() const;
83 // handle native events
84 bool HandleControlSelect(WXEVENTPTR event
);
85 bool HandleControlRepeat(WXEVENTPTR event
);
86 bool HandleSize(WXEVENTPTR event
);
88 virtual WXWINHANDLE
GetWinHandle() const;
91 // common part of all ctors
94 // getting and setting sizes
95 virtual void DoGetSize( int *width
, int *height
) const;
97 // common part of Iconize(), Maximize() and Restore()
98 void DoShowWindow(int nShowCmd
);
100 // translate wxWidgets flags to Windows ones
101 virtual WXDWORD
PalmGetStyle(long flags
, WXDWORD
*exstyle
) const;
103 // is the window currently iconized?
106 // should the frame be maximized when it will be shown? set by Maximize()
107 // when it is called while the frame is hidden
108 bool m_maximizeOnShow
;
110 // Data to save/restore when calling ShowFullScreen
111 long m_fsStyle
; // Passed to ShowFullScreen
113 long m_fsOldWindowStyle
;
114 bool m_fsIsMaximized
;
117 // the last focused child: we restore focus to it on activation
118 wxWindow
*m_winLastFocused
;
120 DECLARE_EVENT_TABLE()
121 DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm
)
124 #endif // _WX_PALMOS_TOPLEVEL_H_