-void ConfigCheckBox::Apply( intf_thread_t * p_intf, bool doIt )
-{
- if( doIt )
- {
- config_PutInt( p_intf, fConfigName, fCheckBox->Value() );
- }
- else
- {
- fCheckBox->SetValue( config_GetInt( p_intf, fConfigName ) );
- }
-}
-
-ConfigMenuField::ConfigMenuField( BRect rect, int type, char * label,
- char * configName, char ** list )
- : ConfigWidget( BRect( rect.left, rect.top,
- rect.right, rect.top + 25 ),
- type, configName )
-{
- BMenuItem * menuItem;
-
- fPopUpMenu = new BPopUpMenu( "" );
- fMenuField = new BMenuField( Bounds(), NULL, label, fPopUpMenu );
-
- for( int i = 0; list[i]; i++ )
- {
- menuItem = new BMenuItem( list[i], new BMessage() );
- fPopUpMenu->AddItem( menuItem );
- }
-
- AddChild( fMenuField );
-}
-
-void ConfigMenuField::Apply( intf_thread_t * p_intf, bool doIt )
-{
- BMenuItem * menuItem;
-
- if( doIt )
- {
- menuItem = fPopUpMenu->FindMarked();
- if( menuItem )
- {
- config_PutPsz( p_intf, fConfigName, menuItem->Label() );
- }
- }
- else
- {
- char * value = config_GetPsz( p_intf, fConfigName );
- if( !value )
- {
- value = "";
- }
-
- for( int i = 0; i < fPopUpMenu->CountItems(); i++ )
- {
- menuItem = fPopUpMenu->ItemAt( i );
- if( !strcmp( value, menuItem->Label() ) )
- {
- menuItem->SetMarked( true );
- break;
- }
- }
- }
-}
-
-ConfigSlider::ConfigSlider( BRect rect, int type, char * label,
- char * configName, int min, int max )
- : ConfigWidget( BRect( rect.left, rect.top,
- rect.right, rect.top + 40 ),
- type, configName )
-{
- fSlider = new BSlider( Bounds(), NULL, label, new BMessage(),
- min, max, B_TRIANGLE_THUMB );
- AddChild( fSlider );
-}
-
-void ConfigSlider::Apply( intf_thread_t * p_intf, bool doIt )
-{
- switch( fConfigType )
- {
- case CONFIG_ITEM_INTEGER: