|
From: Emilien K. <cur...@us...> - 2005-01-07 22:10:50
|
Update of /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27644/include/wxDevCenter/StdPlugin Modified Files: BitmapCtrl.h BitmapDocView.h Log Message: Passage de wxImage vers wxBitmap pour le stockage interne des images. Début du tracé à main levé Index: BitmapCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin/BitmapCtrl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BitmapCtrl.h 7 Jan 2005 17:41:43 -0000 1.4 --- BitmapCtrl.h 7 Jan 2005 22:10:41 -0000 1.5 *************** *** 46,50 **** /** L'image liée au controle.*/ ! wxImage m_Image; private: --- 46,50 ---- /** L'image liée au controle.*/ ! wxBitmap m_Bmp; private: *************** *** 74,82 **** * A utiliser pour modifier directement l'image. */ ! wxImage& Image(){return m_Image;} /** Attache un image au controle. * @param img Nouvelle image fixée au controle.*/ ! void SetImage(const wxImage& img); --- 74,82 ---- * A utiliser pour modifier directement l'image. */ ! wxBitmap& Bitmap(){return m_Bmp;} /** Attache un image au controle. * @param img Nouvelle image fixée au controle.*/ ! void SetBitmap(const wxBitmap& Bmp); Index: BitmapDocView.h =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/include/wxDevCenter/StdPlugin/BitmapDocView.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BitmapDocView.h 7 Jan 2005 17:41:43 -0000 1.2 --- BitmapDocView.h 7 Jan 2005 22:10:41 -0000 1.3 *************** *** 39,43 **** protected: /** Buffer de l'image.*/ ! wxImage m_Image; /** Charge le texte depuis l'archive.*/ --- 39,43 ---- protected: /** Buffer de l'image.*/ ! wxBitmap m_Bmp; /** Charge le texte depuis l'archive.*/ *************** *** 49,57 **** /** Acces au buffer de l'image.*/ ! wxImage& GetImage(){return m_Image;} /** Fixe la couleur d'un pixel.*/ void SetPixel(wxPoint pt, wxColour col); /** Revoie le type de bitmap depuis l'extension d'un fichier. * @param strFile Nom du fichier. --- 49,60 ---- /** Acces au buffer de l'image.*/ ! wxBitmap& GetBitmap(){return m_Bmp;} /** Fixe la couleur d'un pixel.*/ void SetPixel(wxPoint pt, wxColour col); + /** Dessine un trait.*/ + void DrawLine(wxPoint ptFrom, wxPoint ptTo, wxColour col); + /** Revoie le type de bitmap depuis l'extension d'un fichier. * @param strFile Nom du fichier. *************** *** 63,67 **** #define WXDC_BITMAP_PALETTE_WIDTH 8 ! #define WXDC_BITMAP_PALETTE_HEIGHT 12 #define WXDC_BITMAP_PALETTE_SIZE (WXDC_BITMAP_PALETTE_WIDTH*WXDC_BITMAP_PALETTE_HEIGHT) --- 66,70 ---- #define WXDC_BITMAP_PALETTE_WIDTH 8 ! #define WXDC_BITMAP_PALETTE_HEIGHT 11 #define WXDC_BITMAP_PALETTE_SIZE (WXDC_BITMAP_PALETTE_WIDTH*WXDC_BITMAP_PALETTE_HEIGHT) *************** *** 88,94 **** void OnUpdateExtraScroll(wxUpdateUIEvent& event); - /** Interception d'un drag gauche.*/ - void OnLeftDrag(wxExtendedMouseEvent& event); - /** Création de la barre de controle.*/ wxPanel* CreateControlPanel(); --- 91,94 ---- *************** *** 133,136 **** --- 133,159 ---- void OnSliderSpinTextChanged(wxCommandEvent& event); + /** Intercepte la peinture du fond pour empecher le flicking.*/ + void OnEraseBackground(wxEraseEvent& event); + + enum BitmapViewDrawing + { + BVD_NONE = 0, + BVD_HANDDRAW = 1 + }; + + /** Fonction de tracé courante.*/ + BitmapViewDrawing m_BVD; + + /** Sauvegarde d'un point.*/ + wxPoint m_pt; + + /** Interception d'un drag gauche.*/ + void OnLeftDrag(wxExtendedMouseEvent& event); + /** Interception d'un début de drag gauche.*/ + void OnLeftDragStart(wxExtendedMouseEvent& event); + /** Interception d'une fin de drag gauche.*/ + void OnLeftDragEnd(wxExtendedMouseEvent& event); + + public: BitmapDocument* GetDocument(){return (BitmapDocument*)m_pDocument;} |