]> Creatis software - creaMaracasVisu.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 22 Jul 2011 12:29:41 +0000 (12:29 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 22 Jul 2011 12:29:41 +0000 (12:29 +0000)
bbtk/src/bbmaracasvisuSliderMinMax.cxx
bbtk/src/bbmaracasvisuSliderMinMax.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h

index 3f5cc7e99032d83e8e0bac1c0a0ff6997c1d8980..d39065ff27c4cd09a99d63d332b694ca2e7f3a8f 100644 (file)
@@ -12,12 +12,11 @@ namespace bbcreaMaracasVisu
          //--------------------------------------------------------------------------------------------------------------------------------
          // Constructors ans destructors
          //--------------------------------------------------------------------------------------------------------------------------------
-               wxWidgetSliderMinMax :: wxWidgetSliderMinMax(SliderMinMax *bbParent,mBarRange * modelBarRange)//(wxWindow *parent, mBarRange * modelBarRange)
+               wxWidgetSliderMinMax :: wxWidgetSliderMinMax(SliderMinMax *bbParent,mBarRange * modelBarRange)
                :wxEvtHandler()
                {                       
-                       modBarRange = modelBarRange;
-                       mbbtkSliderMinMax = bbParent;
-                       modBarRange->PushEventHandler(this);
+                       modBarRange                     = modelBarRange;
+                       mbbtkSliderMinMax       = bbParent;
                        Connect(modBarRange->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onBarrange );
 //                     Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
                        Connect(modBarRange->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
@@ -30,8 +29,12 @@ namespace bbcreaMaracasVisu
                wxWidgetSliderMinMax ::  ~wxWidgetSliderMinMax()
                {
                }
-               
-
+                       
+               void wxWidgetSliderMinMax::PushEventHandler()
+               {
+                       modBarRange->PushEventHandler(this);
+               }
+       
          //--------------------------------------------------------------------------------------------------------------------------------
          // Min-Max Barrange received events
          //--------------------------------------------------------------------------------------------------------------------------------
@@ -99,22 +102,23 @@ void SliderMinMax::CreateWidget(wxWindow* parent)
 
     bbtkDebugMessageInc("Core",9,"SliderMinMax::CreateWidget()"<<std::endl);
 
-               mwxwidget = new mBarRange(parent ,bbGetInputInW(), bbGetInputInH()); 
-               mwxwidget -> SetOrientation( bbGetInputOrientation()==1 );
-               mwxwidget -> setActiveStateTo(true);
-               mwxwidget -> setVisibleLabels( bbGetInputShowLabels()==1 );
-               mwxwidget -> setDeviceEndMargin(10);
+       mwxwidget = new mBarRange(parent ,bbGetInputInW(), bbGetInputInH()); 
+       mwxwidget -> SetOrientation( bbGetInputOrientation()==1 );
+       mwxwidget -> setActiveStateTo(true);
+       mwxwidget -> setVisibleLabels( bbGetInputShowLabels()==1 );
+       mwxwidget -> setDeviceEndMargin(10);
 //         mwxwidget -> setRepresentedValues(bbGetInputInMin(), bbGetInputInMax());
-               mwxwidget -> setDeviceBlitStart(10,10); 
-               mwxwidget -> setIfWithActualDrawed(bbGetInputShowActual());
+       mwxwidget -> setDeviceBlitStart(10,10); 
+       mwxwidget -> setIfWithActualDrawed(bbGetInputShowActual());
 //             mwxwidget -> SetStart(bbGetInputInMinShow());
 //             mwxwidget -> SetEnd(bbGetInputInMaxShow());  
        
        
-               wxWidgetSliderMinMax * eventHandler = new wxWidgetSliderMinMax(this, mwxwidget); //JPRx   //EED ?????
-       
+       wxWidgetSliderMinMax *eventHandler = new wxWidgetSliderMinMax(this, mwxwidget); 
+       eventHandler->PushEventHandler();
+
        
-               bbtkDebugDecTab("Core",9);
+       bbtkDebugDecTab("Core",9);
 
        bbSetOutputWidget( mwxwidget );
 
index eaab03266355f8200e525e85ebbfe5133bd10d99..1aaa5808cf2dfdfe29560a997b6251c65cbc5f02 100644 (file)
@@ -35,6 +35,9 @@ namespace bbcreaMaracasVisu
                void onEndChange_Bar(wxCommandEvent& event);
                void onSelectionEnd(wxCommandEvent& event);
                void onMovedBar(wxCommandEvent& event);
+               
+         void PushEventHandler();
+
 
   private:
          //--------------------------------------------------------------------------------------------------------------------------------
index ccd89464f5db75132ea5cf83740881ae425e23c9..494d599f949c937a8290d1b086c4a7c30218ed71 100644 (file)
@@ -46,10 +46,10 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
 :wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL)
 {
        acceptedClick           = true;
-       _bitmap_bar                     =       NULL;
+       _bitmap_bar                     = NULL;
        SetWidth (w);
        SetHeight(h);
-       _initialPoint           =       0;
+       _initialPoint           = 0;
        trianglesHalfWidth      = 5;
        
        wxColour start_Colour;
@@ -351,19 +351,7 @@ void mBarRange::OnSize( wxSizeEvent &WXUNUSED(event) )
 
 void mBarRange::Refresh(bool eraseBackground, const wxRect* rect)
 {
-// EED Borrame
-//FILE *ff;
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: Refresh 01\n" );
-//fclose(ff);
-
        wxScrolledWindow::Refresh(false);
-
-
-// EED Borrame
-//ff=fopen ("c:/temp/xx.txt", "a+");
-//fprintf( ff , "mBarRange :: Refresh 02\n" );
-//fclose(ff);
 }
 
 
@@ -372,13 +360,6 @@ void mBarRange::Refresh(bool eraseBackground, const wxRect* rect)
 //----------------------------------------------------------------------------
 void mBarRange::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
-
-// EED Borrame
-//FILE *ff;
-//ff=fopen ("c:/temp/xx.txt", "a+");
-//fprintf( ff , "pColorBar :: OnPaint 01\n" );
-//fclose(ff);
-
        if (_bitmap_bar!=NULL){
                //repaint rectangle
                if(_orientation)
@@ -414,26 +395,14 @@ void mBarRange::OnPaint( wxPaintEvent &WXUNUSED(event) )
 
                } 
        } 
-
-// EED Borrame
-//ff=fopen ("c:/temp/xx.txt", "a+");
-//fprintf( ff , "pColorBar :: OnPaint 02\n" );
-//fclose(ff);
+}
 
 
-}
 //----------------------------------------------------------------------------
 //Repaint the bar if it is horizontal
 //----------------------------------------------------------------------------
 void mBarRange::RefreshHorizontalView()
 {
-
-// EED Borrame
-//FILE *ff;
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: RefreshHorizontalView 01\n" );
-//fclose(ff);
-
        wxPoint points[3];
 
        //int largestNumberWidthInPixels = 15; // JPRx
@@ -632,10 +601,6 @@ void mBarRange::RefreshHorizontalView()
                }                       
        }
 
-// EED Borrame
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: RefreshHorizontalView 02\n" );
-//fclose(ff);
 }
 
 //----------------------------------------------------------------------------
@@ -644,12 +609,6 @@ void mBarRange::RefreshHorizontalView()
 
 void mBarRange::RefreshVerticalView()
 {
-
-// EED Borrame
-//FILE *ff;
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: RefreshVerticalView 01\n" );
-//fclose(ff);
        wxPoint points[3];
 
        int px1=GetPixelStart();
@@ -843,15 +802,6 @@ void mBarRange::RefreshForce()
 //----------------------------------------------------------------------------
 void mBarRange::OnMouseMove(wxMouseEvent& event )
 {
-// EED Borrame
-//FILE *ff;
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: OnMouseMove 01\n" );
-//fclose(ff);
-
-       //int px1=GetPixelStart(); // JPRx
-       //int px2=GetPixelEnd(); // JPRx
-       //int px3=GetPixelActual(); // JPRx
        if (activeState)
        {
                wxPoint point = event.GetPosition();
@@ -1065,13 +1015,9 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                        }
                }                               
        }       
+}
 
-// EED Borrame
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "  mBarRange :: OnMouseMove 02\n" );
-//fclose(ff);
 
-}
 /*
 * Sets the represented minimum and maximunm values
 * param minRealValue The minimum represented value (real value)
@@ -1479,11 +1425,6 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB )
                                } // Start>_min  &&  End<_max
                        }// _selectionMoveId == 4
                } // step
-               
-               
-               
-               
-               printf("EED  mBarRange::onKey code:%d\n", event.GetKeyCode());
        }
 
 
index 77e0c8b5c2f42a19a9edfda6e3a7bfa90e0bb14d..aa28eff0aa3077b87ed9f0d80fcb4d5a77b54f53 100644 (file)
@@ -59,7 +59,7 @@ public:
        //------------------------------------
        //Constructors & Destructors
        //------------------------------------
-       mBarRange(wxWindow *parent, int w, int h/*, bool theOrientation, bool useWithActualDrawed*/);
+       mBarRange(wxWindow *parent, int w, int h);
        ~mBarRange();
        //------------------------------------
        // Bar Methods