Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

dockpanel.h

Go to the documentation of this file.
00001 
00002 // Name:        wx/dockpanel.h
00003 // Purpose:     wxDockPanel class
00004 // Author:      Mark McCormack
00005 // Modified by:
00006 // Created:     23/02/04
00007 // RCS-ID:      $Id: dockpanel.h,v 1.9 2005/05/12 14:02:29 frm Exp $
00008 // Copyright:   (c) 2004 Mark McCormack
00009 // Licence:     wxWindows licence
00011 
00012 #ifndef _WX_DOCKPANEL_H_
00013 #define _WX_DOCKPANEL_H_
00014 
00015 // ----------------------------------------------------------------------------
00016 // headers
00017 // ----------------------------------------------------------------------------
00018 
00019 #include <wx/defs.h>
00020 #include <wx/panel.h>
00021 
00022 #include <wx/layoutmanager.h>
00023 #include <wx/gdi.h>
00024 
00025 #include "wx/export.h"
00026 
00027 class wxDockWindowBase;
00028 class wxDockHost;
00029 class wxBoxSizer;
00030 class wxPaneEvent;
00031 class wxPane;
00032 class wxToolButton;
00033 class wxGripWindow;
00034 
00035 // ----------------------------------------------------------------------------
00036 // wxDockPanel
00037 // ----------------------------------------------------------------------------
00038 
00039 #define wxDPC_NO_CONTROLS   0x0001
00040 #define wxDPC_DEFAULT       0x0000
00041 
00042 class WXDLLIMPEXP_DI wxDockPanel : public wxPanel
00043 {
00044     DECLARE_DYNAMIC_CLASS( wxDockPanel )
00045     DECLARE_EVENT_TABLE()
00046 
00047 public:
00048     wxDockPanel() {
00049         Init();
00050     }
00051     void Init();
00052     
00053     wxDockPanel( wxWindow *parent, wxWindowID id, 
00054   const wxString& name = wxT("dockpanel"), 
00055   unsigned int flags = wxDPC_DEFAULT ) 
00056  {
00057         Init();
00058         Create( parent, id, name, flags );
00059     }
00060     
00061     // basic interface
00062     bool Create( wxWindow * parent, wxWindowID id,
00063   const wxString& name = wxT("dockpanel"), 
00064   unsigned int flags = wxDPC_DEFAULT );
00065 
00066     void UpdateSize();
00067     
00068     void SetDockWindow( wxDockWindowBase * pOwner );
00069     wxDockWindowBase * GetDockWindow();
00070     
00071     void SetDockedHost( wxDockHost * pDockHost );
00072     wxDockHost * GetDockedHost();
00073     
00074     void SetClient( wxWindow * pClient, bool autoPane = false );
00075     wxWindow * GetClient();
00076 
00077     void AutoFitSingleChild();
00078     
00079     // access
00080     wxOrientation GetOrientation();
00081     wxRect GetScreenArea();
00082     wxRect GetScreenArea( wxHostInfo &hi );
00083     wxPlacement TestForPlacement( int sx, int sy );
00084     
00085     int GetArea();
00086     void SetArea( int area );
00087     void LockAreaValue( bool state );
00088     
00089     bool IsDocked();
00090     
00091     // event handlers
00092     void OnSize( wxSizeEvent& event );
00093     void OnPaneClose( wxCommandEvent& event );
00094     void OnGripDblClick( wxMouseEvent& event );
00095     void OnGripLeftDown( wxMouseEvent& event );
00096     void OnGripLeftUp( wxMouseEvent& event );
00097 #ifdef __WXGTK__    
00098  void OnMouseMove( wxMouseEvent& event );
00099     void OnLeftUp( wxMouseEvent& event );
00100 #endif 
00101 
00102 private:
00103     void childUpdate();
00104 
00105 private:
00106     unsigned int flags_;
00107 
00108     bool docked_;           // are we docked?
00109     bool mouseCaptured_;
00110 
00111     wxGripWindow * pGripWindow_;   // the grip window
00112     wxToolButton * pCloseButton_;  // the close button
00113     
00114     wxWindow * pClient_;           // the actual user area
00115     wxWindow * pStockClient_;      // the initial user area (default)
00116     wxPane * pPane_;               // pane client (only if client is a pane)
00117     wxBoxSizer * pClientSizer_;    // the sizer for the client panel
00118     
00119     wxDockWindowBase * pDockWindow_; // our dock window
00120     wxDockHost * pDockHost_;    // the host (when docked)
00121 
00122     int area_;
00123     bool lockAreaValue_;
00124 };
00125 #endif
00126     // _WX_DOCKPANEL_H_

Generated on Sat May 14 14:54:39 2005 for wxDockIt by  doxygen 1.4.2