drawer.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/carbon/drawer.h
  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
  8. // Modified by:
  9. // Created: 2004-30-01
  10. // Copyright: (c) Jason Bagley; Art & Logic, Inc.
  11. // Licence: wxWindows licence
  12. /////////////////////////////////////////////////////////////////////////////
  13. #ifndef _WX_DRAWERWINDOW_H_
  14. #define _WX_DRAWERWINDOW_H_
  15. #include "wx/toplevel.h"
  16. //
  17. // NB: This is currently a private undocumented class -
  18. // it is stable, but the API is not and will change in the
  19. // near future
  20. //
  21. class WXDLLIMPEXP_ADV wxDrawerWindow : public wxTopLevelWindow
  22. {
  23. DECLARE_DYNAMIC_CLASS(wxDrawerWindow)
  24. public:
  25. wxDrawerWindow();
  26. wxDrawerWindow(wxWindow* parent,
  27. wxWindowID id,
  28. const wxString& title,
  29. wxSize size = wxDefaultSize,
  30. wxDirection edge = wxLEFT,
  31. const wxString& name = wxT("drawerwindow"))
  32. {
  33. this->Create(parent, id, title, size, edge, name);
  34. }
  35. virtual ~wxDrawerWindow();
  36. // Create a drawer window.
  37. // If parent is NULL, create as a tool window.
  38. // If parent is not NULL, then wxTopLevelWindow::Attach this window to parent.
  39. bool Create(wxWindow *parent,
  40. wxWindowID id,
  41. const wxString& title,
  42. wxSize size = wxDefaultSize,
  43. wxDirection edge = wxLEFT,
  44. const wxString& name = wxFrameNameStr);
  45. bool Open(bool show = true); // open or close the drawer, possibility for async param, i.e. animate
  46. bool Close() { return this->Open(false); }
  47. bool IsOpen() const;
  48. // Set the edge of the parent where the drawer attaches.
  49. bool SetPreferredEdge(wxDirection edge);
  50. wxDirection GetPreferredEdge() const;
  51. wxDirection GetCurrentEdge() const; // not necessarily the preferred, due to screen constraints
  52. };
  53. #endif // _WX_DRAWERWINDOW_H_