summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_cluiframes.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
commit30707c980d1560b358dbf2671a4d2a26a1e8173c (patch)
tree74aee5adaaac976e1398274ca64c5461a60f1feb /plugins/Clist_modern/src/modern_cluiframes.cpp
parent335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (diff)
various menu initialization quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_cluiframes.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp40
1 files changed, 6 insertions, 34 deletions
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index 2b78349096..37c0a574e0 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -837,8 +837,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGEN
if (_fCluiFramesModuleNotStarted)
return NULL;
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
@@ -1006,15 +1005,12 @@ static int ModifyMItem(WPARAM wParam,LPARAM lParam)
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
/* HOOK */
if (MirandaExiting()) return 0;
if (_fCluiFramesModuleNotStarted) return -1;
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < g_nFramesCount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
@@ -1061,18 +1057,12 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
{
//hiword(wParam) = frameid,loword(wParam) = flag
- int pos;
- CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
-
if (_fCluiFramesModuleNotStarted) return -1;
-
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < g_nFramesCount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
@@ -1108,23 +1098,6 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
- /*
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignTop,(LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|CMIF_GRAYED;
- if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignClient,(LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignBottom,(LPARAM)&mi);
-
- */
-
-
-
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!g_pfwFrames[pos].visible) || g_pfwFrames[pos].Locked || (pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
@@ -1768,9 +1741,8 @@ static int CLUIFramesLoadMainMenu()
_hmiRoot = (HGENMENU)-1;
}
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
// create root menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
mi.position = 3000090000;