Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoXtComponent Class Reference

Abstract base class for all Open Inventor components. More...

#include <Inventor/Xt/SoXtComponent.h>

+ Inheritance diagram for SoXtComponent:

Public Member Functions

virtual void show ()
 This shows the component.
 
virtual void hide ()
 This hides the component.
 
SbBool isVisible ()
 Returns TRUE if this component is mapped onto the screen.
 
SoWidget getWidget () const
 This returns the base widget for this component.
 
SbBool isTopLevelShell () const
 Returns TRUE if this component is a top level shell component (has its own window).
 
SoWidget getShellWidget () const
 Returns the shell widget (NULL if the shell hasn't been created by this component).
 
SoWidget getParentWidget () const
 Returns the parent widget, be it a shell or not.
 
void setSize (const SbVec2s &size)
 Convenience routine on the widget.
 
SbVec2s getSize ()
 Convenience routine on the widget.
 
SbBool setFullScreen (const SbBool enable)
 Switches the viewer into (or out of) fullscreen mode.
 
SbBool isFullScreen (void) const
 Queries if the viewer is in fullscreen mode.
 
void setFullScreenEnable (const SbBool enable)
 Enables/disables fullscreen mode.
 
SbBool isFullScreenEnable () const
 Queries if it is possible to put the viewer in fullscreen mode.
 
Display * getDisplay ()
 Returns the X display associated with this components widget.
 
SoNONUNICODE void setTitle (const char *newTitle)
 Sets window title.
 
void setTitle (const SbString &newTitle)
 Sets window title.
 
SbString getTitle () const
 Gets window title.
 
SoNONUNICODE void setIconTitle (const char *newIconTitle)
 Sets icon title.
 
void setIconTitle (const SbString &newIconTitle)
 Sets icon title.
 
SbString getIconTitle () const
 Gets icon title.
 
void setWindowCloseCallback (SoXtComponentCB *func, void *data=NULL)
 Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() is called on this component, unless a callback is set to something other than NULL.
 
SbString getWidgetName () const
 Returns the widget name.
 
SbString getClassName () const
 Returns the class name.
 

Static Public Member Functions

static void displayHelp (const char *filename, UINT contextID)
 Static method to display the specified topic of the specified help file.
 
static SoXtComponentgetComponent (SoWidget w)
 This returns the SoXtComponent for this widget.
 

Detailed Description

Abstract base class for all Open Inventor components.

Abstract base class from which all Open 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 Open Inventor Xt program. See the Example section on how to build and use SoXtComponents.

EXAMPLE

RESOURCES

      !!------------------------------------------------
      !! Xt Component ( For Light and Material Sliders Set )
      !!------------------------------------------------
      *IvXtComponentTitle.labelString: Xt Component
      *IvTGSXtComponentTitle.labelString: VSG: Xt Component
    

SEE ALSO

SoXt, SoXtRenderArea, SoXtViewer, SoXtMaterialEditor

Definition at line 144 of file SoXtComponent.h.

Member Function Documentation

◆ displayHelp()

static void SoXtComponent::displayHelp ( const char *  filename,
UINT  contextID 
)
static

Static method to display the specified topic of the specified help file.

This method can be used when the help file needs to be displayed from a user's application but the pointer to the viewer is not available. For example, in an MFC application where the method used to display the help file is not in the View class. Only a compiled HTML help file (.chm) can be displayed with this method.

◆ getClassName()

SbString SoXtComponent::getClassName ( ) const
inline

Returns the class name.

The class name is predefined by each component.

Definition at line 324 of file SoXtComponent.h.

◆ getComponent()

static SoXtComponent * SoXtComponent::getComponent ( SoWidget  w)
static

This returns the SoXtComponent for this widget.

If the widget does not match that of any Open Inventor component, then NULL is returned.

◆ getDisplay()

Display * SoXtComponent::getDisplay ( )
inline

Returns the X display associated with this components widget.

Definition at line 491 of file SoXtComponent.h.

◆ getIconTitle()

SbString SoXtComponent::getIconTitle ( ) const
inline

Gets icon title.

Definition at line 291 of file SoXtComponent.h.

◆ getParentWidget()

SoWidget SoXtComponent::getParentWidget ( ) const
inline

Returns the parent widget, be it a shell or not.

Definition at line 205 of file SoXtComponent.h.

◆ getShellWidget()

SoWidget SoXtComponent::getShellWidget ( ) const
inline

Returns the shell widget (NULL if the shell hasn't been created by this component).

Definition at line 200 of file SoXtComponent.h.

◆ getSize()

SbVec2s SoXtComponent::getSize ( )

Convenience routine on the widget.

◆ getTitle()

SbString SoXtComponent::getTitle ( ) const
inline

Gets window title.

Definition at line 267 of file SoXtComponent.h.

◆ getWidget()

SoWidget SoXtComponent::getWidget ( ) const
inline

This returns the base widget for this component.

If the component created its own shell, this returns the topmost widget beneath the shell. Call getShellWidget() to obtain the shell.

Definition at line 187 of file SoXtComponent.h.

◆ getWidgetName()

SbString SoXtComponent::getWidgetName ( ) const
inline

Returns the widget name.

The widget name is passed to the build method.

Definition at line 317 of file SoXtComponent.h.

◆ hide()

virtual void SoXtComponent::hide ( )
virtual

This hides the component.

Reimplemented in SoXtDirectionalLightEditor, SoXtMaterialEditor, and SoXtFullViewer.

◆ isFullScreen()

SbBool SoXtComponent::isFullScreen ( void  ) const

Queries if the viewer is in fullscreen mode.

◆ isFullScreenEnable()

SbBool SoXtComponent::isFullScreenEnable ( ) const

Queries if it is possible to put the viewer in fullscreen mode.

◆ isTopLevelShell()

SbBool SoXtComponent::isTopLevelShell ( ) const
inline

Returns 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.

Definition at line 194 of file SoXtComponent.h.

◆ isVisible()

SbBool SoXtComponent::isVisible ( )

Returns TRUE if this component is mapped onto the screen.

For a component to be visible, its widget and the shell containing this widget must be mapped (which is FALSE when the component is iconified).

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 addVisibilityChangeCallback()).

◆ setFullScreen()

SbBool SoXtComponent::setFullScreen ( const SbBool  enable)

Switches the viewer into (or out of) fullscreen mode.

◆ setFullScreenEnable()

void SoXtComponent::setFullScreenEnable ( const SbBool  enable)

Enables/disables fullscreen mode.

If fullscreen mode is disabled, it is not possible to activate fullscreen mode with the right mouse button popup menu.

◆ setIconTitle() [1/2]

SoNONUNICODE void SoXtComponent::setIconTitle ( const char *  newIconTitle)

Sets icon title.

The 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).

Non Unicode: This function should not be used in a Unicode application.

◆ setIconTitle() [2/2]

void SoXtComponent::setIconTitle ( const SbString newIconTitle)

Sets icon title.

The 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).

◆ setSize()

void SoXtComponent::setSize ( const SbVec2s size)

Convenience routine on the widget.

◆ setTitle() [1/2]

SoNONUNICODE void SoXtComponent::setTitle ( const char *  newTitle)

Sets window title.

The window title can be set for topLevelShell components or components which are directly under a shell widget (i.e. components which have their own window).

Non Unicode: This function should not be used in a Unicode application.

◆ setTitle() [2/2]

void SoXtComponent::setTitle ( const SbString newTitle)

Sets window title.

The window title can be set for topLevelShell components or components which are directly under a shell widget (i.e. components which have their own window).

◆ setWindowCloseCallback()

void SoXtComponent::setWindowCloseCallback ( SoXtComponentCB func,
void *  data = NULL 
)
inline

Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() 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.

Note: this callback is supplied because the user may wish to delete this component when it is closed.

Definition at line 304 of file SoXtComponent.h.

◆ show()

virtual void SoXtComponent::show ( )
virtual

This shows the component.

Reimplemented in SoXtDirectionalLightEditor, SoXtMaterialEditor, and SoXtSliderSetBase.


The documentation for this class was generated from the following file: