00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef _WX_PANE_H_BASE_
00013 #define _WX_PANE_H_BASE_
00014
00015
00016
00017
00018
00019 #include <wx/panel.h>
00020 #include "wx/export.h"
00021
00022 class wxToolButton;
00023
00024
00025
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
00042 virtual bool Show( bool state = TRUE );
00043
00044
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
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;
00070 bool m_showClosebutton;
00071 bool m_visibilityOnParent;
00072 int m_headerSize;
00073 wxOrientation m_orientation;
00074
00075 wxSize m_toolButtonSize;
00076
00077 wxWindow * m_pClient;
00078 wxToolButton * m_pCloseButton;
00079 };
00080
00081
00082
00083
00084
00085 BEGIN_DECLARE_EVENT_TYPES()
00086 DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_PANE_CLOSED, wxEVT_FIRST + 1230)
00087 END_DECLARE_EVENT_TYPES()
00088
00089
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
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
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