]>
Commit | Line | Data |
---|---|---|
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 | |
6 | // Created: 10/13/04 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) William Osborne, Wlodzimierz Skiba | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PALMOS_TOPLEVEL_H_ | |
13 | #define _WX_PALMOS_TOPLEVEL_H_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // wxTopLevelWindowPalm | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | class WXDLLEXPORT wxTopLevelWindowPalm : public wxTopLevelWindowBase | |
20 | { | |
21 | public: | |
22 | // constructors and such | |
23 | wxTopLevelWindowPalm() { Init(); } | |
24 | ||
25 | wxTopLevelWindowPalm(wxWindow *parent, | |
26 | wxWindowID id, | |
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) | |
32 | { | |
33 | Init(); | |
34 | ||
35 | (void)Create(parent, id, title, pos, size, style, name); | |
36 | } | |
37 | ||
38 | bool Create(wxWindow *parent, | |
39 | wxWindowID id, | |
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); | |
45 | ||
46 | virtual ~wxTopLevelWindowPalm(); | |
47 | ||
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(); | |
56 | ||
57 | #ifndef __WXWINCE__ | |
58 | virtual bool SetShape(const wxRegion& region); | |
59 | #endif // __WXWINCE__ | |
60 | ||
61 | virtual bool Show(bool show = true); | |
62 | ||
63 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); | |
64 | virtual bool IsFullScreen() const { return m_fsIsShowing; } | |
65 | ||
66 | // wxPalm only: EnableCloseButton(false) may be used to remove the "Close" | |
67 | // button from the title bar | |
68 | bool EnableCloseButton(bool enable = true); | |
69 | ||
70 | // implementation from now on | |
71 | // -------------------------- | |
72 | ||
73 | // event handlers | |
74 | void OnActivate(wxActivateEvent& event); | |
75 | ||
76 | // called by wxWindow whenever it gets focus | |
77 | void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } | |
78 | wxWindow *GetLastFocus() const { return m_winLastFocused; } | |
79 | ||
80 | // interface to native frame structure | |
81 | WXFORMPTR GetForm() const; | |
82 | ||
83 | // handle native events | |
84 | bool HandleControlSelect(WXEVENTPTR event); | |
85 | bool HandleControlRepeat(WXEVENTPTR event); | |
86 | bool HandleSize(WXEVENTPTR event); | |
87 | ||
88 | virtual WXWINHANDLE GetWinHandle() const; | |
89 | ||
90 | protected: | |
91 | // common part of all ctors | |
92 | void Init(); | |
93 | ||
94 | // getting and setting sizes | |
95 | virtual void DoGetSize( int *width, int *height ) const; | |
96 | ||
97 | // common part of Iconize(), Maximize() and Restore() | |
98 | void DoShowWindow(int nShowCmd); | |
99 | ||
100 | // translate wxWidgets flags to Windows ones | |
101 | virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const; | |
102 | ||
103 | // is the window currently iconized? | |
104 | bool m_iconized; | |
105 | ||
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; | |
109 | ||
110 | // Data to save/restore when calling ShowFullScreen | |
111 | long m_fsStyle; // Passed to ShowFullScreen | |
112 | wxRect m_fsOldSize; | |
113 | long m_fsOldWindowStyle; | |
114 | bool m_fsIsMaximized; | |
115 | bool m_fsIsShowing; | |
116 | ||
117 | // the last focused child: we restore focus to it on activation | |
118 | wxWindow *m_winLastFocused; | |
119 | ||
120 | DECLARE_EVENT_TABLE() | |
121 | DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm) | |
122 | }; | |
123 | ||
124 | #endif // _WX_PALMOS_TOPLEVEL_H_ | |
125 |