Bring dialog box to front. Enable and disable "Start" and "Stop".
authorThomas Lopatic <thomas@lopatic.de>
Wed, 2 Mar 2005 00:40:51 +0000 (00:40 +0000)
committerThomas Lopatic <thomas@lopatic.de>
Wed, 2 Mar 2005 00:40:51 +0000 (00:40 +0000)
gui/win32/Frontend.ncb
gui/win32/Frontend.opt
gui/win32/Main/TrayIcon.cpp

index eaaf9f9..6dca74d 100644 (file)
Binary files a/gui/win32/Frontend.ncb and b/gui/win32/Frontend.ncb differ
index 4e0901e..e81baa6 100644 (file)
Binary files a/gui/win32/Frontend.opt and b/gui/win32/Frontend.opt differ
index 5f36ced..ea66502 100755 (executable)
@@ -28,16 +28,22 @@ LRESULT CALLBACK TrayIconProc( HWND, UINT, WPARAM, LPARAM lParam )
 \r
 void TrayIcon::displayPopup()\r
 {\r
-       HMENU hMenu = CreatePopupMenu();\r
-       hMenu = LoadMenu(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_TRAYMENU));\r
+       HMENU hMenu = LoadMenu(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_TRAYMENU));\r
+       HMENU hSubMenu = GetSubMenu(hMenu, 0);\r
+\r
+       EnableMenuItem(hSubMenu, IDM_STOP,\r
+               MF_BYCOMMAND | (main_dlg.m_StopButton.IsWindowEnabled() ? MF_ENABLED : MF_GRAYED));\r
        \r
+       EnableMenuItem(hSubMenu, IDM_START,\r
+               MF_BYCOMMAND | (main_dlg.m_StartButton.IsWindowEnabled() ? MF_ENABLED : MF_GRAYED));\r
+\r
        POINT pt;\r
        \r
        GetCursorPos(&pt);\r
        \r
        SetForegroundWindow( s_hWnd );\r
        \r
-       int cmd = TrackPopupMenu(GetSubMenu(hMenu, 0),\r
+       int cmd = TrackPopupMenu(hSubMenu,\r
                TPM_RIGHTBUTTON | TPM_RETURNCMD, \r
                pt.x, \r
                pt.y, \r
@@ -55,18 +61,21 @@ void TrayIcon::displayPopup()
                \r
        case IDM_WINDOW:\r
                main_dlg.OpenIcon();\r
+               main_dlg.SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\r
                break;\r
 \r
        case IDM_SETTINGS:\r
                main_dlg.m_TabCtrl.SetCurSel(0);\r
                main_dlg.m_TabCtrl.DisplayTabDialog();\r
                main_dlg.OpenIcon();\r
+               main_dlg.SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\r
                break;\r
                \r
        case IDM_OUTPUT:\r
                main_dlg.m_TabCtrl.SetCurSel(1);\r
                main_dlg.m_TabCtrl.DisplayTabDialog();\r
                main_dlg.OpenIcon();\r
+               main_dlg.SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\r
                break;\r
                \r
        case IDM_STOP:\r