class FieldEditor : public SoXtComponent

This SoXtComponent builds a generic dialog for the fields one nodes

Inheritance:


Public Methods

FieldEditor(SoNode *node, Widget parent = NULL, const char *name = NULL)
Constructor
static int getNumFields(SoNode *node)
the check to be made before an editor is constructed.
void setFinishCallback(FieldEditorCB *cb, const void *userData = NULL)
Sets a callback to call when editing is finished.
~FieldEditor()
Destructor

Private Fields

struct FieldInfo *fieldInfos
Widgets/data for each field
SoNode* defNode
Same type of node with default vals
FieldEditorCB* finishCB
Finish callback (NULL if none)
void* finishData
User data for callback
SoNodeSensor* nodeSensor
Sensor on edited node
SoNode* nodeToEdit
Node whose fields we are editing
int numFields
Number of fields in node

Private Methods

void revert(int fieldIndex = -1)
Sets field editor based on the values in the node being edited
void updateLineNumbers(FieldInfo *info, SbBool textChanged)
Updates the line-number widget whenever the text area changes or is scrolled

Private

Building Widgets
Widget buildWidget(Widget parent)
Builds all widgets
Widget buildFieldForm(Widget parent)
Creates and returns a widget containing all field-editing widgets
void buildFieldWidget(Widget parent, FieldInfo *info)
Creates a widget for editing one field
Widget buildMultipleValueWidget(Widget parent, FieldInfo *info)
Creates the widget for editing a multiple- or single-value field
Widget buildSingleValueWidget(Widget parent, FieldInfo *info)
Widget buildButtonWidget(Widget parent)
Creates and returns a widget containing buttons
Callbacks
Button Pressed Callbacks
Callback for when a button is pressed or other action occurs
static void applyButtonCB(Widget, XtPointer, XtPointer)
static void revertButtonCB(Widget, XtPointer, XtPointer)
static void cancelButtonCB(Widget, XtPointer, XtPointer)
static void defaultButtonCB(Widget, XtPointer, XtPointer)
static void textChangedCB(Widget, XtPointer, XtPointer)
static void lineCB(Widget, XtPointer, XtPointer)
static void* reallocBuf(void *ptr, size_t newSize)
Reallocates fieldBuf and sets fieldBufSize
static void readErrorCB(const SoError *error, void *data)
Callback for read errors that occur when a field's value is set
Operations on fields
These all operate on one field of the node
void updateInfo(FieldInfo *info)
Sets up field editor from correct field in node being edited
void showDefaultValue(FieldInfo *info)
Makes field editor show default value for given field
void showFieldString(FieldInfo *info)
Sets string in text widget to display field values
void showScale(FieldInfo *info)
Updates scale value and display for multiple-value field based on current editor settings (NOT what is in the node!)
void changeScale(FieldInfo *info, int value)
Changes scale value for field to given value
void updateNode(FieldInfo *info)
Updates field value and flags in node from current editor settings
void getFieldString(FieldInfo *info, SbString &string)
Fills in SbString with text containing field value
void getEditorString(FieldInfo *info, SbString &string)
Fills in SbString with text containing current field value from editor

Documentation

This SoXtComponent builds a generic dialog for the fields one nodes.

FieldEditor(SoNode *node, Widget parent = NULL, const char *name = NULL)
Constructor. Takes pointer to node whose fields we are to edit, along with parent and widget name

~FieldEditor()
Destructor

static int getNumFields(SoNode *node)
the check to be made before an editor is constructed.

void setFinishCallback(FieldEditorCB *cb, const void *userData = NULL)
Sets a callback to call when editing is finished.

SoNode* nodeToEdit
Node whose fields we are editing

SoNode* defNode
Same type of node with default vals

FieldEditorCB* finishCB
Finish callback (NULL if none)

void* finishData
User data for callback

SoNodeSensor* nodeSensor
Sensor on edited node

int numFields
Number of fields in node

struct FieldInfo *fieldInfos
Widgets/data for each field

Building Widgets

Widget buildWidget(Widget parent)
Builds all widgets

Widget buildFieldForm(Widget parent)
Creates and returns a widget containing all field-editing widgets

void buildFieldWidget(Widget parent, FieldInfo *info)
Creates a widget for editing one field

Widget buildMultipleValueWidget(Widget parent, FieldInfo *info)
Creates the widget for editing a multiple- or single-value field

Widget buildSingleValueWidget(Widget parent, FieldInfo *info)

Widget buildButtonWidget(Widget parent)
Creates and returns a widget containing buttons

void revert(int fieldIndex = -1)
Sets field editor based on the values in the node being edited. If the passed field index is not -1 (the default), only the value for the specified field is reverted.

Operations on fields
These all operate on one field of the node

void updateInfo(FieldInfo *info)
Sets up field editor from correct field in node being edited

void showDefaultValue(FieldInfo *info)
Makes field editor show default value for given field. Does NOT change the node at all!

void showFieldString(FieldInfo *info)
Sets string in text widget to display field values. If it's a multiple-value field, it also sets the scale and related strings.

void showScale(FieldInfo *info)
Updates scale value and display for multiple-value field based on current editor settings (NOT what is in the node!)

void changeScale(FieldInfo *info, int value)
Changes scale value for field to given value

void updateNode(FieldInfo *info)
Updates field value and flags in node from current editor settings

void getFieldString(FieldInfo *info, SbString &string)
Fills in SbString with text containing field value

void getEditorString(FieldInfo *info, SbString &string)
Fills in SbString with text containing current field value from editor

void updateLineNumbers(FieldInfo *info, SbBool textChanged)
Updates the line-number widget whenever the text area changes or is scrolled. The textChanged flag indicates why the line number may be changing.

Callbacks

Button Pressed Callbacks
Callback for when a button is pressed or other action occurs

static void applyButtonCB(Widget, XtPointer, XtPointer)

static void revertButtonCB(Widget, XtPointer, XtPointer)

static void cancelButtonCB(Widget, XtPointer, XtPointer)

static void defaultButtonCB(Widget, XtPointer, XtPointer)

static void textChangedCB(Widget, XtPointer, XtPointer)

static void lineCB(Widget, XtPointer, XtPointer)

static void* reallocBuf(void *ptr, size_t newSize)
Reallocates fieldBuf and sets fieldBufSize

static void readErrorCB(const SoError *error, void *data)
Callback for read errors that occur when a field's value is set


This class has no child classes.
Author:
Silicon Graphics Inc., extensions by Andreas Lücke
Version:
0.0
See Also:
GraphViewer

alphabetic index hierarchy of classes


This page is part of the tsKit's reference manual by Andreas Lücke.
Back to tsKit-Home

generated by doc++