From be489c4e6f4c1ab4b4d7f84e35a73e34e1b0b331 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 Jun 2015 23:34:47 +0000 Subject: - Menu_EnableItem & Menu_SetChecked - more suitable helpers to set flags; - fix for checks in frame menus; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14389 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/QuoteInfoDlg.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'plugins/Quotes/src/QuoteInfoDlg.cpp') diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index 32a5f5e84e..01149affe1 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -269,22 +269,14 @@ int Quotes_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/) return 0; } -namespace -{ - void enable_menu(HGENMENU hMenu, bool bEnable) - { - Menu_ModifyItem(hMenu, NULL, INVALID_HANDLE_VALUE, (bEnable) ? 0 : CMIF_GRAYED); - } -} - int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) { - enable_menu(g_hMenuEditSettings, false); - enable_menu(g_hMenuOpenLogFile, false); + Menu_EnableItem(g_hMenuEditSettings, false); + Menu_EnableItem(g_hMenuOpenLogFile, false); #ifdef CHART_IMPLEMENT - enable_menu(g_hMenuChart,false); + Menu_EnableItem(g_hMenuChart,false); #endif - enable_menu(g_hMenuRefresh, false); + Menu_EnableItem(g_hMenuRefresh, false); MCONTACT hContact = MCONTACT(wp); if (NULL == hContact) @@ -292,9 +284,9 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) return 0; } - enable_menu(g_hMenuEditSettings, true); + Menu_EnableItem(g_hMenuEditSettings, true); - enable_menu(g_hMenuRefresh, true); + Menu_EnableItem(g_hMenuRefresh, true); tstring sLogFileName; bool bThereIsLogFile = (true == get_log_file(hContact, sLogFileName)) @@ -302,9 +294,9 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) if (true == bThereIsLogFile) { #ifdef CHART_IMPLEMENT - enable_menu(g_hMenuChart,true); + Menu_EnableItem(g_hMenuChart,true); #endif - enable_menu(g_hMenuOpenLogFile, true); + Menu_EnableItem(g_hMenuOpenLogFile, true); } return 0; -- cgit v1.2.3