|
From: Emilien K. <cur...@us...> - 2005-01-04 15:32:11
|
Update of /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6125/include/wxDevCenter/StdPlugin Modified Files: BitmapCtrl.h Added Files: extmouse.h Log Message: Création et utilisation d'une classe séparée pour la gestion avancée de la souris Index: BitmapCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin/BitmapCtrl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BitmapCtrl.h 3 Jan 2005 16:59:44 -0000 1.2 --- BitmapCtrl.h 4 Jan 2005 15:31:55 -0000 1.3 *************** *** 32,35 **** --- 32,37 ---- #include <wx/dcmemory.h> + #include <wxDevCenter/StdPlugin/extmouse.h> + /** Controle d'affichage de bitmap. *************** *** 37,41 **** * Gère en standard l'affichage d'un bitmap avec scrolling et zoom. */ ! class STD_DLL_PLUGIN BitmapCtrl : public wxControl { protected: --- 39,43 ---- * Gère en standard l'affichage d'un bitmap avec scrolling et zoom. */ ! class STD_DLL_PLUGIN BitmapCtrl : public wxControl, public wxExtendedMouseInterface { protected: *************** *** 60,63 **** --- 62,69 ---- wxPoint m_ptOrigin; + /** Position à retenir de la souris. + * Utilisée pour un glissement. + */ + wxPoint m_ptMouse; public: /** Constructeur standard des controles.*/ *************** *** 140,258 **** /** Interception des évenements de scroll.*/ void OnScroll(wxScrollWinEvent& event); - }; - ! ! BEGIN_DECLARE_EVENT_TYPES() ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_CLICK, 22001) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_CLICK, 22002) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_DBLCLICK, 22003) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_DBLCLICK, 22004) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_DOWN, 22005) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_DOWN, 22006) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_UP, 22007) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_UP, 22008) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_BEGIN_DRAG, 22009) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_BEGIN_DRAG, 22010) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_END_DRAG, 22011) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_END_DRAG, 22012) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_LEFT_MOVE_DRAG, 22013) ! DECLARE_EVENT_TYPE(WXDCEVT_BITMAP_RIGHT_MOVE_DRAG, 22014) ! END_DECLARE_EVENT_TYPES() ! ! ! /** ! * Classe d'évènement généré par un BitmapCtrl. ! */ ! class STD_DLL_PLUGIN BitmapEvent : public wxCommandEvent ! { ! private: ! BitmapEvent& operator=(const BitmapEvent& event); ! ! wxPoint m_pt1, m_pt2; ! public: ! BitmapEvent(wxEventType commandType = wxEVT_NULL, wxWindowID id=-1, wxPoint ptFrom = wxDefaultPosition, wxPoint ptTo = wxDefaultPosition); ! wxEvent* Clone(void) const; ! ! wxPoint GetFromPos()const {return m_pt1;} ! void SetFromPos(wxPoint pt){m_pt1 = pt;} ! wxPoint GetToPos()const {return m_pt2;} ! void SetToPos(wxPoint pt){m_pt2 = pt;} }; - /** Type des fonctions d'interception des évènements BitmapEvent.*/ - typedef void (wxEvtHandler::*BitmapEventFunction)(BitmapEvent&); - - /** Macro d'entrée d'interception de clic gauche. */ - #define EVT_WXDC_BITMAP_LEFT_CLICK(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_CLICK, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de clic droit. */ - #define EVT_WXDC_BITMAP_RIGHT_CLICK(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_CLICK, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de double clic gauche. */ - #define EVT_WXDC_BITMAP_LEFT_DBLCLICK(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_DBLCLICK, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de double clic droit. */ - #define EVT_WXDC_BITMAP_RIGHT_DBLCLICK(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_DBLCLICK, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de baisser bouton gauche. */ - #define EVT_WXDC_BITMAP_LEFT_DOWN(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_DOWN, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de baisser bouton droit. */ - #define EVT_WXDC_BITMAP_RIGHT_DOWN(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_DOWN, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de lever bouton gauche. */ - #define EVT_WXDC_BITMAP_LEFT_UP(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_UP, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de lever bouton droit. */ - #define EVT_WXDC_BITMAP_RIGHT_UP(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_UP, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de début de glissée gauche. */ - #define EVT_WXDC_BITMAP_LEFT_BEGIN_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_BEGIN_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de début de glissée droit. */ - #define EVT_WXDC_BITMAP_RIGHT_BEGIN_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_BEGIN_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de fin de glissée gauche. */ - #define EVT_WXDC_BITMAP_LEFT_END_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_END_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de fin de glissée droit. */ - #define EVT_WXDC_BITMAP_RIGHT_END_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_END_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de glissée gauche. */ - #define EVT_WXDC_BITMAP_LEFT_MOVE_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_LEFT_MOVE_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - /** Macro d'entrée d'interception de glissée droit. */ - #define EVT_WXDC_BITMAP_RIGHT_MOVE_DRAG(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( WXDCEVT_BITMAP_RIGHT_MOVE_DRAG, id, -1, \ - (wxObjectEventFunction)(wxCommandEventFunction)(BitmapEventFunction)&fn, (wxObject *) NULL ), - - #endif --- 146,154 ---- /** Interception des évenements de scroll.*/ void OnScroll(wxScrollWinEvent& event); ! /** Interception des évènements de la souris.*/ ! void OnMouseEvent(wxMouseEvent& event); }; #endif --- NEW FILE: extmouse.h --- (This appears to be a binary file; contents omitted.) |