mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
Some WrappedType members just for radio buttons are no longer needed
This commit is contained in:
parent
c8a8c6a3fa
commit
89f3369556
@ -1463,7 +1463,13 @@ wxRadioButton * ShuttleGuiBase::TieRadioButton(const wxString &Prompt, WrappedTy
|
|||||||
mpWind = pRadioButton = safenew wxRadioButton(GetParent(), miId, Prompt,
|
mpWind = pRadioButton = safenew wxRadioButton(GetParent(), miId, Prompt,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
(mRadioCount==1)?wxRB_GROUP:0);
|
(mRadioCount==1)?wxRB_GROUP:0);
|
||||||
pRadioButton->SetValue(WrappedRef.ValuesMatch( *mRadioValue ));
|
|
||||||
|
wxASSERT( WrappedRef.IsString() );
|
||||||
|
wxASSERT( mRadioValue->IsString() );
|
||||||
|
const bool value =
|
||||||
|
(WrappedRef.ReadAsString() == mRadioValue->ReadAsString() );
|
||||||
|
pRadioButton->SetValue( value );
|
||||||
|
|
||||||
pRadioButton->SetName(wxStripMenuCodes(Prompt));
|
pRadioButton->SetName(wxStripMenuCodes(Prompt));
|
||||||
UpdateSizers();
|
UpdateSizers();
|
||||||
}
|
}
|
||||||
@ -1476,9 +1482,7 @@ wxRadioButton * ShuttleGuiBase::TieRadioButton(const wxString &Prompt, WrappedTy
|
|||||||
pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
|
pRadioButton = wxDynamicCast(pWnd, wxRadioButton);
|
||||||
wxASSERT( pRadioButton );
|
wxASSERT( pRadioButton );
|
||||||
if( pRadioButton->GetValue() )
|
if( pRadioButton->GetValue() )
|
||||||
{
|
mRadioValue->WriteToAsString( WrappedRef.ReadAsString() );
|
||||||
mRadioValue->WriteToAsWrappedType( WrappedRef );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -37,62 +37,6 @@ bool WrappedType::IsString()
|
|||||||
return eWrappedType == eWrappedString;
|
return eWrappedType == eWrappedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @param W Wrapped type to compare
|
|
||||||
/// @return true iff types and values are the same.
|
|
||||||
bool WrappedType::ValuesMatch( const WrappedType & W )
|
|
||||||
{
|
|
||||||
if( W.eWrappedType != eWrappedType )
|
|
||||||
return false;
|
|
||||||
switch( eWrappedType )
|
|
||||||
{
|
|
||||||
case eWrappedString:
|
|
||||||
return *W.mpStr == *mpStr;
|
|
||||||
break;
|
|
||||||
case eWrappedInt:
|
|
||||||
return *W.mpInt == *mpInt;
|
|
||||||
break;
|
|
||||||
case eWrappedDouble:
|
|
||||||
return *W.mpDouble == *mpDouble;
|
|
||||||
break;
|
|
||||||
case eWrappedBool:
|
|
||||||
return *W.mpBool == *mpBool;
|
|
||||||
break;
|
|
||||||
case eWrappedEnum:
|
|
||||||
wxASSERT( false );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wxASSERT( false );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WrappedType::WriteToAsWrappedType( const WrappedType & W )
|
|
||||||
{
|
|
||||||
wxASSERT( W.eWrappedType == eWrappedType );
|
|
||||||
switch( eWrappedType )
|
|
||||||
{
|
|
||||||
case eWrappedString:
|
|
||||||
*mpStr = *W.mpStr;
|
|
||||||
break;
|
|
||||||
case eWrappedInt:
|
|
||||||
*mpInt = *W.mpInt;
|
|
||||||
break;
|
|
||||||
case eWrappedDouble:
|
|
||||||
*mpDouble = *W.mpDouble;
|
|
||||||
break;
|
|
||||||
case eWrappedBool:
|
|
||||||
*mpBool = *W.mpBool;
|
|
||||||
break;
|
|
||||||
case eWrappedEnum:
|
|
||||||
wxASSERT( false );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wxASSERT( false );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxString WrappedType::ReadAsString()
|
wxString WrappedType::ReadAsString()
|
||||||
|
@ -59,9 +59,6 @@ public:
|
|||||||
void WriteToAsDouble( const double InDouble);
|
void WriteToAsDouble( const double InDouble);
|
||||||
void WriteToAsBool( const bool InBool);
|
void WriteToAsBool( const bool InBool);
|
||||||
|
|
||||||
bool ValuesMatch( const WrappedType & W );
|
|
||||||
void WriteToAsWrappedType( const WrappedType & W );
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
const teWrappedType eWrappedType;
|
const teWrappedType eWrappedType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user