Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

JezabelPanel Class Reference

A control panel containing JezabelWidgets, that can save and restore presets. More...

#include <jezabelpanel.h>

List of all members.

Public Methods

 JezabelPanel (const char *type, const char *instance, int flags=0, QWidget *_parent=0, WFlags f=0)
 Constructs a control panel (with no parent). More...

QWidget* mainArea ()
 Returns the main area of the panel, where the JezabelWidgets live. Children of this area are layed out vertically.

void registerControl (QString &name, int val, QObject *control, const char *signal, const char *slot)
 Register an integer-valued control (such as a slider), so that its value can be saved and restored. More...

void registerControl (QString &name, QString val, QObject *control, const char *signal, const char *slot)
 Register a QString control (such as a QLineEdit), so that its value can be saved and restored. More...

void start ()
 Indicates all controls have been registered and panel can start operation. Initializes values of controls.

void stop ()
 Saves current state by type and instance name. After this, you can register new controls and start().

 ~JezabelPanel ()
 Destructor saves current state by type and instance name.


Static Public Methods

JezabelPanel* find (QObject *thing)
 Find a JezabelPanel that is an ancestor of thing.


Detailed Description

A control panel containing JezabelWidgets, that can save and restore presets.

Here is a typical example of usage of JezabelPanel:

   JezabelApplication a( argc, argv );
   JezabelPanel *panel = new JezabelPanel("test_curve","current");
   JezabelWidget *foo = new JezabelCurve("curve",panel->mainArea());
   a.setMainWidget( panel );

This inserts a JezabelCurve widget in the panel and makes the panel the application's main widget.

The result looks like this:

curve-snap.png
JezabelWidgets that know about JezabelPanel automatically find their nearest ancestor that is a JezabelPanel and register their controls with this panel so that the control values can be saved and restored.

It's important to give each JezabelWidget within the panel a distinct name, so that it's preset values can be identified.

Examples:

test_fixedshelfeq.cpp, test_graphicfilter.cpp, test_ladspa.cpp, and test_variableshelfeq.cpp.


Constructor & Destructor Documentation

JezabelPanel::JezabelPanel ( const char * type,
const char * instance,
int flags = 0,
QWidget * _parent = 0,
WFlags f = 0 )
 

Constructs a control panel (with no parent).

Parameters:
type   The control panel type. This is an arbitrary name used to identity the type of the panel. Should be a unique string for each subclass of JezabelPanel. The type serves to locate the presets for this panel.
instance   A name for this instance of JezabelPanel. Instances that exist simultaneously or serve different purposes should have different names. The instance name is used to determine how to initialize the panel.


Member Function Documentation

void JezabelPanel::registerControl ( QString & name,
QString val,
QObject * control,
const char * signal,
const char * slot )
 

Register a QString control (such as a QLineEdit), so that its value can be saved and restored.

Parameters:
name   unique name for this control
val   the default initial value of the control
control   any QObject
signal   control sends this (with QString) when value changed
slot   control receives this (with QString) when value is to be changed

void JezabelPanel::registerControl ( QString & name,
int val,
QObject * control,
const char * signal,
const char * slot )
 

Register an integer-valued control (such as a slider), so that its value can be saved and restored.

Parameters:
name   unique name for this control
val   the default initial value of the control
control   any QObject
signal   control sends this (with int) when value changed
slot   control receives this (with int) when value is to be changed


The documentation for this class was generated from the following file:
Generated at Sun Jan 18 20:51:23 2004 for Jezabel by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001