]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
#3317 creaMaracasVisu Feature New Normal - plane information inf viewerNV
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / mBarRange.cxx
index 8f62478e089105f4a839b4358359454d25d8b302..42db92071198e13c6a40271af51cb959ae9c1972 100644 (file)
@@ -70,7 +70,8 @@ END_EVENT_TABLE()
 
 //wxDefaultSize
 mBarRange::mBarRange(wxWindow *parent, int w, int h)
-:wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+//EED-2019-10-25 :wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+ :wxPanel(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
 {
        acceptedClick           =       true;
        _bitmap_bar                     =       NULL;
@@ -108,6 +109,8 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
 
 mBarRange::~mBarRange()
 {
+       DeletePendingEvents ();
+       RemoveEventHandler ( GetEventHandler() );       
 }
 
 //---------------------------------------------------------------------------
@@ -119,15 +122,12 @@ void mBarRange::DrawBar()
        if(_orientation)
        {
                SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
-               _bitmap_bar             = new wxBitmap(_w+1280,_h+100);
+               _bitmap_bar                     = new wxBitmap(_w+1280,_h+100);
                //SIL//_bitmap_info     = new wxBitmap(_w+100+1280, _h+100);
-       }
-       //vertical
-       else
-       {
+       } else {
                SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
-               _bitmap_bar = new wxBitmap(_h+deviceStart_y+100,_w+1280);
-               _bitmap_info = new wxBitmap(_h+deviceStart_y+100, _w+1280);
+               _bitmap_bar             = new wxBitmap(_h+deviceStart_y+100,_w+1280);
+               _bitmap_info            = new wxBitmap(_h+deviceStart_y+100, _w+1280);
        }
 }
 //----------------------------------------------------------------------------
@@ -143,7 +143,7 @@ bool mBarRange::GetInRangeProperty()
 //----------------------------------------------------------------------------
 void mBarRange::SetInRangeProperty(bool in)
 {
-       _in_rangeProperty=in;
+       _in_rangeProperty = in;
 }
 //----------------------------------------------------------------------------
 //the information about the actual triangle in range or not, true if is between start and end
@@ -386,7 +386,8 @@ void mBarRange::OnSize( wxSizeEvent &WXUNUSED(event) )
 
 void mBarRange::Refresh(bool eraseBackground, const wxRect* rect)
 {
-       wxScrolledWindow::Refresh(false);
+//EED2019-10-25        wxScrolledWindow::Refresh(false);
+       wxPanel::Refresh(false);
 }
 
 
@@ -838,9 +839,9 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                        if (barHeight <=_h)
                        {
                                bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
-                               bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
-                               bool in_actualT= withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
-                               bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+                               bool in_EndTri   = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+                               bool in_actualT  = withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+                               bool in_movingBar= (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
 
                                if( in_actualT )
                                        _selectionMoveId = 3;
@@ -851,9 +852,7 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                                else if( in_movingBar )
                                        _selectionMoveId = 4;
                        }
-               }
-               else
-               {
+               } else {
                        if(acceptedClick)
                        {
                                //is in start triagle
@@ -1040,10 +1039,10 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
 */
 void mBarRange :: setRepresentedValues ( double minRealValue, double maxRealValue)
 {
-       _min = minRealValue;
-       _max = maxRealValue;
-       _start=_min;
-       _end=_max;
+       _min    = minRealValue;
+       _max    = maxRealValue;
+       _start  =_min;
+       _end    =_max;
 }
 
 /*
@@ -1080,9 +1079,7 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB )
                                SetPixelStart(deviceStart_x);
                                SetPixelEnd(_w+deviceStart_x);
                                SetPixelActual(deviceStart_x);
-                       }
-                       else
-                       {
+                       } else {
                                SetPixelStart(deviceStart_x);
                                SetPixelEnd(_h+deviceStart_x);
                                SetPixelActual(deviceStart_x);
@@ -1116,10 +1113,10 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB )
 
                                if (getClickedX()<=_h)
                                {                                               
-                                       bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
-                                       bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
-                                       bool in_actualT= (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
-                                       bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+                                       bool in_StartTri        = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
+                                       bool in_EndTri          = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+                                       bool in_actualT         = (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+                                       bool in_movingBar       = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
 
                                        if(in_StartTri)
                                                _selectionMoveId = 1;