From 3f079e7eff79181a17ace419ebd405a76b3f005c Mon Sep 17 00:00:00 2001 From: Dennis Syrovatsky Date: Wed, 23 Nov 2005 05:23:50 +0000 Subject: 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 --- vncviewer/FTDialog.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'vncviewer/FTDialog.cxx') diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx index dacce7bf..b27270da 100644 --- a/vncviewer/FTDialog.cxx +++ b/vncviewer/FTDialog.cxx @@ -222,6 +222,7 @@ FTDialog::FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) _this->onLocalItemActivate((LPNMITEMACTIVATE) lParam); return FALSE; case NM_RCLICK: + _this->onLocalRButton(); return FALSE; } break; @@ -239,6 +240,7 @@ FTDialog::FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) _this->onRemoteItemActivate((LPNMITEMACTIVATE) lParam); return FALSE; case NM_RCLICK: + _this->onRemoteRButton(); return FALSE; } break; @@ -367,6 +369,33 @@ FTDialog::onDownload() } +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) { -- cgit v1.2.3