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

gripper.h

Go to the documentation of this file.
00001 
00002 // Name:        wx/gripper.h
00003 // Purpose:     wxGripperWindow class
00004 // Author:      Mark McCormack
00005 // Modified by:
00006 // Created:     23/02/04
00007 // RCS-ID:      $Id: gripper.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_GRIPPER_H_
00013 #define _WX_GRIPPER_H_
00014 
00015 // ----------------------------------------------------------------------------
00016 // headers
00017 // ----------------------------------------------------------------------------
00018 
00019 #include <wx/gdi.h>
00020 
00021 #include "wx/export.h"
00022 
00023 // ----------------------------------------------------------------------------
00024 // wxGripWindow
00025 // ----------------------------------------------------------------------------
00026 
00027 class wxGripWindow : public wxWindow {
00028 public:
00029     wxGripWindow() {
00030         Init();
00031     }
00032     void Init();
00033     
00034     wxGripWindow( wxWindow * parent, wxOrientation orientation, 
00035   wxGdi::eGripperStyle gripStyle ) 
00036  {
00037         Init();
00038         Create( parent, orientation, gripStyle );
00039     }
00040 
00041     // basic interface
00042     bool Create( wxWindow * parent, wxOrientation orientation, 
00043   wxGdi::eGripperStyle gripStyle );
00044 
00045     void SetOrientation( wxOrientation orientation );
00046     void SetLabel( const wxString &label );
00047     
00048     // event handlers
00049     void OnErase( wxEraseEvent& event );
00050     void OnPaint( wxPaintEvent& event );
00051     void OnDoubleClick( wxMouseEvent& event );
00052     void OnLeftDown( wxMouseEvent& event );
00053     void OnLeftUp( wxMouseEvent& event );
00054     void OnMotion( wxMouseEvent& event );
00055 
00056 private:
00057     void createMouseEvent( int eventId, int x, int y );
00058 
00059 private:
00060     wxString label_;
00061     wxWindow * pOwner_;
00062     wxOrientation orientation_;
00063     wxGdi::eGripperStyle gripStyle_;
00064 
00065 private:
00066     DECLARE_CLASS( wxGripWindow )
00067     DECLARE_EVENT_TABLE()
00068 };
00069 
00070 // ----------------------------------------------------------------------------
00071 // wxGripWindow events
00072 // ----------------------------------------------------------------------------
00073 
00074 BEGIN_DECLARE_EVENT_TYPES()
00075     DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_GRIP_DBLCLICK, wxEVT_FIRST + 1230)   // TODO: must change id
00076     DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_GRIP_LEFTDOWN, wxEVT_FIRST + 1231)   // TODO: must change id
00077     DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_GRIP_LEFTUP,   wxEVT_FIRST + 1232)   // TODO: must change id
00078     DECLARE_EXPORTED_EVENT_TYPE( WXDLLIMPEXP_DI, wxEVT_GRIP_MOTION,   wxEVT_FIRST + 1233)   // TODO: must change id
00079 END_DECLARE_EVENT_TYPES()
00080 
00081 // This should keep wxDockit compatible with wxWidgets 2.4.x
00082 #ifndef WXWIN_COMPATIBILITY_2_4
00083 #define EVT_GRIP_DBLCLICK(fn) \
00084     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_DBLCLICK, -1, -1, \
00085   (wxObjectEventFunction) (wxEventFunction) & fn, NULL ),
00086 #define EVT_GRIP_LEFTDOWN(fn) \
00087     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_LEFTDOWN, -1, -1, \
00088   (wxObjectEventFunction) (wxEventFunction) & fn, NULL ),
00089 #define EVT_GRIP_LEFTUP(fn) \
00090     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_LEFTUP, -1, -1, \
00091   (wxObjectEventFunction) (wxEventFunction) & fn, NULL ),
00092 #define EVT_GRIP_MOTION(fn) \
00093     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_MOTION, -1, -1, \
00094   (wxObjectEventFunction) (wxEventFunction) & fn, NULL ),
00095 #else
00096 // Patch for wxWidgets-2.5.4 compat submitted by Jesus Gonzalez (2005-03-02)
00097 typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&);
00098 #define EVT_GRIP_DBLCLICK(fn) \
00099     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_DBLCLICK, -1, -1, \
00100   (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMouseEventFunction, & fn ), NULL ),
00101 #define EVT_GRIP_LEFTDOWN(fn) \
00102     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_LEFTDOWN, -1, -1, \
00103   (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMouseEventFunction, & fn ), NULL ),
00104 #define EVT_GRIP_LEFTUP(fn) \
00105     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_LEFTUP, -1, -1, \
00106   (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMouseEventFunction, & fn ), NULL ),
00107 #define EVT_GRIP_MOTION(fn) \
00108     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRIP_MOTION, -1, -1, \
00109   (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMouseEventFunction, & fn ), NULL ),
00110 #endif
00111 
00112 #endif
00113     // _WX_GRIPPER_H_

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