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

barholder.h

Go to the documentation of this file.
00001 
00002 // Name:        wx/wxbarholder.h
00003 // Purpose:     wxBarHolder class
00004 // Author:      Mark McCormack
00005 // Modified by:
00006 // Created:     25/05/05
00007 // RCS-ID:      $Id: barholder.h,v 1.10 2005/05/12 14:02:28 frm Exp $      $Id: barholder.h,v 1.10 2005/05/12 14:02:28 frm Exp $
00008 // Copyright:   (c) 2004 Mark McCormack
00009 // Licence:     wxWindows licence
00011 
00012 #ifndef _WX_BARHOLDER_H_
00013 #define _WX_BARHOLDER_H_
00014 
00015 // wx includes
00016 #include <wx/menu.h>
00017 #include <wx/toolbar.h>
00018 #include <wx/frame.h>
00019 #include <wx/laywin.h>
00020 #include "wx/export.h"  // our export macros for shared builds
00021 
00022 class wxGripWindow;
00023 class wxSlideBar;
00024 
00025 #define wxBF_EXPAND_X   0x01
00026 #define wxBF_EXPAND_Y   0x02
00027 #define wxBF_DEFAULT    0x00
00028 
00029 
00030 // ----------------------------------------------------------------------------
00031 // wxBarHolder control
00032 // ----------------------------------------------------------------------------
00033 
00034 class WXDLLIMPEXP_DI wxBarHolder : public wxWindow
00035 {
00036 public:
00037     // Default constructor
00038     wxBarHolder() {
00039         Init();
00040     }
00041     
00042     // Normal constructor
00043  wxBarHolder::wxBarHolder( wxWindow *parent, wxWindowID id = -1, 
00044   const wxPoint& pos = wxDefaultPosition,
00045   const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, 
00046   const wxString& name = wxT("barholder") )
00047  {
00048         Init();
00049 
00050         Create(parent, id, pos, size, style, name);
00051     }
00052 
00053     void Init();
00054 
00055     bool Create( wxWindow *parent, wxWindowID id = -1, 
00056   const wxPoint& pos = wxDefaultPosition,
00057         const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, 
00058   const wxString& name = wxT("barholder") );
00059 
00060     virtual ~wxBarHolder();
00061 
00062     // interface
00063     void AddWindow( wxWindow * pWindow, const wxString & label = wxT(""), 
00064   unsigned int flags = wxBF_DEFAULT );
00065     void SetSlideBar( wxSlideBar * pSlideBar );
00066     void ShowGripper( bool state );
00067     void SetHeightOverride( int override );
00068     void SetWidthOverride( int override );
00069     void SetFlags( unsigned int flags );
00070     unsigned int GetFlags();
00071  wxString GetLabel();
00072 
00073     virtual wxSize DoGetBestSize() const;
00074     void UpdateSize();
00075 
00076     // event handlers
00077  void OnErase( wxEraseEvent &event );
00078     void OnPaint( wxPaintEvent &event );
00079     void OnGripBegin( wxMouseEvent &event );
00080     void OnGripEnd( wxMouseEvent &event );
00081     void OnGripMotion( wxMouseEvent &event );
00082  
00083 private:
00084     wxSize getNonClientSize() const;
00085     wxSize getClientBestSize( wxWindow * pClient ) const;
00086 
00087 private:
00088     wxSlideBar * pSlideBar_;
00089     wxWindow * pOurBar_;
00090     wxGripWindow * pGripWindow_;
00091  wxString label_;
00092 
00093     int margin_;
00094     int heightOverride_;
00095     int widthOverride_;
00096     bool showGripper_;
00097     unsigned int flags_;
00098     wxSize originalSize_;
00099     bool moving_;
00100 
00101 private:
00102     DECLARE_DYNAMIC_CLASS( wxBarHolder )
00103     DECLARE_EVENT_TABLE()
00104 };
00105 
00106 #endif
00107     // _WX_BARHOLDER_H_

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