X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FmBarRange.cxx;h=70e1b8ba2b73ff6ca0335c41609bea890d32eb5f;hb=c997301a5cfd97dc9a44f5ff0766814265e4c527;hp=e678d73ab46c15aea906fbb3760545084f625eb6;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index e678d73..70e1b8b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx @@ -2,6 +2,8 @@ #include "mBarRange.h" +//const wxEventType wxEVT_TSBAR = wxNewEventType(); + DEFINE_EVENT_TYPE(wxEVT_TSBAR) DEFINE_EVENT_TYPE(wxEVT_TSBAR_ACTUAL) DEFINE_EVENT_TYPE(wxEVT_TSBAR_START) @@ -9,6 +11,8 @@ DEFINE_EVENT_TYPE(wxEVT_TSBAR_END) DEFINE_EVENT_TYPE(wxEVT_TSBAR_MOVED) DEFINE_EVENT_TYPE(wxEVT_SELECTION_END) + + //---------------------------------------------------------------------------- //EVENT TABLE //---------------------------------------------------------------------------- @@ -39,12 +43,12 @@ END_EVENT_TABLE() mBarRange::mBarRange(wxWindow *parent, int w, int h) :wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL) { - acceptedClick = true; + acceptedClick = true; _bitmap_bar = NULL; SetWidth (w); SetHeight(h); _initialPoint = 0; - trianglesHalfWidth = 5; + trianglesHalfWidth = 5; wxColour start_Colour; @@ -413,23 +417,23 @@ void mBarRange::RefreshHorizontalView() wxPoint points[3]; - int largestNumberWidthInPixels = 15; - int pxStart=GetPixelStart(); - int pxEnd=GetPixelEnd(); - int pxActual=GetPixelActual(); + //int largestNumberWidthInPixels = 15; // JPRx + int pxStart = GetPixelStart(); + int pxEnd = GetPixelEnd(); + int pxActual = GetPixelActual(); - int letterHeight = 9; - int barHeight = 2*letterHeight; - int tempHeight = _h-(6*letterHeight); + int letterHeight= 9; + int barHeight = 2*letterHeight; + int tempHeight = _h-(6*letterHeight); if (_visibleLables) { - barHeight = (tempHeight>0) ? tempHeight : (int) _h/2; + barHeight = (tempHeight>0) ? tempHeight : (int) _h/2; } else - barHeight = _h; + barHeight = _h; wxMemoryDC temp_dc; temp_dc.SelectObject( *_bitmap_bar ); @@ -679,24 +683,24 @@ void mBarRange::RefreshVerticalView() // 2 Shadow Triangles: Start and End - points[0].x=_h; - points[0].y=0; - points[1].x=0; - points[1].y=-trianglesHalfWidth-1; - points[2].x=0; - points[2].y=trianglesHalfWidth+2; + points[0].x = _h; + points[0].y = 0; + points[1].x = 0; + points[1].y = -trianglesHalfWidth-1; + points[2].x = 0; + points[2].y = trianglesHalfWidth+2; temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID )); temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID )); temp_dc.DrawPolygon(3,points,0,px1); temp_dc.DrawPolygon(3,points,0,px2); // 2 Triangles: Start and End - points[0].x=_h; - points[0].y=0; - points[1].x=0; - points[1].y=-trianglesHalfWidth; - points[2].x=0; - points[2].y=trianglesHalfWidth; + points[0].x = _h; + points[0].y = 0; + points[1].x = 0; + points[1].y = -trianglesHalfWidth; + points[2].x = 0; + points[2].y = trianglesHalfWidth; //first triangle (start) if( _selectionMoveId==1 ) { @@ -826,9 +830,9 @@ void mBarRange::OnMouseMove(wxMouseEvent& event ) //fprintf( ff , "mBarRange :: OnMouseMove 01\n" ); //fclose(ff); - int px1=GetPixelStart(); - int px2=GetPixelEnd(); - int px3=GetPixelActual(); + //int px1=GetPixelStart(); // JPRx + //int px2=GetPixelEnd(); // JPRx + //int px3=GetPixelActual(); // JPRx if (activeState) { wxPoint point = event.GetPosition(); @@ -880,7 +884,7 @@ void mBarRange::OnMouseMove(wxMouseEvent& event ) //------------------------------------------- // Sending the event of start triangle moved //------------------------------------------- - createAndSendEvent( wxEVT_TSBAR_START ); + createAndSendEvent( wxEVT_TSBAR_START ); } //start has to be less than actual else if (validPos_StartTri && _in_rangeProperty) @@ -893,7 +897,7 @@ void mBarRange::OnMouseMove(wxMouseEvent& event ) //------------------------------------------- // Sending the event of start triangle moved //------------------------------------------- - createAndSendEvent( wxEVT_TSBAR_START ); + createAndSendEvent( wxEVT_TSBAR_START ); } } } // _selectionMoveId == 1 @@ -939,7 +943,11 @@ void mBarRange::OnMouseMove(wxMouseEvent& event ) //------------------------------------------- //Sending the event of actual triangle moved //------------------------------------------- - createAndSendEvent( wxEVT_TSBAR_ACTUAL ); + createAndSendEvent( wxEVT_TSBAR_ACTUAL ); +// createAndSendEvent( 98765 ); + +//printf("EED creaMaracasVisu mBarRange::OnMouseMove XXXXXXX \n"); + } else if( validPos_ActualTri && _in_rangeProperty ) // the tringle in between start and end @@ -1350,7 +1358,7 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB ) return withActualDrawed; } - void mBarRange :: createAndSendEvent(WXTYPE theEventType) + void mBarRange::createAndSendEvent(WXTYPE theEventType) { wxCommandEvent cevent( theEventType, GetId() ); cevent.SetEventObject( this );