]> source.dussan.org Git - tigervnc.git/commitdiff
Added TBSTYLE_TOOLTIPS window style to the toolbar window.
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 1 Dec 2005 17:01:13 +0000 (17:01 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 1 Dec 2005 17:01:13 +0000 (17:01 +0000)
Added ViewerToolBar::processWM_NOTIFY() method. It process WM_NOTIFY
messages from the vnc viewer toolbar (TTN_NEEDTEXT and etc).

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@426 3789f03b-4d11-0410-bbf8-ca57d06f2519

vncviewer/ViewerToolBar.cxx
vncviewer/ViewerToolBar.h

index 543acea6ef2b31e29312069bd0da06bda8167d4e..29b8030117a9ffe6047af25c78fc89e5d74f8fba 100644 (file)
@@ -24,7 +24,7 @@
 void ViewerToolBar::create(HWND parentHwnd) {
   // Create the toolbar panel
   ToolBar::create(ID_TOOLBAR, parentHwnd, WS_CHILD | 
-    TBSTYLE_FLAT | CCS_NORESIZE);
+    TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | CCS_NORESIZE);
   addBitmap(4, IDB_TOOLBAR);
 
   // Create the control buttons
@@ -49,6 +49,63 @@ void ViewerToolBar::create(HWND parentHwnd) {
   autoSize();
 }
 
+LRESULT ViewerToolBar::processWM_NOTIFY(WPARAM wParam, LPARAM lParam) {
+  switch (((LPNMHDR)lParam)->code) { 
+    // Process tooltips text
+  case TTN_NEEDTEXT:
+    {
+      LPTOOLTIPTEXT TTStr = (LPTOOLTIPTEXT)lParam;
+      if (TTStr->hdr.code != TTN_NEEDTEXT)
+        return 0;
+
+      switch (TTStr->hdr.idFrom) {
+      case ID_OPTIONS:
+        TTStr->lpszText = "Connection options...";
+        break;
+      case ID_INFO:
+        TTStr->lpszText = "Connection info";
+        break;
+      case ID_FULLSCREEN:
+        TTStr->lpszText = "Full screen";
+        break;
+      case ID_REQUEST_REFRESH:
+        TTStr->lpszText = "Request screen refresh";
+        break;
+      case ID_SEND_CAD:
+        TTStr->lpszText = "Send Ctrl-Alt-Del";
+        break;
+      case ID_SEND_CTLESC:
+        TTStr->lpszText = "Send Ctrl-Esc";
+        break;
+      case ID_CTRL_KEY:
+        TTStr->lpszText = "Send Ctrl key press/release";
+        break;
+      case ID_ALT_KEY:
+        TTStr->lpszText = "Send Alt key press/release";
+        break;
+      case ID_FILE_TRANSFER:
+        TTStr->lpszText = "Transfer files...";
+        break;
+      case ID_NEW_CONNECTION:
+        TTStr->lpszText = "New connection...";
+        break;
+      case ID_CONN_SAVE_AS:
+        TTStr->lpszText = "Save connection info as...";
+        break;
+      case ID_CLOSE:
+        TTStr->lpszText = "Disconnect";
+        break;
+      default:
+        break;
+      }
+    }
+
+  default:
+    break;
+  }
+  return 0;
+}
+
 void ViewerToolBar::show() {
   ShowWindow(getHandle(), SW_SHOW);
   SendMessage(parentHwnd, WM_SIZE, 0, 0);
index 8e829e7c7a3f6369ca62955b21ef053561452f9c..30e7708f705493729e52d6cbe75c94510df156aa 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   void create(HWND parentHwnd);
 
+  LRESULT processWM_NOTIFY(WPARAM wParam, LPARAM lParam);
+
   void show();
   void hide();
 };