Abstract base class for all Open Inventor Wx components. More...
#include <Inventor/Wx/SoWxComponent.h>
Public Member Functions | |
virtual void | show () |
virtual void | hide () |
SbBool | isVisible () |
wxWindow * | getWidget () const |
SbBool | isTopLevelShell () const |
wxWindow * | getShellWidget () const |
wxWindow * | getParentWidget () const |
void | setSize (const SbVec2s &size) |
SbVec2s | getSize () |
virtual SbBool | setFullScreen (const SbBool enable) |
SbBool | isFullScreen (void) const |
void | setFullScreenEnable (const SbBool enable) |
SbBool | isFullScreenEnable (void) const |
SbGlContextHelper::Display | 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 |
SbString | getWidgetName () const |
SbString | getClassName () const |
Static Public Member Functions | |
static SoWxComponent * | getComponent (wxWindow *widget) |
Public Attributes | |
SbString | helpFileName |
Abstract base class from which all Open Inventor Wx components are derived. This class provides a basic C++ protocol for building and displaying Wx components. Components are used to encapsulate some function or task into a reusable package in the form of a Wx widget handle that can be used in any Open Inventor Wx program. See the Example section on how to build and use SoWxComponents.
// For compilers that support precompilation, includes "wx.h". #include <wx/wxprec.h>
// must be inserted in case of a compilation with Borland C++ #ifdef __BORLANDC__ #pragma hdrstop #endif
#ifndef WX_PRECOMP #include <wx/wx.h> #endif
#include <Inventor/Wx/SoWx.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/Wx/viewers/SoWxExaminerViewer.h>
class WxHelloCone: public wxApp { public: virtual bool OnInit();
virtual int OnExit(); };
IMPLEMENT_APP( WxHelloCone )
bool WxHelloCone::OnInit() { // Initialize Inventor and Wx, which must be done
// before any Inventor calls are made.
wxFrame* myWindow = new wxFrame( NULL, wxID_ANY, argv[0], wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, "" );
SoWx::init( wxTheApp, myWindow );
// Create the viewer in the toplevel window
// and set some scene to display.
SoWxExaminerViewer *myViewer = new SoWxExaminerViewer(myWindow);
myViewer->setSceneGraph( new SoCone() );
// Map window on screen.
myViewer->show();
SoWx::show(myWindow); // calls Show() return true; }
int WxHelloCone::OnExit() { SoWx::finish(); // Properly cleans Open Inventor
return 0; }
SoWx, SoWxRenderArea, SoWxViewer
SbString SoWxComponent::getClassName | ( | ) | const [inline] |
Returns the class name.
The class name is predefined by each component.
static SoWxComponent* SoWxComponent::getComponent | ( | wxWindow * | widget | ) | [static] |
Returns the SoWxComponent for this widget handle.
If the widget handle does not match that of any Open Inventor component, then NULL is returned.
SbGlContextHelper::Display SoWxComponent::getDisplay | ( | void | ) | [inline] |
On UNIX, returns the X display associated with this components widget.
SbString SoWxComponent::getIconTitle | ( | ) | const [inline] |
Included for portability only.
wxWindow* SoWxComponent::getParentWidget | ( | ) | const [inline] |
Returns the parent widget handle.
wxWindow* SoWxComponent::getShellWidget | ( | ) | const [inline] |
Returns the topLevelShell widget handle (NULL if the topLevelShell hasn't been created by this component).
SbVec2s SoWxComponent::getSize | ( | ) |
Convenience routine on the widget handle.
Reimplemented in SoWxViewer.
SbString SoWxComponent::getTitle | ( | ) | const [inline] |
Gets window title.
wxWindow* SoWxComponent::getWidget | ( | void | ) | const [inline] |
This returns the base widget handle for this component.
SbString SoWxComponent::getWidgetName | ( | ) | const [inline] |
Returns the widget handle name.
The widget handle name is passed to the build method.
virtual void SoWxComponent::hide | ( | ) | [virtual] |
This hides the component.
Reimplemented in SoWxGLWidget, and SoWxFullViewer.
SbBool SoWxComponent::isFullScreen | ( | void | ) | const |
Queries if the viewer is in fullscreen mode.
SbBool SoWxComponent::isFullScreenEnable | ( | void | ) | const |
Queries if it is possible to put the viewer in fullscreen mode.
SbBool SoWxComponent::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 SoWxComponent::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).
Switches the viewer into (or out of) fullscreen mode.
This works fine on Windows, but has certain problems under the X Window System. For details, see the wxWidgets documentation for wxTopLevelWindow::ShowFullScreen.
void SoWxComponent::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 SoWxComponent::setIconTitle | ( | const SbString & | newIconTitle | ) |
Included for portability only.
SoNONUNICODE void SoWxComponent::setIconTitle | ( | const char * | newIconTitle | ) |
Included for portability only.
void SoWxComponent::setSize | ( | const SbVec2s & | size | ) |
Convenience routine on the widget handle.
void SoWxComponent::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 SoWxComponent::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).
virtual void SoWxComponent::show | ( | ) | [virtual] |
This shows the component.
Reimplemented in SoWxGLWidget.
Name of help file to open when the viewer Help button is pressed.