Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoConsole.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Jerome Hummel (Apr 2002)
22**=======================================================================*/
23
24#ifndef _SO_WIN_ERROR_CONSOLE_H__
25#define _SO_WIN_ERROR_CONSOLE_H__
26
27#include <Inventor/Win/SoWinComponent.h>
28
29class SbThreadMutex;
30
67{
68
69 public :
73 SoConsole(SoWidget parent = NULL,
74 const char *name = NULL,
75 SbBool buildInsideParent = TRUE);
76
80 virtual ~SoConsole();
81
85 HWND getConsoleHandle(void);
86
90 static void setMaxNumMessages(int);
91
95 void printMessage(const SbString& str);
96
97 private:
98 void commonConstructor();
99 HWND handleToConsole;
100
101 // String to print. All the messages are in it.
102 static char *stringBuffer;
103
104 static unsigned int maxNumMessages;
105 static unsigned int numMessages ; //current number of messages
106
107 // Delete the current message in stringBuffer
108 static void clearStringBuffer(void);
109
110 // Initial positions for resize event :
111 static POINT upLeftCtrlCorner;
112 static POINT upLeftClearButtonCorner;
113 static POINT upLeftSaveButtonCorner;
114 static POINT upLeftCloseButtonCorner;
115 static RECT initDlgSize;
116
117 // Same as strcpy (I can't use it in here (bug in std lib))
118 void copyString(const char *string, char *intoString);
119
120 // Add a string to stringBuffer
121 char *addString(const SbString& newString);
122
123 //If the string comes from Inventor we want to format it a little
124 void formatString(SbString& newString);
125
126 int countChar(const char *source, char toCount);
127
128 char *changeCarriageReturn(const SbString& str, int n);
129
130 private:
131 SoWidget buildWidget(SoWidget parent);
132
133 // Our window proc so we can filter events :
134 static WBOOL CALLBACK dialogWndProc(Hwnd hdlg, UINT message, WPARAM wParam, LPARAM lParam);
135 static WBOOL CALLBACK editWndProc(Hwnd hdlg, UINT message, WPARAM wParam, LPARAM lParam);
136
137 static void onCommand(Hwnd hdlg, int id, Hwnd hCtrl, UINT codeNotify);
138
139 SoWidget mgrWidget;
140
141 SbThreadMutex* m_classMtx;
142 SbThreadId_t m_threadId;
143 HICON m_ivIcon;
144
145 static bool s_controlIsDown;
146};
147
148#endif /* _SO_WIN_ERROR_CONSOLE_H__ */
149
150
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Creates a Win32 ...
Definition SoConsole.h:67
static void setMaxNumMessages(int)
Sets the maximum number of messages to be printed in the console.
HWND getConsoleHandle(void)
Returns a handle to the console.
virtual ~SoConsole()
Destructor.
SoConsole(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
void printMessage(const SbString &str)
Sends a message to the console.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
int SbBool
Boolean type.
Definition SbBase.h:87