Program: bbtk
Module: $RCSfile: bbwxSlider.cxx,v $
Language: C++
- Date: $Date: 2009/03/30 14:42:28 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2009/04/16 14:17:50 $
+ Version: $Revision: 1.22 $
=========================================================================*/
/* ---------------------------------------------------------------------
void RefreshLabels();
private:
- Slider* mBox;
- wxSlider *mwxSlider;
- wxSlider *mResolutionOfSlider;
- int min;
- int max;
- bool reactiveOnTrack;
- wxStaticText *label_vertical;
- wxStaticText *label_min;
- wxStaticText *label_max;
+ Slider* mBox;
+ wxSlider *mwxSlider;
+ wxSlider *mResolutionOfSlider;
+ int min;
+ int max;
+ bool reactiveOnTrack;
+ wxStaticText *label_vertical;
+ wxStaticText *label_min;
+ wxStaticText *label_max;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
sizer = new wxFlexGridSizer(2);
if (title!=_T(""))
{
- sizer -> Add( new wxStaticText(panel,-1, title ) );
- sizer -> Add( new wxStaticText(panel,-1, _T("") ) );
+ sizer->Add( new wxStaticText(panel,-1, title ) );
+ sizer->Add( new wxStaticText(panel,-1, _T("") ) );
}
}
else
sizer = new wxFlexGridSizer(1);
if (title!=_T(""))
{
- sizer -> Add( new wxStaticText(panel,-1, title ) );
+ sizer->Add( new wxStaticText(panel,-1, title ) );
}
}
- sizer -> Add( mwxSlider,1,wxGROW );
- sizer -> AddGrowableCol(0);
+ sizer->Add( mwxSlider,1,wxGROW );
+ sizer->AddGrowableCol(0);
if (mResolutionOfSlider!=NULL)
{
- sizer -> Add( mResolutionOfSlider );
+ sizer->Add( mResolutionOfSlider );
}
}
else
label_max = new wxStaticText(panel,-1,_T(""));
if (title!=_T(""))
{
- sizer -> Add( new wxStaticText(panel,-1, title ) );
- sizer -> AddGrowableRow(3);
+ sizer->Add( new wxStaticText(panel,-1, title ) );
+ sizer->AddGrowableRow(3);
}
else
{
- sizer -> AddGrowableRow(2);
+ sizer->AddGrowableRow(2);
}
- sizer -> Add( label_vertical );
- sizer -> Add( label_min );
- sizer -> Add( mwxSlider,1,wxGROW );
- sizer -> Add( label_max );
+ sizer->Add( label_vertical );
+ sizer->Add( label_min );
+ sizer->Add( mwxSlider,1,wxGROW );
+ sizer->Add( label_max );
if (mResolutionOfSlider!=NULL)
{
- sizer -> Add( mResolutionOfSlider );
+ sizer->Add( mResolutionOfSlider );
}
}
else
{
if (title!=_T(""))
{
- sizer -> Add( new wxStaticText(panel,-1, title ) );
- sizer -> AddGrowableRow(1);
+ sizer->Add( new wxStaticText(panel,-1, title ) );
+ sizer->AddGrowableRow(1);
}
else
{
- sizer -> AddGrowableRow(0);
+ sizer->AddGrowableRow(0);
}
- sizer -> Add( mwxSlider,1,wxGROW );
+ sizer->Add( mwxSlider,1,wxGROW );
if (mResolutionOfSlider!=NULL)
{
- sizer -> Add( mResolutionOfSlider );
+ sizer->Add( mResolutionOfSlider );
}
}
}
//-------------------------------------------------------------------------
void SliderWidget::OnResolutionOfSlider(wxScrollEvent& event)
{
- int value = mwxSlider->GetValue();
- int delta = (int) (pow( 4 , mResolutionOfSlider->GetValue() ));
- int minTmp = value - delta/2;
- int maxTmp = value + delta/2;
+ int value = mwxSlider->GetValue();
+ int delta = (int) (pow( 4 , mResolutionOfSlider->GetValue() ));
+ int minTmp = value - delta/2;
+ int maxTmp = value + delta/2;
if (minTmp<min)
{
minTmp = min;
mBox->bbSetOutputOut( mwxSlider->GetValue() );
mBox->bbSetInputIn( mwxSlider->GetValue() );
// and signal that the output has changed
- mBox->bbSignalOutputModification(std::string("Out"));
+ mBox->bbSignalOutputModification(std::string("Out"));
}
RefreshLabels();
}
mBox->bbSetOutputOut( mwxSlider->GetValue() );
mBox->bbSetInputIn( mwxSlider->GetValue() );
// and signal that the output has changed
- mBox->bbSignalOutputModification(std::string("Out"));
+ mBox->bbSignalOutputModification(std::string("Out"));
}
//-------------------------------------------------------------------------