Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoConsole Class Reference

VSG extension Creates a Win32 console for printing messages More...

#include <Inventor/Win/SoConsole.h>

+ Inheritance diagram for SoConsole:

Public Member Functions

 SoConsole (SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
 Constructor.
 
virtual ~SoConsole ()
 Destructor.
 
HWND getConsoleHandle (void)
 Returns a handle to the console.
 
void printMessage (const SbString &str)
 Sends a message to the console.
 
- Public Member Functions inherited from SoWinComponent
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 window handle 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 window handle (NULL if the shell hasn't been created by this component).
 
SoWidget getParentWidget () const
 Returns the parent window handle, be it a shell or not.
 
void setSize (const SbVec2s &size)
 Convenience routine on the window handle.
 
SbVec2s getSize ()
 Convenience routine on the window handle.
 
SbBool setFullScreen (const SbBool enable)
 Switches the viewer into (or out of) fullscreen mode.
 
SbBool isFullScreen () const
 Queries if the viewer is in fullscreen mode.
 
void setFullScreenEnable (const SbBool enable)
 Enables/disables fullscreen mode.
 
SbBool isFullScreenEnable (void) const
 Queries if it is possible to put the viewer in fullscreen mode.
 
UINT * getDisplay ()
 Included for portability only.
 
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)
 Included for portability only.
 
void setIconTitle (const SbString &newIconTitle)
 Included for portability only.
 
SbString getIconTitle () const
 Included for portability only.
 
void setWindowCloseCallback (SoWinComponentCB *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 specified.
 
SbString getWidgetName () const
 Returns the window handle name.
 
SbString getClassName () const
 Returns the class name.
 
virtual ~SoWinComponent ()
 Destructor.
 

Static Public Member Functions

static void setMaxNumMessages (int)
 Sets the maximum number of messages to be printed in the console.
 
- Static Public Member Functions inherited from SoWinComponent
SoDEPRECATED static SoNONUNICODE void displayHelp (const char *filename, UINT contextID)
 Static method to display the specified topic of the specified help file.
 
static SoDEPRECATED void displayHelp (const SbString &filename, UINT contextID)
 Static method to display the specified topic of the specified help file.
 
static SoWinComponentgetComponent (SoWidget w)
 Returns the SoWinComponent for this window handle.
 

Additional Inherited Members

- Public Types inherited from SoWinComponent
typedef void SoWinComponentCB(void *userData, SoWinComponent *comp)
 
- Public Attributes inherited from SoWinComponent
SbString helpFileName
 Name of help file to open when the viewer Help button is pressed.
 
UINT helpContextID
 The context ID of the help topic to open when the viewer Help button is pressed.
 
SbString helpContextString
 The TopicID of the help topic to open when the viewer Help button is pressed.
 

Detailed Description

VSG extension Creates a Win32 console for printing messages

The SoConsole class provides a convenient way to display Open Inventor error messages or other application debug messages in a Win32 console. This can be a very useful feature for simple Win32 applications.

There is only one error console per application. To get this console, call SoWin::getErrorConsole(). It is then possible to print messages to it using the printMessage function.

The console replaces the original message box mechanism. Every Open Inventor error is caught and written to the console. This includes user-defined error messages that are generated with SoDebugError. For example, SoDebugError::post("YourClass", "YourMessage") will print your message to the console.

Due to a Windows programming limitation, the console is not usable in multi-threaded applications. In this case, it is possible to switch to the original message box mechanism by setting environment variable OIV_OLD_ERROR_HANDLER.

The Save button allows the user to save error information into a file named oivErrorFile.txt. The Clear button deletes all error messages currently displayed in the console.

SEE ALSO

SoWin, SoDebugError

Definition at line 66 of file SoConsole.h.

Constructor & Destructor Documentation

◆ SoConsole()

SoConsole::SoConsole ( SoWidget  parent = NULL,
const char *  name = NULL,
SbBool  buildInsideParent = TRUE 
)

Constructor.

◆ ~SoConsole()

virtual SoConsole::~SoConsole ( )
virtual

Destructor.

Member Function Documentation

◆ getConsoleHandle()

HWND SoConsole::getConsoleHandle ( void  )

Returns a handle to the console.

◆ printMessage()

void SoConsole::printMessage ( const SbString str)

Sends a message to the console.

◆ setMaxNumMessages()

static void SoConsole::setMaxNumMessages ( int  )
static

Sets the maximum number of messages to be printed in the console.


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