NAME
BtGuiWidget - Base class for btgui-widgets.
INCLUDE
include "BtGuiWidget.h"
SYNTAX
class BtGuiWidget : public virtual BtGuiBase
{
// Tcl name of widget
String widgetName_;
// Widget options (used to store options until widget is created).
String widget_options_;
// Options for the geometry management command: pack
String pack_options_;
// Options for the geometry management command: place
String place_options_;
protected:
// Indicates if the widget is created (i.e. Tcl/Tk knows about it)
bool is_created_;
// Set options collected so far (normally used by create)
bool setOptions();
// Returns the tk-path of a subwidget (relevant for TiX meta widgets).
String subwidget(const String& name);
public:
BtGuiWidget(const BtGuiTkInterpreter& interf, const String& name="");
BtGuiWidget(const BtGuiTkInterpreter& interf, const BtGuiWidget& parent,
const String& name="");
~BtGuiWidget();
inline String widgetName() const;
virtual void attachToTkWidget(const String& name);
// Create widget
virtual bool create() = 0;
// Widget options
virtual bool widgetOption(const String& option, const String& value);
virtual bool widgetOption(const String& option, int value);
virtual bool widgetOption(const String& option, real value);
virtual String getWidgetOption(const String& option);
// Perform a widget command.
virtual String widgetCommand (const String& cmd);
virtual String widgetCommand (const String& cmd, const String& args);
virtual String widgetCommand (const String& cmd, const String& widgetName,
const String& args);
// Geometry management
virtual bool pack();
virtual bool place();
virtual bool packOption (const String& option, const String& value);
virtual bool packOption (const String& option, int value);
virtual bool packOption (const String& option, real value);
virtual bool placeOption (const String& option, const String& value);
virtual bool placeOption (const String& option, int value);
virtual bool placeOption (const String& option, real value);
// Unmap widget
virtual void destroy();
};
KEYWORDS
gui interface, tcl/tk
DESCRIPTION
This class contains
CONSTRUCTORS AND INITIALIZATION
In order to create an instance of this class one must provide a
btgui-interpreter object to the constructor. In addition two
optional arguments may be given, a parent widget and a name for
the widget. It is important that the parents create() command is
called before the create() command of a child.
MEMBER FUNCTIONS
widgetName --\
attachToTkWidget --\
create --\
widgetOption --\
getWidgetOption --\
widgetCommand --\
pack --\
place --\
packOption --\
placeOption --\
destroy --\
AUTHOR
Trond Vidar Stensby, SINTEF Applied Mathematics