Class to build a generalized dialog box. More...
#include <Inventor/dialog/PoXtDialog.h>
Classes | |
struct | PoXtDialogDataCB |
Dialog callback data structure. More... | |
Public Types | |
typedef void | PoXtDialogCB (void *userData, const PoXtDialogDataCB *data) |
Public Member Functions | |
PoXtDialog (SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, int numXtElt=0, const PoXtElementData **elts=NULL) | |
~PoXtDialog () | |
void | setValues (int numXtElt, const PoXtElementData **elts) |
const PoXtElementData ** | getValues (int &numXtElt) const |
void | set1Value (int index, const PoXtElementData *elt) |
const PoXtElementData * | get1Value (int index) const |
void | insert1Value (int index, const PoXtElementData *elt) |
void | insertNValues (int index, int numElt, const PoXtElementData **elt) |
void | delete1Value (int index) |
void | deleteNValues (int index, int numElt) |
void | windowResizeByXtElement (SbBool flag) |
SbBool | isWindowResizeByXtElement () const |
void | setVerticalScrollbar (SbBool visible) |
SbBool | isVerticalScrollbar () const |
void | addValueChangedCallback (PoXtDialogCB *function, void *userData=NULL) |
void | removeValueChangedCallback (PoXtDialogCB *function, void *userData=NULL) |
virtual void | show () |
virtual void | hide () |
Class to build a generalized dialog box which can contain real sliders, integer sliders, toggle buttons, choice buttons, trigger buttons, labels, and editable texts. The type of the elements (called Xt elements) contained in the dialog box are specified by the application and all these elements are displayed underneath each other. The Xt elements in the dialog box are indexed from 0 (at the top of the dialog box) to N - 1 (at the bottom of the dialog box), N is the number of Xt elements.
One or several callbacks can be attached to this dialog box. These callbacks are called each time one of its Xt elements receives a keyboard or a mouse event.
Win32 note: This component can't be displayed embedded within an MFC panel.
RESOURCES
Resources for dialog box: *PoXtDialog.dialogForm Form widget of the dialog box. *PoXtDialog.dialogForm.Frame Frame widget of each Xt element. Resources for Xt elements: *PoXtDialog.dialogForm.Frame.< Name of the Xt element resource > < Name of the Xt element resource > is a form widget. Example for slider resources: *PoXtDialog.dialogForm.Frame.PoXtSlider Resources for sliders: *PoXtSlider.PoXtLabel Cf PoXtLabel resources. *PoXtSlider.sliderText Text widget. *PoXtSlider.toogle Toggle widget. Resources for trigger buttons: *PoXtTriggerButton.PoXtLabel Cf PoXtLabel resources. *PoXtTriggerButton.trigger Button widget. Resources for toggle buttons: *PoXtToggleButton.PoXtLabel Cf PoXtLabel resources. *PoXtToggleButton.toogle Toggle widget. Resources for edit texts: *PoXtEditText.PoXtLabel Cf PoXtLabel resources. *PoXtEditText.editText Text widget. Resources for choice buttons: *PoXtChoiceButton.choiceList Form widget. *PoXtChoiceButton.choiceList.choiceListArrow Arrow widget. *PoXtChoiceButton.choiceList.choiceListEdit Text widget. *PoXtChoiceButton.choiceList.choiceListPopup Popup shell widget. *PoXtChoiceButton.choiceList.choiceListPopup.ChoiceListListPopup Scrolled list widget. Resources labels: *PoXtLabel.label Text widget.
typedef void PoXtDialog::PoXtDialogCB(void *userData, const PoXtDialogDataCB *data) |
Prototype of the callBack function.
PoXtDialog::PoXtDialog | ( | SoWidget | parent = NULL , |
|
const char * | name = NULL , |
|||
SbBool | buildInsideParent = TRUE , |
|||
int | numXtElt = 0 , |
|||
const PoXtElementData ** | elts = NULL | |||
) |
Constructor specifying the number and the list of the Xt elements to be built inside the dialog box.
PoXtDialog::~PoXtDialog | ( | ) |
Destructor.
void PoXtDialog::addValueChangedCallback | ( | PoXtDialogCB * | function, | |
void * | userData = NULL | |||
) |
Adds callbacks which are called each time an Xt element receives a keyboard or a mouse event.
void PoXtDialog::delete1Value | ( | int | index | ) |
Deletes the Xt element at the specified index.
void PoXtDialog::deleteNValues | ( | int | index, | |
int | numElt | |||
) |
Deletes numElt Xt elements from the specified index.
const PoXtElementData* PoXtDialog::get1Value | ( | int | index | ) | const |
Gets the index'th Xt element in the dialog box.
Returns NULL if index is invalid. Although the pointer returned by get1Value is constant, the application can call all the methods of PoXtElementData class (and its derived class). Be careful, changing a label by using the method PoXtElementData::setLabel can cause the dialog box to no longer be aligned. In this case, use the set1Value method to force the dialog box to be re-aligned (see example 2 below). In any case, you must not delete the pointer returned by get1Value.
// Example 1: // Example to change the value of a real slider to 0.5 // using the method get1Value ... PoXtRealSliderData *slider = (PoXtRealSlider * dialog->get1Value(SLIDER_INDEX); slider->setValue(0.5) ; ... // Example 2: // Example to change the value of a real slider to 0.5 // using the method set1Value ... PoXtRealSliderData *slider = (PoXtRealSlider * dialog->get1Value(SLIDER_INDEX).copy() ; slider->setValue(0.5) ; dialog->set1Value(SLIDER_INDEX, (PoXtElementData *)slider) ; ...
const PoXtElementData** PoXtDialog::getValues | ( | int & | numXtElt | ) | const |
Gets the number and the list of Xt elements to build/be built inside the dialog box.
virtual void PoXtDialog::hide | ( | ) | [virtual] |
Hides the component.
Calls the appropriate unmap or unmanage routines.
Reimplemented from SoXtComponent.
void PoXtDialog::insert1Value | ( | int | index, | |
const PoXtElementData * | elt | |||
) |
Inserts the specified Xt element at the specified index.
void PoXtDialog::insertNValues | ( | int | index, | |
int | numElt, | |||
const PoXtElementData ** | elt | |||
) |
Inserts numElt Xt elements at the specified index.
SbBool PoXtDialog::isVerticalScrollbar | ( | ) | const |
Gets vertical scroll bar visibility.
SbBool PoXtDialog::isWindowResizeByXtElement | ( | ) | const |
Indicates if the window is resized or not when Xt elements are inserted or removed.
void PoXtDialog::removeValueChangedCallback | ( | PoXtDialogCB * | function, | |
void * | userData = NULL | |||
) |
Removes callbacks which are called each time an Xt element receives a keyboard or a mouse event.
void PoXtDialog::set1Value | ( | int | index, | |
const PoXtElementData * | elt | |||
) |
Sets the index'th Xt element in the dialog box.
void PoXtDialog::setValues | ( | int | numXtElt, | |
const PoXtElementData ** | elts | |||
) |
Sets the number and the list of Xt elements to build/be built inside the dialog box.
void PoXtDialog::setVerticalScrollbar | ( | SbBool | visible | ) |
Sets vertical scroll bar visibility.
By default, there is no vertical scrollbar.
virtual void PoXtDialog::show | ( | ) | [virtual] |
Shows the component.
If this is a topLevelShell component, then show() will Realize and Map the window, otherwise it will simply Manage the widget. In addition, show() will also pop the component window to the top and de-iconify if necessary, to make sure the component is visible by the user.
Reimplemented from SoXtComponent.
void PoXtDialog::windowResizeByXtElement | ( | SbBool | flag | ) |
Specifies if the dialog box is resized when Xt elements are inserted or suppressed (each Xt element keeps the same size in the dialog box), or if the window keeps its size whatever insertions or removals there may be (each XtElement becomes smaller or larger).