]> Creatis software - bbtk.git/blobdiff - packages/wx/src/bbwxSlider.cxx
MagicBox : support of data synchronization + various related fixes
[bbtk.git] / packages / wx / src / bbwxSlider.cxx
index 9066cb8b034a89965847715807a9766d7eec20c0..adb884da0dabb4f671b06ddc7342b3a3b615e805 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxSlider.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/02/10 14:56:50 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2009/03/30 14:42:28 $
+  Version:   $Revision: 1.21 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -74,6 +74,7 @@ namespace bbwx
     void OnResolutionOfSlider(wxScrollEvent& event);
 
     // Accessors
+    void SetValue(int v) { mwxSlider->SetValue(v); }
     int  GetValue() { return mwxSlider->GetValue(); }
     void SetRange(int min, int max);
     // Update the texts which display the min/max/current values of the slider
@@ -125,9 +126,9 @@ namespace bbwx
     long wxorientation=0;
     if (orientation==0) 
       {
-       sizeX           = 2;
-       sizeY           = 40;
-       wxorientation   = wxSL_HORIZONTAL;
+       sizeX                   = 2; 
+       sizeY                   = 40;
+       wxorientation           = wxSL_HORIZONTAL;
        if (labels==true)
          {
            wxlabels = wxSL_LABELS;
@@ -412,7 +413,15 @@ namespace bbwx
   //--------------------------------------------------------------------------
   void Slider::Process() 
   {
+    bbtkDebugMessage("process",3,
+                    "Slider "<<bbGetName()<<" input="
+                    <<bbGetInputIn()<<std::endl);
+   
     bbSetOutputOut( bbGetInputIn() );
+    if (bbGetOutputWidget()!=0)
+      {
+       ((SliderWidget*)bbGetOutputWidget())->SetValue(bbGetInputIn());
+      }
   }
 
   void Slider::CreateWidget(wxWindow* parent)