Added RBUTTON menu to the file transfer dialog.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@414 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx
index dacce7b..b27270d 100644
--- a/vncviewer/FTDialog.cxx
+++ b/vncviewer/FTDialog.cxx
@@ -222,6 +222,7 @@
         _this->onLocalItemActivate((LPNMITEMACTIVATE) lParam);
         return FALSE;
       case NM_RCLICK:
+        _this->onLocalRButton();
         return FALSE;
       }
       break;
@@ -239,6 +240,7 @@
         _this->onRemoteItemActivate((LPNMITEMACTIVATE) lParam);
         return FALSE;
       case NM_RCLICK:
+        _this->onRemoteRButton();
         return FALSE;
       }
       break;
@@ -367,6 +369,33 @@
 
 }
 
+void 
+FTDialog::onLocalRButton()
+{
+  showFTMenu(1, 1, 1, 1);
+}
+
+void 
+FTDialog::onRemoteRButton()
+{
+  showFTMenu(1, 1, 1, 1);
+}
+
+void
+FTDialog::showFTMenu(int copyBtnState, int renameBtnState, int deleteBtnState, int cancelBtnState)
+{
+  HMENU hMenu = LoadMenu(m_hInstance, MAKEINTRESOURCE(IDR_FTMENU));
+  HMENU hFTMenu = GetSubMenu(hMenu, 0);
+
+  SetMenuDefaultItem(hFTMenu, IDM_FTCOPY, FALSE);
+
+  SetForegroundWindow(m_hwndFTDialog);
+
+  POINT cursorPosition;
+  GetCursorPos(&cursorPosition);
+  TrackPopupMenu(hFTMenu, 0, cursorPosition.x, cursorPosition.y, 0, m_hwndFTDialog, 0);
+}
+
 void
 FTDialog::setIcon(int dest, int idIcon)
 {