1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Drawer child window class.
4 // Drawer windows appear under their parent window and
5 // behave like a drawer, opening and closing to reveal
6 // content that does not need to be visible at all times.
7 // Author: Jason Bagley
11 // Copyright: (c) Jason Bagley; Art & Logic, Inc.
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
15 #ifndef _WX_DRAWERWINDOW_H_
16 #define _WX_DRAWERWINDOW_H_
18 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19 #pragma interface "drawer.h"
22 #include "wx/toplevel.h"
24 #if ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
26 class WXDLLEXPORT wxDrawerWindow
: public wxTopLevelWindow
28 DECLARE_DYNAMIC_CLASS(wxDrawerWindow
)
34 wxDrawerWindow(wxWindow
* parent
,
36 const wxString
& title
,
37 wxSize size
= wxDefaultSize
,
38 wxDirection edge
= wxLEFT
,
39 const wxString
& name
= wxT("drawerwindow"))
41 this->Create(parent
, id
, title
, size
, edge
, name
);
46 // Create a drawer window.
47 // If parent is NULL, create as a tool window.
48 // If parent is not NULL, then wxTopLevelWindow::Attach this window to parent.
49 bool Create(wxWindow
*parent
,
51 const wxString
& title
,
52 wxSize size
= wxDefaultSize
,
53 wxDirection edge
= wxLEFT
,
54 const wxString
& name
= wxFrameNameStr
);
56 bool Open(bool show
= true); // open or close the drawer, possibility for async param, i.e. animate
57 bool Close() { return this->Open(false); }
60 // Set the edge of the parent where the drawer attaches.
61 bool SetPreferredEdge(wxDirection edge
);
62 wxDirection
GetPreferredEdge() const;
63 wxDirection
GetCurrentEdge() const; // not necessarily the preferred, due to screen constraints
66 #endif // defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
68 #endif // _WX_DRAWERWINDOW_H_