//--------------------------------------------------------------------------------------------------------------------------------
// 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 );
wxWidgetSliderMinMax :: ~wxWidgetSliderMinMax()
{
}
-
-
+
+ void wxWidgetSliderMinMax::PushEventHandler()
+ {
+ modBarRange->PushEventHandler(this);
+ }
+
//--------------------------------------------------------------------------------------------------------------------------------
// Min-Max Barrange received events
//--------------------------------------------------------------------------------------------------------------------------------
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 );
void onEndChange_Bar(wxCommandEvent& event);
void onSelectionEnd(wxCommandEvent& event);
void onMovedBar(wxCommandEvent& event);
+
+ void PushEventHandler();
+
private:
//--------------------------------------------------------------------------------------------------------------------------------
: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;
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);
}
//----------------------------------------------------------------------------
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)
}
}
-
-// 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
}
}
-// EED Borrame
-//ff=fopen ("c:/temp/xxx.txt", "a+");
-//fprintf( ff , "mBarRange :: RefreshHorizontalView 02\n" );
-//fclose(ff);
}
//----------------------------------------------------------------------------
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();
//----------------------------------------------------------------------------
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();
}
}
}
+}
-// 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)
} // Start>_min && End<_max
}// _selectionMoveId == 4
} // step
-
-
-
-
- printf("EED mBarRange::onKey code:%d\n", event.GetKeyCode());
}
//------------------------------------
//Constructors & Destructors
//------------------------------------
- mBarRange(wxWindow *parent, int w, int h/*, bool theOrientation, bool useWithActualDrawed*/);
+ mBarRange(wxWindow *parent, int w, int h);
~mBarRange();
//------------------------------------
// Bar Methods