Commit c04e92f6 authored by Eric Petit's avatar Eric Petit

beos/PreferencesWindow*:

  + Cleaned a bit the way the prefs are created
  + Added missing CONFIG_ITEM_KEY implementation
parent 78ffa46b
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PreferencesWindow.h * PreferencesWindow.h
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PreferencesWindow.h,v 1.17 2003/05/25 17:21:36 titer Exp $ * $Id: PreferencesWindow.h,v 1.18 2003/12/21 21:30:43 titer Exp $
* *
* Authors: Eric Petit <titer@videolan.org> * Authors: Eric Petit <titer@videolan.org>
* *
...@@ -52,64 +52,76 @@ class StringItemWithView : public BStringItem ...@@ -52,64 +52,76 @@ class StringItemWithView : public BStringItem
char * fText; char * fText;
}; };
class ConfigTextControl : public BTextControl class ConfigWidget : public BView
{ {
public: public:
ConfigTextControl( BRect rect, char * label, ConfigWidget( BRect rect, int type, char * configName );
int type, char * configName ) virtual void Apply( intf_thread_t * p_intf, bool doIt ) = 0;
: BTextControl( rect, "ConfigTextControl", label,
"", new BMessage() )
{
fConfigType = type;
fConfigName = strdup( configName );
}
protected:
int fConfigType; int fConfigType;
char * fConfigName; char * fConfigName;
}; };
class ConfigCheckBox : public BCheckBox class ConfigTextControl : public ConfigWidget
{ {
public: public:
ConfigCheckBox( BRect rect, char * label, ConfigTextControl( BRect rect, int type, char * label,
char * configName ) char * configName );
: BCheckBox( rect, "ConfigCheckBox", label, void Apply( intf_thread_t * p_intf, bool doIt );
new BMessage() )
{
fConfigName = strdup( configName );
}
char * fConfigName; private:
BTextControl * fTextControl;
}; };
class ConfigMenuField : public BMenuField class ConfigCheckBox : public ConfigWidget
{ {
public: public:
ConfigMenuField( BRect rect, char * label, ConfigCheckBox( BRect rect, int type, char * label,
BPopUpMenu * popUp, char * configName ) char * configName );
: BMenuField( rect, "ConfigMenuField", label, void Apply( intf_thread_t * p_intf, bool doIt );
popUp, new BMessage() )
{
fConfigName = strdup( configName );
}
char * fConfigName; private:
BCheckBox * fCheckBox;
}; };
class ConfigSlider : public BSlider class ConfigMenuField : public ConfigWidget
{ {
public: public:
ConfigSlider( BRect rect, char * label, int type, ConfigMenuField( BRect rect, int type, char * label,
int min, int max, char * configName ) char * configName, char ** list );
: BSlider( rect, "ConfigSlider", label, void Apply( intf_thread_t * p_intf, bool doIt );
new BMessage(), min, max )
{
fConfigType = type;
fConfigName = strdup( configName );
}
int fConfigType; private:
char * fConfigName; BPopUpMenu * fPopUpMenu;
BMenuField * fMenuField;
};
class ConfigSlider : public ConfigWidget
{
public:
ConfigSlider( BRect rect, int type, char * label,
char * configName, int min, int max );
void Apply( intf_thread_t * p_intf, bool doIt );
private:
BSlider * fSlider;
};
class ConfigKey : public ConfigWidget
{
public:
ConfigKey( BRect rect, int type, char * label,
char * configName );
void Apply( intf_thread_t * p_intf, bool doIt );
private:
BStringView * fStringView;
BCheckBox * fAltCheck;
BCheckBox * fCtrlCheck;
BCheckBox * fShiftCheck;
BPopUpMenu * fPopUpMenu;
BMenuField * fMenuField;
}; };
class PreferencesWindow : public BWindow class PreferencesWindow : public BWindow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment