1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Top level window, abstraction of wxFrame and wxDialog
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __WX_UNIV_TOPLEVEL_H__
12 #define __WX_UNIV_TOPLEVEL_H__
15 #pragma interface "univtoplevel.h"
18 #include "wx/univ/inpcons.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 // frame decorations type flags used in wxRenderer and wxColourScheme
27 wxTOPLEVEL_BORDER
= 0x00000001,
28 wxTOPLEVEL_MAXIMIZED
= 0x00000002,
29 wxTOPLEVEL_TITLEBAR
= 0x00000004,
30 wxTOPLEVEL_RESIZEABLE
= 0x00000008,
31 wxTOPLEVEL_ICON
= 0x00000010,
32 wxTOPLEVEL_CLOSE_BUTTON
= 0x00000020,
33 wxTOPLEVEL_MAXIMIZE_BUTTON
= 0x00000040,
34 wxTOPLEVEL_MINIMIZE_BUTTON
= 0x00000080,
35 wxTOPLEVEL_RESTORE_BUTTON
= 0x00000100,
36 wxTOPLEVEL_HELP_BUTTON
= 0x00000200,
37 wxTOPLEVEL_ACTIVE
= 0x00000400
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 class WXDLLEXPORT wxTopLevelWindow
: public wxTopLevelWindowNative
48 wxTopLevelWindow() { Init(); }
49 wxTopLevelWindow(wxWindow
*parent
,
51 const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxDEFAULT_FRAME_STYLE
,
55 const wxString
& name
= wxFrameNameStr
)
59 Create(parent
, id
, title
, pos
, size
, style
, name
);
62 bool Create(wxWindow
*parent
,
64 const wxString
& title
,
65 const wxPoint
& pos
= wxDefaultPosition
,
66 const wxSize
& size
= wxDefaultSize
,
67 long style
= wxDEFAULT_FRAME_STYLE
,
68 const wxString
& name
= wxFrameNameStr
);
70 // implement base class pure virtuals
71 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
72 virtual wxPoint
GetClientAreaOrigin() const;
73 virtual void DoGetClientSize(int *width
, int *height
) const;
74 virtual void DoSetClientSize(int width
, int height
);
75 virtual void SetIcon(const wxIcon
& icon
);
77 // implementation from now on
78 // --------------------------
81 // common part of all ctors
84 // return wxTOPLEVEL_xxx combination based on current state of the frame
85 long GetDecorationsStyle() const;
87 DECLARE_DYNAMIC_CLASS(wxTopLevelWindow
)
89 void OnNcPaint(wxPaintEvent
& event
);
91 // TRUE if wxTLW should render decorations (aka titlebar) itself
92 static int ms_drawDecorations
;
93 // true for currently active frame
95 // version of icon for titlebar (16x16)
96 wxIcon m_titlebarIcon
;
100 #endif // __WX_UNIV_TOPLEVEL_H__