Abstract base class for all Open Inventor components. More...
#include <Inventor/Win/SoWinComponent.h>
Public Member Functions | |
virtual void | show () |
virtual void | hide () |
SbBool | isVisible () |
SoWidget | getWidget () const |
SbBool | isTopLevelShell () const |
SoWidget | getShellWidget () const |
SoWidget | getParentWidget () const |
void | setSize (const SbVec2s &size) |
SbVec2s | getSize () |
SbBool | setFullScreen (const SbBool enable) |
SbBool | isFullScreen () const |
void | setFullScreenEnable (const SbBool enable) |
SbBool | isFullScreenEnable (void) const |
UINT * | getDisplay () |
SoNONUNICODE void | setTitle (const char *newTitle) |
void | setTitle (const SbString &newTitle) |
SbString | getTitle () const |
SoNONUNICODE void | setIconTitle (const char *newIconTitle) |
void | setIconTitle (const SbString &newIconTitle) |
SbString | getIconTitle () const |
void | setWindowCloseCallback (SoWinComponentCB *func, void *data=NULL) |
SbString | getWidgetName () const |
SbString | getClassName () const |
Static Public Member Functions | |
SoDEPRECATED static SoNONUNICODE void | displayHelp (const char *filename, UINT contextID) |
static SoDEPRECATED void | displayHelp (const SbString &filename, UINT contextID) |
static SoWinComponent * | getComponent (SoWidget w) |
Public Attributes | |
SbString | helpFileName |
UINT | helpContextID |
SbString | helpContextString |
Friends | |
class | SoWinComponentP |
Abstract base class from which all Open Inventor Windows components are derived. This class provides a basic C++ protocol for building and displaying Windows components. Components are used to encapsulate some function or task into a reusable package in the form of a Windows window handle that can be used in any Open Inventor Windows program. See the Example section on how to build and use SoWinComponents.
#include <Inventor/Win/SoWin.h> #include <Inventor/nodes/SoCone.h> #include <Inventor/Win/viewers/SoWinExaminerViewer.h> void main(int, char* *argv) // Initialize Inventor and Windows, which must be done // before any Inventor calls are made. HWND myWindow = SoWin::init(argv[0]); // create the viewer in the toplevel window // and set some scene to display SoWinExaminerViewer *myViewer = new SoWinExaminerViewer(myWindow); myViewer->setSceneGraph( new SoCone() ); // manage and map window on screen myViewer->show(); SoWin::show(myWindow); // calls Show() // Loop forever SoWin::mainLoop();
SoWin, SoWinRenderArea, SoWinViewer, SoWinMaterialEditor
static SoDEPRECATED void SoWinComponent::displayHelp | ( | const SbString & | 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 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.
SoDEPRECATED static SoNONUNICODE void SoWinComponent::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 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.
SbString SoWinComponent::getClassName | ( | ) | const [inline] |
Returns the class name.
The class name is predefined by each component.
static SoWinComponent* SoWinComponent::getComponent | ( | SoWidget | w | ) | [static] |
Returns the SoWinComponent for this window handle.
If the window handle does not match that of any Open Inventor component, then NULL is returned.
UINT* SoWinComponent::getDisplay | ( | void | ) | [inline] |
Included for portability only.
SbString SoWinComponent::getIconTitle | ( | ) | const [inline] |
Included for portability only.
SoWidget SoWinComponent::getParentWidget | ( | ) | const [inline] |
Returns the parent window handle, be it a shell or not.
SoWidget SoWinComponent::getShellWidget | ( | ) | const [inline] |
Returns the shell window handle (NULL if the shell hasn't been created by this component).
SbVec2s SoWinComponent::getSize | ( | ) |
Convenience routine on the window handle.
Reimplemented in SoWinMPRenderArea, and SoWinViewer.
SbString SoWinComponent::getTitle | ( | ) | const [inline] |
Gets window title.
SoWidget SoWinComponent::getWidget | ( | void | ) | const [inline] |
This returns the base window handle for this component.
If the component created its own shell, this returns the topmost window handle beneath the shell. Call getShellWidget() to obtain the shell.
SbString SoWinComponent::getWidgetName | ( | ) | const [inline] |
Returns the window handle name.
The window handle name is passed to the build method.
virtual void SoWinComponent::hide | ( | ) | [virtual] |
This hides the component.
It calls the appropriate unrealize or unmanage routines.
Reimplemented in SoWinMPFullViewer, SoWinDirectionalLightEditor, SoWinMaterialEditor, and SoWinFullViewer.
SbBool SoWinComponent::isFullScreen | ( | ) | const |
Queries if the viewer is in fullscreen mode.
SbBool SoWinComponent::isFullScreenEnable | ( | void | ) | const |
Queries if it is possible to put the viewer in fullscreen mode.
SbBool SoWinComponent::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.
SbBool SoWinComponent::isVisible | ( | ) |
Returns TRUE if this component is mapped onto the screen.
For a component to be visible, its window handle and the shell containing this window handle 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()).
Switches the viewer into (or out of) fullscreen mode.
void SoWinComponent::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.
void SoWinComponent::setIconTitle | ( | const SbString & | newIconTitle | ) |
Included for portability only.
SoNONUNICODE void SoWinComponent::setIconTitle | ( | const char * | newIconTitle | ) |
Included for portability only.
void SoWinComponent::setSize | ( | const SbVec2s & | size | ) |
Convenience routine on the window handle.
void SoWinComponent::setTitle | ( | const SbString & | newTitle | ) |
Sets window title.
The window title can be set for topLevelShell components or components which are directly under a shell window handle (i.e. components which have their own window).
SoNONUNICODE void SoWinComponent::setTitle | ( | const char * | newTitle | ) |
Sets window title.
The window title can be set for topLevelShell components or components which are directly under a shell window handle (i.e. components which have their own window).
void SoWinComponent::setWindowCloseCallback | ( | SoWinComponentCB * | 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 specified.
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.
virtual void SoWinComponent::show | ( | ) | [virtual] |
This shows the component.
If this is a topLevelShell component, then show() will Realize and Map the window, else 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 in SoWinDirectionalLightEditor, and SoWinMaterialEditor.
friend class SoWinComponentP [friend] |
The context ID of the help topic to open when the viewer Help button is pressed.
The TopicID of the help topic to open when the viewer Help button is pressed.
Name of help file to open when the viewer Help button is pressed.
Note: Only a compiled HTML help file (.chm) can be displayed with this method.