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

pane.h

Go to the documentation of this file.
00001 
00002 // Name:        wx/pane.h
00003 // Purpose:     wxPane class
00004 // Author:      Mark McCormack
00005 // Modified by:
00006 // Created:     28/12/03
00007 // RCS-ID:      $Id: pane.h,v 1.7 2005/05/12 14:02:29 frm Exp $
00008 // Copyright:   (c) 2004 Mark McCormack
00009 // Licence:     wxWindows licence
00011 
00012 #ifndef _WX_PANE_H_BASE_
00013 #define _WX_PANE_H_BASE_
00014 
00015 // ----------------------------------------------------------------------------
00016 // headers
00017 // ----------------------------------------------------------------------------
00018 
00019 #include <wx/panel.h>
00020 #include "wx/export.h"
00021 
00022 class wxToolButton;
00023 
00024 // ----------------------------------------------------------------------------
00025 // wxPane interface is defined by the class wxPaneBase
00026 // ----------------------------------------------------------------------------
00027 
00028 class WXDLLIMPEXP_DI wxPaneBase : public wxPanel
00029 {
00030     DECLARE_ABSTRACT_CLASS(wxPaneBase)
00031     DECLARE_EVENT_TABLE()
00032 
00033 public:
00034     virtual bool Create( wxWindow *parent, wxWindowID id = -1, 
00035   const wxString& name = wxT("pane"), 
00036   const wxPoint& pos = wxDefaultPosition,
00037         const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
00038     
00039     virtual void Init();
00040 
00041     // from wxWindow
00042     virtual bool Show( bool state = TRUE );
00043 
00044     // for wxPane
00045     void ShowHeader( bool state );
00046     void ShowCloseButton( bool state );
00047     void SetOrientation( wxOrientation orientation );
00048     void SetVisibilityOnParent( bool state );
00049 
00050     wxWindow * GetClient();
00051     virtual wxWindow * SetClient( wxWindow * pClient, 
00052   bool removeBorder = false );
00053 
00054 protected:
00055     void UpdateSize();
00056     void UpdateLayout( int w, int h );
00057 
00058     int GetHeaderSize();
00059     void CalcHeaderSize();
00060     const wxFont & GetTitleFont();
00061 
00062     // event handlers
00063     void OnSize( wxSizeEvent &event );
00064     void OnCloseButton( wxCommandEvent &event );
00065     void OnPaint( wxPaintEvent &event );
00066     void OnErase( wxEraseEvent &event );
00067 
00068 protected:
00069     bool m_showHeader;            // header visibility
00070     bool m_showClosebutton;       // close button visibility
00071     bool m_visibilityOnParent;    // parent responds to Show() rather than actual pane
00072     int m_headerSize;             // extent of header (for both horizontal and vertical)
00073     wxOrientation m_orientation;  // orientation of the pane header (horizontal is default)
00074     
00075     wxSize m_toolButtonSize;      // total button size
00076 
00077     wxWindow * m_pClient;          // the client window
00078     wxToolButton * m_pCloseButton; // the close button
00079 };
00080 
00081 // ----------------------------------------------------------------------------
00082 // wxPane event class
00083 // ----------------------------------------------------------------------------
00084 
00085 BEGIN_DECLARE_EVENT_TYPES()
00086     DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_PANE_CLOSED, wxEVT_FIRST + 1230)   // TODO: must change id
00087 END_DECLARE_EVENT_TYPES()
00088 
00089 // This should keep wxDockit compatible with wxWidgets 2.4.x
00090 #ifndef WXWIN_COMPATIBILITY_2_4
00091 #define EVT_PANE_CLOSED(fn) \
00092     DECLARE_EVENT_TABLE_ENTRY( wxEVT_PANE_CLOSED, -1, -1, \
00093   (wxObjectEventFunction) (wxEventFunction)  & fn, NULL ),
00094 #else
00095 // Patch for wxWidgets-2.5.4 compat submitted by Jesus Gonzalez (2005-03-02)
00096 typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
00097 #define EVT_PANE_CLOSED(fn) \
00098     DECLARE_EVENT_TABLE_ENTRY( wxEVT_PANE_CLOSED, -1, -1, \
00099   (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), NULL ),
00100 #endif
00101 
00102 // ----------------------------------------------------------------------------
00103 // include the platform-specific class declaration
00104 // ----------------------------------------------------------------------------
00105 
00106 #if defined(__WXMSW__)
00107     #include "wx/msw/pane.h"
00108 #elif defined(__WXGTK__)
00109  #include "wx/gtk/pane.h"
00110 #else
00111     #error "Your platform does not currently support wxPane"
00112 #endif
00113 
00114 #endif
00115     // _WX_PANE_H_BASE_

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