|
From: Emilien K. <cur...@us...> - 2005-01-03 16:59:56
|
Update of /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29447/include/wxDevCenter/StdPlugin Modified Files: BitmapCtrl.h Log Message: GPL. Ajout de la classe des évènements du controle de bitmap. Index: BitmapCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin/BitmapCtrl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BitmapCtrl.h 3 Dec 2004 16:51:28 -0000 1.1 --- BitmapCtrl.h 3 Jan 2005 16:59:44 -0000 1.2 *************** *** 143,145 **** --- 143,258 ---- + + 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 |