]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
#3144 creaMaracasVisu Bug New Normal - changeWx28to30
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / mBarRange.cxx
index fc10c87e1f46234dae366cb8fb8549c6b803659a..489d46740378b397f99be174e0b14a589daaa084 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "mBarRange.h"
 
-
 //const wxEventType wxEVT_TSBAR = wxNewEventType();
 
 DEFINE_EVENT_TYPE(wxEVT_TSBAR)
@@ -39,13 +38,12 @@ DEFINE_EVENT_TYPE(wxEVT_TSBAR_END)
 DEFINE_EVENT_TYPE(wxEVT_TSBAR_MOVED)
 DEFINE_EVENT_TYPE(wxEVT_SELECTION_END)
 
-
-
 //----------------------------------------------------------------------------
 //EVENT TABLE
 //----------------------------------------------------------------------------
 
 IMPLEMENT_CLASS(mBarRange, wxScrolledWindow)
+
 BEGIN_EVENT_TABLE(mBarRange, wxScrolledWindow)
        EVT_PAINT (mBarRange::OnPaint)
        EVT_SIZE  (mBarRange::OnSize)
@@ -79,8 +77,6 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        SetHeight(h);
        _initialPoint           = 0;
        trianglesHalfWidth      = 5;
-       
-
        // Setting the default parts colors
        start_Colour            =       wxColour(1,0,255,254);
        actual_Colour           =       wxColour(255,255,202);
@@ -88,7 +84,6 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        bar_Colour                      =       wxColour(255,0,255);
        backgroundColor     =   parent ->GetBackgroundColour();
        guideLineColor          =   wxColour(255,0,0);
-
        //actual is in _start and end
        //false means that it could be anywhere
        _moveActualWithBar      =       false;
@@ -96,16 +91,13 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        _selectionMoveId        =       -1;
        realX_vertical_line =   -1;
        activeState                     =       false;
-       _actual=0;
-       deviceEndMargin = 0;
-
+       _actual                         =       0;
+       deviceEndMargin         =       0;
        SetOrientation(true);
        setIfWithActualDrawed(true);
-
        b_popmenu.Append (cntID_CHANGE_COLOR, _("Change Color"), _("Changes the color of the selected part"));
        b_popmenu.Append (cntID_ENABLE_ACTUAL, _("Enable actual in range"), _("Enables/Disables the actual triangle to be or not in range"));
        b_popmenu.Append (cntID_MOVABLE_ACTUAL_BAR, _("Move actual-bar simultaneously"), _("Disables the actual triangle to move with the bar"));
-
        SetSize(w,h);
 }
 
@@ -116,6 +108,7 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
 mBarRange::~mBarRange()
 {
 }
+
 //---------------------------------------------------------------------------
 //Draw bar: vertical or Horizontal
 //---------------------------------------------------------------------------
@@ -184,6 +177,7 @@ int mBarRange::GetPixelStart()
 {
        return ((_start - _min)*(_w-deviceEndMargin))/(_max - _min);    
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels
 //----------------------------------------------------------------------------
@@ -192,6 +186,7 @@ void mBarRange::SetPixelStart(int i)
        _start = _min+((i - deviceStart_x)*( _max - _min))/(_w-deviceEndMargin);
        
 }
+
 //----------------------------------------------------------------------------
 // _actual of the pixel rectangle
 //----------------------------------------------------------------------------
@@ -199,6 +194,7 @@ int mBarRange::GetPixelActual()
 {
        return ((_actual - _min)*(_w-deviceEndMargin))/(_max - _min);
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels
 //----------------------------------------------------------------------------
@@ -206,6 +202,7 @@ void mBarRange::SetPixelActual(int i)
 {
        _actual = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
 }
+
 //----------------------------------------------------------------------------
 // _end of the pixel rectangle
 //----------------------------------------------------------------------------
@@ -213,6 +210,7 @@ int mBarRange::GetPixelEnd()
 {
        return ((_end - _min)*(_w-deviceEndMargin))/(_max - _min);
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels to be converted to real logical value
 //----------------------------------------------------------------------------
@@ -220,10 +218,10 @@ void mBarRange::SetPixelEnd(int i)
 {
        _end = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
 }
+
 //----------------------------------------------------------------------------
 // Logical max of the triangle
 //----------------------------------------------------------------------------
-
 double mBarRange::GetMax()
 {
        return _max;