From: Eduardo Davila Date: Fri, 22 Jul 2011 12:29:41 +0000 (+0000) Subject: no message X-Git-Tag: v1.0.4~77 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0738bcbc9e571daa06e0249bc9d9b8c42b30cecf;p=creaMaracasVisu.git no message --- diff --git a/bbtk/src/bbmaracasvisuSliderMinMax.cxx b/bbtk/src/bbmaracasvisuSliderMinMax.cxx index 3f5cc7e..d39065f 100644 --- a/bbtk/src/bbmaracasvisuSliderMinMax.cxx +++ b/bbtk/src/bbmaracasvisuSliderMinMax.cxx @@ -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()"< 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 ); diff --git a/bbtk/src/bbmaracasvisuSliderMinMax.h b/bbtk/src/bbmaracasvisuSliderMinMax.h index eaab032..1aaa580 100644 --- a/bbtk/src/bbmaracasvisuSliderMinMax.h +++ b/bbtk/src/bbmaracasvisuSliderMinMax.h @@ -35,6 +35,9 @@ namespace bbcreaMaracasVisu void onEndChange_Bar(wxCommandEvent& event); void onSelectionEnd(wxCommandEvent& event); void onMovedBar(wxCommandEvent& event); + + void PushEventHandler(); + private: //-------------------------------------------------------------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index ccd8946..494d599 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx @@ -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()); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h index 77e0c8b..aa28eff 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h @@ -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