5454#include < FL/Fl_Scroll.H>
5555#include < FL/Fl_Secret_Input.H>
5656#include < FL/Fl_Spinner.H>
57- // #include <FL/Fl_Text_Editor .H>
57+ #include < FL/Fl_Tooltip .H>
5858#include < FL/Fl_Multiline_Output.H>
5959#include < FL/Fl_Widget.H>
6060#include < FL/Fl_Window.H>
8080
8181class SVInput ;
8282class SVQuickNoteInput ;
83+ class SVQuickNoteBox ;
84+ class SVQuickNotePack ;
8385
8486/* global app class */
8587class AppVars
@@ -90,6 +92,7 @@ class AppVars
9092 hostList (NULL ),
9193 scroller (NULL ),
9294 vncViewer (NULL ),
95+ iconApp (NULL ),
9396 iconDisconnected (NULL ),
9497 iconDisconnectedError (NULL ),
9598 iconDisconnectedBigError (NULL ),
@@ -100,6 +103,7 @@ class AppVars
100103 userName (" " ),
101104 configPath (" " ),
102105 configPathAndFile (" " ),
106+ requestedListWidth (170 ),
103107 nConnectionTimeout (SV_CONNECTION_TIMEOUT_SECS),
104108 nViewersWaiting (0 ),
105109 verboseLogging (false ),
@@ -128,7 +132,6 @@ class AppVars
128132 nListFontSize (10 ),
129133 nMenuFontSize (11 ),
130134 blockLocalClipboardHandling (false ),
131- packButtons (NULL ),
132135 showReverseConnect (true ),
133136 savedX (0 ),
134137 savedY (0 ),
@@ -138,11 +141,15 @@ class AppVars
138141 msgThread (0 ),
139142 strF12ClipVar (" " ),
140143 sshCommand (" ssh" ),
141- quickNoteGroup (NULL ),
142- quickNoteLabel (NULL ),
144+ quickInfoPack (NULL ),
145+ quickInfoLabel (NULL ),
146+ lastConnectedLabel (),
147+ lastConnected (NULL ),
148+ lastError (NULL ),
143149 quickNote (NULL ),
144- quickNoteWindow (NULL ),
145- quickNoteInput (NULL )
150+ quickNotePack (NULL ),
151+ quickNoteInput (NULL ),
152+ packButtons (NULL )
146153 {
147154 // get user's login name for reading/writing config file
148155
@@ -189,6 +196,7 @@ class AppVars
189196 Fl_Hold_Browser * hostList;
190197 Fl_Scroll * scroller;
191198 VncViewer * vncViewer;
199+ Fl_RGB_Image * iconApp;
192200 Fl_Image * iconDisconnected;
193201 Fl_Image * iconDisconnectedError;
194202 Fl_Image * iconDisconnectedBigError;
@@ -199,7 +207,8 @@ class AppVars
199207 std::string userName;
200208 std::string configPath;
201209 std::string configPathAndFile;
202- int nConnectionTimeout;
210+ int requestedListWidth;
211+ uint16_t nConnectionTimeout;
203212 int nViewersWaiting;
204213 bool verboseLogging;
205214 bool colorBlindIcons;
@@ -217,8 +226,8 @@ class AppVars
217226 HostItem * itmBeingEdited;
218227 bool scanIsRunning;
219228 int nCurrentScanItem;
220- int nScanTimeout;
221- int nDeadTimeout;
229+ uint16_t nScanTimeout;
230+ uint16_t nDeadTimeout;
222231 int nStartingLocalPort;
223232 bool showTooltips;
224233 bool debugMode;
@@ -227,7 +236,6 @@ class AppVars
227236 int nListFontSize;
228237 int nMenuFontSize;
229238 bool blockLocalClipboardHandling;
230- Fl_Pack * packButtons;
231239 bool showReverseConnect;
232240 int savedX;
233241 int savedY;
@@ -237,11 +245,15 @@ class AppVars
237245 pthread_t msgThread;
238246 std::string strF12ClipVar;
239247 std::string sshCommand;
240- Fl_Group * quickNoteGroup;
241- Fl_Box * quickNoteLabel;
242- Fl_Multiline_Output * quickNote;
243- Fl_Window * quickNoteWindow;
248+ Fl_Pack * quickInfoPack;
249+ Fl_Box * quickInfoLabel;
250+ Fl_Box * lastConnectedLabel;
251+ Fl_Box * lastConnected;
252+ Fl_Multiline_Output * lastError;
253+ SVQuickNoteBox * quickNote;
254+ SVQuickNotePack * quickNotePack;
244255 SVQuickNoteInput * quickNoteInput;
256+ Fl_Pack * packButtons;
245257} extern * app;
246258
247259
@@ -275,6 +287,16 @@ class SVQuickNoteBox : public Fl_Multiline_Output
275287 int handle (int event);
276288};
277289
290+ /* subclassed group */
291+ class SVQuickNotePack : public Fl_Pack
292+ {
293+ public:
294+ SVQuickNotePack (int x, int y, int w, int h, const char * label = 0 ) :
295+ Fl_Pack (x, y, w, h, label) {}
296+ private:
297+ int handle (int event);
298+ };
299+
278300/* subclassed input box */
279301class SVQuickNoteInput : public SVInput
280302{
@@ -287,6 +309,7 @@ class SVQuickNoteInput : public SVInput
287309
288310
289311/* forward function declarations */
312+ void svBlinkCursor (void *);
290313void svCloseChildWindow (Fl_Widget *, void *);
291314void svCloseSSHConnection (void *);
292315void svConfigCreateNew ();
@@ -297,9 +320,11 @@ void svCreateAppIcons (bool fromAppOptions = false);
297320std::string svConvertBooleanToString (bool );
298321bool svConvertStringToBoolean (const std::string&);
299322void svCreateGUI ();
323+ void svCreateQuickNoteEditWidgets ();
300324void svDebugLog (const std::string&);
301325void svDeleteItem (int );
302326void svDeselectAllItems ();
327+ void svEnableDisableTooltips ();
303328int svFindFreeTcpPort ();
304329std::string svGetConfigProperty (char *);
305330std::string svGetConfigValue (char *);
@@ -311,9 +336,11 @@ void svHandleHostListEvents (Fl_Widget *, void *);
311336void svHandleMainWindowEvents (Fl_Widget *, void *);
312337void svPositionWidgets ();
313338void svHandleListItemIconChange (void *);
314- void svHandleQuickNoteWindowEvents (Fl_Widget *, void *);
339+ // void svHandleQuickNoteButtonEvents (Fl_Widget *, void *);
340+ // void svHandleQuickNoteWindowEvents (Fl_Widget *, void *);
315341void svHandleThreadConnection (void *);
316342void svHandleThreadCursorChange (void *);
343+ void svHideQuickNoteEditWidgets ();
317344void svInsertEmptyItem ();
318345int svItemNumFromItm (const HostItem *);
319346HostItem * svItmFromVnc (const VncObject *);
@@ -325,13 +352,13 @@ void svLogToFile (const std::string&);
325352void svMessageWindow (const std::string&, const std::string& = " SpiritVNC" );
326353bool svThereAreConnectedItems ();
327354void svPopUpEditMenu (Fl_Input_ *);
328- void svQuickNoteSetLabelAndText (HostItem *);
329- void svQuickNoteSetToEmpty ();
355+ void svQuickInfoSetLabelAndText (HostItem *);
356+ void svQuickInfoSetToEmpty ();
330357void svResizeScroller ();
331358void svRestoreWindowSizePosition (void *);
332359void svScanTimer (void *);
333360void svSendKeyStrokesToHost (std::string&, VncObject *);
334- void svSetUnsetMainWindowTooltips ();
361+ void svSetAppTooltips ();
335362void svShowAboutHelp ();
336363void svShowAppOptions ();
337364void svShowF8Window ();
0 commit comments