--- gigedit/trunk/src/paramedit.cpp 2007/03/24 11:55:06 1116 +++ gigedit/trunk/src/paramedit.cpp 2007/03/24 13:05:58 1117 @@ -89,11 +89,44 @@ void NumEntryGain::set_dimreg(gig::DimensionRegion* dimreg) { this->dimreg = 0; - set_value(dimreg->Gain / -655360.0); + bool plus6 = dimreg->Gain < 0; + set_value(plus6 ? 0 : dimreg->Gain / -655360.0); + set_sensitive(!plus6); this->dimreg = dimreg; } +BoolEntryPlus6::BoolEntryPlus6(char* labelText, NumEntryGain& eGain) : + LabelWidget(labelText, checkbutton), + eGain(eGain) +{ + checkbutton.signal_toggled().connect( + sigc::mem_fun(*this, &BoolEntryPlus6::value_changed)); +} + +void BoolEntryPlus6::value_changed() +{ + if (dimreg && update_gui) { + bool plus6 = checkbutton.get_active(); + if (plus6) { + eGain.set_value(0); + dimreg->Gain = 6 * -655360; + } else { + if (dimreg->Gain < 0) { + dimreg->Gain = 0; + } + } + eGain.set_sensitive(!plus6); + } +} + +void BoolEntryPlus6::set_dimreg(gig::DimensionRegion* dimreg) +{ + this->dimreg = 0; + checkbutton.set_active(dimreg->Gain < 0); + this->dimreg = dimreg; +} + NumEntryPermille::NumEntryPermille(char* labelText, uint16_t gig::DimensionRegion::* param, double lower, double upper, int decimals) : @@ -163,28 +196,6 @@ return true; } -BoolEntry::BoolEntry(char* labelText, bool gig::DimensionRegion::* param) : - LabelWidget(labelText, checkbutton), - param(param) -{ - checkbutton.signal_toggled().connect( - sigc::mem_fun(*this, &BoolEntry::value_changed)); -} - -void BoolEntry::value_changed() -{ - if (dimreg && update_gui) { - dimreg->*param = checkbutton.get_active(); - } -} - -void BoolEntry::set_dimreg(gig::DimensionRegion* dimreg) -{ - this->dimreg = 0; - checkbutton.set_active(dimreg->*param); - this->dimreg = dimreg; -} - ChoiceEntryLeverageCtrl::ChoiceEntryLeverageCtrl( char* labelText, gig::leverage_ctrl_t gig::DimensionRegion::* param) :