'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoXtComponent(3IV) .SH NAME SoXtComponent \(em abstract base class for all Inventor Xt components .SH INHERITS FROM SoXtComponent .SH SYNOPSIS .ps -1 \*(Cr#include .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crtypedef void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoXtComponentCB\*(Cr(void *userData, SoXtComponent *comp) .sp .in 1i \f1Methods from class SoXtComponent: .in 0.5i .sp .ta 24m .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbshow\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbhide\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisVisible\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisTopLevelShell\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetShellWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetParentWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetSize\*(Cr(const SbVec2s &size) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbVec2s .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetSize\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrDisplay * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDisplay\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetTitle\*(Cr(const char *newTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTitle\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetIconTitle\*(Cr(const char *newIconTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetIconTitle\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetWindowCloseCallback\*(Cr(SoXtComponentCB *func, void *data = NULL) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crstatic SoXtComponent * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetComponent\*(Cr(Widget w) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidgetName\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassName\*(Cr() const .sp .SH DESCRIPTION Abstract base class from which all Inventor Xt components are derived. This class provides a basic C++ protocol for building and displaying Motif components. Components are used to encapsulate some function \&or task into a reusable package in the form of a Motif widget that can be used in any Inventor Xt program. See the Example section on how to build and use \*(CbSoXtComponents\f1. .SH METHODS .ta 24m .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbshow\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbhide\*(Cr() .br .in 1i \f1This shows and hides the component. If this is a topLevelShell component, then \*(Cbshow()\f1 will Realize and Map the window, otherwise it will simply Manage the widget. \*(Cbhide()\f1 calls the appropriate unmap or unmanage routines. .sp In \&addition, \*(Cbshow()\f1 will also pop the component window to the top and de-iconify if necessary, to make sure the component is visible by the user. .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisVisible\*(Cr() .br .in 1i \f1Returns TRUE if this component is mapped onto the screen. For a component to be visible, it's widget and the shell containing this widget must be mapped (which is FALSE when the component is iconified). .sp Subclasses should call this routine before redrawing anything and in any sensor trigger methods. Calling this will check the current visibility (which is really cheap) and invoke the visibility changed \&callbacks if the state changes (see \*(CbaddVisibilityChangeCallback()\f1). .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidget\*(Cr() const .br .in 1i \f1This returns the base widget for this component. If the component created its own shell, this returns the topmost widget beneath the shell. Call \*(CbgetShellWidget()\f1 to obtain the shell. .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisTopLevelShell\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetShellWidget\*(Cr() const .br .in 1i \f1Returns TRUE if this component is a top level shell component (has its own window). Subclasses may use this to decide if they are allowed to resize themselves. Also method to return the shell widget (NULL \&if the shell hasn't been created by this component). .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetParentWidget\*(Cr() const .br .in 1i \f1Return the parent widget, be it a shell or not .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetSize\*(Cr(const SbVec2s &size) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbVec2s .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetSize\*(Cr() .br .in 1i \f1Convenience routines on the widget \(em setSize calls XtSetValue .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrDisplay * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDisplay\*(Cr() .br .in 1i \f1Returns the X display associated with this components widget. .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetTitle\*(Cr(const char *newTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTitle\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetIconTitle\*(Cr(const char *newIconTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetIconTitle\*(Cr() const .br .in 1i \f1The window and icon title can be set for topLevelShell components or components which are directly under a shell widget (i.e. components which have their own window). .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetWindowCloseCallback\*(Cr(SoXtComponentCB *func, void *data = NULL) .br .in 1i \f1Sets which callback to call when the user closes this component (double click in the upper left corner) \(em by default \*(Cbhide()\f1 is called on this component, unless a callback is set to something other than NULL. \&A pointer to this class will be passed as the callback data. .sp Note: this callback is supplied because the user may wish to delete this component when it is closed. .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crstatic SoXtComponent * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetComponent\*(Cr(Widget w) .br .in 1i \f1This returns the \*(CbSoXtComponent\f1 for this widget. If the widget is not an Inventor component, then NULL is returned. .sp .in 0.5i .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidgetName\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassName\*(Cr() const .br .in 1i \f1Routines which return the widget name and the class name. The widget name is passed to the build method. The class name is predefined by each component. These names are used when retrieving X resource values \&for the component. .sp .in 0.5i .SH EXAMPLE This example shows how an Inventor component can be built inside a program using the Xt widget set. The example uses the \*(CbSoXtExaminerViewer\f1 widget to view some simple geometry. .nf .in 1i \*(Cr #include #include #include void main(int, char **argv) { // Initialize Inventor and Xt, which must be done // before any Inventor calls are made. Widget myWindow = SoXt::init(argv[0]); // create the viewer in the toplevel window // and set some scene to display SoXtExaminerViewer *myViewer = new SoXtExaminerViewer(myWindow); myViewer->setSceneGraph( new SoCone() ); // manage and map window on screen myViewer->show(); SoXt::show(myWindow); // calls XtRealizeWidget() // Loop forever SoXt::mainLoop(); } \f1 .fi .in 0.5i .SH SEE ALSO \*(CbSoXt, SoXtRenderArea, SoXtViewer, SoXtMaterialEditor