summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-29 19:30:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-29 19:30:51 +0000
commitee3100701b64a1a34e8e5b3069219c7c5a201d8a (patch)
tree65ae99da9575d2611734482dcedec21bf7f186db /src
parentcadd3f86302d30d6d6a2e4af63a7a50f0dd1f1cb (diff)
- unified menu creation using wrapper class CMenuItem;
- duplicated hLangpack field removed from TMO_IntMenuItem; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdaway/src/awaymsg.cpp2
-rw-r--r--src/core/stdemail/src/email.cpp2
-rw-r--r--src/core/stdfile/src/file.cpp4
-rw-r--r--src/core/stdhelp/src/help.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp2
-rw-r--r--src/core/stduihist/src/history.cpp2
-rw-r--r--src/core/stdurl/url.cpp2
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp2
-rw-r--r--src/mir_app/src/chat_svc.cpp2
-rw-r--r--src/mir_app/src/clc.h64
-rw-r--r--src/mir_app/src/clistmenus.cpp23
-rw-r--r--src/mir_app/src/clui.cpp8
-rw-r--r--src/mir_app/src/findadd.cpp2
-rw-r--r--src/mir_app/src/genmenu.cpp5
-rw-r--r--src/mir_app/src/genmenu.h1
-rw-r--r--src/mir_app/src/meta_menu.cpp2
-rw-r--r--src/mir_app/src/movetogroup.cpp4
-rw-r--r--src/mir_app/src/options.cpp2
-rw-r--r--src/mir_app/src/proto_opts.cpp2
19 files changed, 64 insertions, 69 deletions
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp
index 15ac55f682..8ffae1df96 100644
--- a/src/core/stdaway/src/awaymsg.cpp
+++ b/src/core/stdaway/src/awaymsg.cpp
@@ -167,7 +167,7 @@ int LoadAwayMsgModule(void)
hWindowList = WindowList_Create();
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000005000;
mi.flags = CMIF_NOTOFFLINE;
mi.name.a = LPGEN("Re&ad status message");
diff --git a/src/core/stdemail/src/email.cpp b/src/core/stdemail/src/email.cpp
index 42009eb606..719983ec67 100644
--- a/src/core/stdemail/src/email.cpp
+++ b/src/core/stdemail/src/email.cpp
@@ -66,7 +66,7 @@ static int EMailPreBuildMenu(WPARAM hContact, LPARAM)
int LoadSendRecvEMailModule(void)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000010000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SENDEMAIL);
mi.name.a = LPGEN("&E-mail");
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 397034f2a9..39ada96555 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -336,7 +336,7 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam)
static int SRFileModulesLoaded(WPARAM, LPARAM)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000020000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
mi.name.a = LPGEN("&File");
@@ -434,7 +434,7 @@ int LoadSendRecvFileModule(void)
{
CreateServiceFunction("FtMgr/Show", FtMgrShowCommand);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
mi.position = 1900000000;
mi.name.a = LPGEN("File &transfers...");
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp
index d248c24d45..121a097757 100644
--- a/src/core/stdhelp/src/help.cpp
+++ b/src/core/stdhelp/src/help.cpp
@@ -73,7 +73,7 @@ int LoadHelpModule(void)
CreateServiceFunction("Help/WebsiteCommand", WebsiteCommand);
CreateServiceFunction("Help/BugCommand", BugCommand);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("&Help"), 2000090000);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 3319d29fb2..c433236f35 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -278,7 +278,7 @@ static int SplitmsgModulesLoaded(WPARAM, LPARAM)
RegisterSRMMFonts();
LoadMsgLogIcons();
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000090000;
mi.flags = CMIF_DEFAULT;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_MESSAGE);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp
index 2114cd2e24..edc96772ba 100644
--- a/src/core/stduihist/src/history.cpp
+++ b/src/core/stduihist/src/history.cpp
@@ -401,7 +401,7 @@ static int PreShutdownHistoryModule(WPARAM, LPARAM)
int LoadHistoryModule(void)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = 1000090000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
mi.name.a = LPGEN("View &history");
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp
index ba9bd8bb14..c0c0a34829 100644
--- a/src/core/stdurl/url.cpp
+++ b/src/core/stdurl/url.cpp
@@ -119,7 +119,7 @@ static int SRUrlPreBuildMenu(WPARAM wParam, LPARAM)
static int SRUrlModulesLoaded(WPARAM, LPARAM)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000040000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
mi.name.a = LPGEN("Web page address (&URL)");
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index e4019fe568..40cbe871ef 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -628,7 +628,7 @@ int LoadUserInfoModule(void)
HookEvent(ME_DB_CONTACT_DELETED, UserInfoContactDelete);
HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownUserInfo);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = 1000050000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
mi.name.a = LPGEN("User &details");
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index ea88490b14..91de28faef 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -560,7 +560,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileyOptionsChanged);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN);
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index bc8a921fa5..5df01c3eff 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -72,31 +72,32 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
/* clcutils.c */
TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
-int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
-void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
-void fnEnsureVisible(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
-void fnRecalcScrollBar(HWND hwnd, struct ClcData *dat);
-void fnSetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
-void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
-int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
-void fnEndRename(HWND hwnd, struct ClcData *dat, int save);
-void fnDeleteFromContactList(HWND hwnd, struct ClcData *dat);
-void fnBeginRenameSelection(HWND hwnd, struct ClcData *dat);
-void fnCalcEipPosition(struct ClcData *dat, ClcContact *contact, ClcGroup *group, POINT *result);
-int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
-int fnClcStatusToPf2(int status);
-int fnIsHiddenMode(struct ClcData *dat, int status);
-void fnHideInfoTip(HWND hwnd, struct ClcData *dat);
-void fnNotifyNewContact(HWND hwnd, MCONTACT hContact);
+int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
+void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
+void fnEnsureVisible(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
+void fnRecalcScrollBar(HWND hwnd, struct ClcData *dat);
+void fnSetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
+void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
+int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
+void fnEndRename(HWND hwnd, struct ClcData *dat, int save);
+void fnDeleteFromContactList(HWND hwnd, struct ClcData *dat);
+void fnBeginRenameSelection(HWND hwnd, struct ClcData *dat);
+void fnCalcEipPosition(struct ClcData *dat, ClcContact *contact, ClcGroup *group, POINT *result);
+int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
+int fnClcStatusToPf2(int status);
+int fnIsHiddenMode(struct ClcData *dat, int status);
+void fnHideInfoTip(HWND hwnd, struct ClcData *dat);
+void fnNotifyNewContact(HWND hwnd, MCONTACT hContact);
+void fnGetSetting(int i, LOGFONT* lf, COLORREF* colour);
+void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF* colour);
+void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour);
+void fnLoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst);
+void fnRecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
+void fnSetGroupChildCheckboxes(ClcGroup *group, int checked);
+void fnSetContactCheckboxes(ClcContact *cc, int checked);
+void fnInvalidateItem(HWND hwnd, struct ClcData *dat, int iItem);
+
DWORD fnGetDefaultExStyle(void);
-void fnGetSetting(int i, LOGFONT* lf, COLORREF* colour);
-void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF* colour);
-void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour);
-void fnLoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst);
-void fnRecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
-void fnSetGroupChildCheckboxes(ClcGroup *group, int checked);
-void fnSetContactCheckboxes(ClcContact *cc, int checked);
-void fnInvalidateItem(HWND hwnd, struct ClcData *dat, int iItem);
int fnGetRowBottomY(struct ClcData *dat, int item);
int fnGetRowHeight(struct ClcData *dat, int item);
@@ -110,20 +111,19 @@ void GetFontSetting(int i, LOGFONTA *lf, COLORREF *colour);
/* clistmenus.c */
HGENMENU fnGetProtocolMenu(const char*);
-int fnGetProtocolVisibility(const char* accName);
-int fnConvertMenu(TMO_MenuItem*, TMO_MenuItem*);
-int fnGetAverageMode(int *pNetProtoCount);
+int fnGetProtocolVisibility(const char* accName);
+int fnGetAverageMode(int *pNetProtoCount);
-int fnGetAccountIndexByPos(int Pos);
-int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos);
-void RebuildMenuOrder(void);
+int fnGetAccountIndexByPos(int Pos);
+int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos);
+void RebuildMenuOrder(void);
INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam);
/* clistsettings.c */
TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode);
-void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
-void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
+void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
+void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
ClcCacheEntry* fnGetCacheEntry(MCONTACT hContact);
ClcCacheEntry* fnCreateCacheItem (MCONTACT hContact);
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp
index 0c7952c83c..1f52a0fe12 100644
--- a/src/mir_app/src/clistmenus.cpp
+++ b/src/mir_app/src/clistmenus.cpp
@@ -178,7 +178,7 @@ MIR_APP_DLL(HMENU) Menu_GetMainMenu(void)
return Menu_BuildMainMenu();
}
-MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi, int _hLang)
+MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi)
{
MainMenuExecParam *mmep = (MainMenuExecParam*)mir_alloc(sizeof(MainMenuExecParam));
if (mmep == NULL)
@@ -193,7 +193,6 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi, int _hLang)
if (pimi == NULL)
return NULL;
- pimi->hLangpack = _hLang;
mmep->pimi = pimi;
const char* name;
@@ -248,7 +247,7 @@ struct ContactMenuExecParam
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *pmi, const char *pszProto, int _hLang)
+MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *pmi, const char *pszProto)
{
// owner data
ContactMenuExecParam *cmep = (ContactMenuExecParam*)mir_calloc(sizeof(ContactMenuExecParam));
@@ -262,7 +261,6 @@ MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *pmi, const char *psz
if (pimi == NULL)
return NULL;
- pimi->hLangpack = _hLang;
cmep->pimi = pimi;
if (pszProto == NULL)
@@ -374,7 +372,7 @@ struct StatusMenuExecParam
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const char *pszProto, int _hLangpack)
+MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const char *pszProto)
{
TMO_IntMenuItem *pRoot = MO_GetIntMenuItem(pmi->root);
@@ -385,14 +383,13 @@ MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const char *pszP
smep->custom = TRUE;
smep->svc = mir_strdup(pmi->pszService);
smep->szProto = mir_strdup(pszProto);
- pmi->ownerdata = smep;
}
+ pmi->ownerdata = smep;
TMO_IntMenuItem *pimi = Menu_AddItem(hStatusMenuObject, pmi);
if (pimi == NULL)
return NULL;
- pimi->hLangpack = _hLangpack;
if (smep)
smep->hMenuItem = pimi;
@@ -831,7 +828,7 @@ void RebuildMenuOrder(void)
TCHAR tbuf[256];
//adding root
- TMO_MenuItem tmi = { 0 };
+ CMenuItem tmi;;
tmi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
tmi.position = pos++;
tmi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -935,7 +932,7 @@ void RebuildMenuOrder(void)
if (!(flags & statusModePf2List[j]))
continue;
- TMO_MenuItem tmi = { sizeof(tmi) };
+ CMenuItem tmi;;
tmi.flags = CMIF_TCHAR;
if (statusModeList[j] == ID_STATUS_OFFLINE)
tmi.flags |= CMIF_CHECKED;
@@ -1088,13 +1085,13 @@ static INT_PTR HotkeySetStatus(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// PROTOCOL MENU
-MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(TMO_MenuItem *mi, const char *pszProto, int _hLangpack)
+MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(TMO_MenuItem *mi, const char *pszProto)
{
if (mi == NULL)
return NULL;
if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
- return Menu_AddStatusMenuItem(mi, pszProto, _hLangpack);
+ return Menu_AddStatusMenuItem(mi, pszProto);
char szService[100];
if (pszProto && mi->pszService && *mi->pszService == '/') {
@@ -1102,7 +1099,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(TMO_MenuItem *mi, const char *pszPro
strncat_s(szService, mi->pszService, _TRUNCATE);
mi->pszService = szService;
}
- return Menu_AddMainMenuItem(mi, _hLangpack);
+ return Menu_AddMainMenuItem(mi);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1177,7 +1174,7 @@ void InitCustomMenus(void)
// add exit command to menu
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = 0x7fffffff;
mi.pszService = "CloseAction";
mi.name.a = LPGEN("E&xit");
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index bc38c7728a..ba7e7b152e 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -326,29 +326,29 @@ int LoadCLUIModule(void)
db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
- CreateServiceFunction("CList/DeleteContactCommand", MenuItem_DeleteContact);
mi.position = 2000070000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.name.a = LPGEN("De&lete");
mi.pszService = "CList/DeleteContactCommand";
Menu_AddContactMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, MenuItem_DeleteContact);
- CreateServiceFunction("CList/RenameContactCommand", MenuItem_RenameContact);
mi.position = 2000050000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
mi.name.a = LPGEN("&Rename");
mi.pszService = "CList/RenameContactCommand";
hRenameMenuItem = Menu_AddContactMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, MenuItem_RenameContact);
- CreateServiceFunction("CList/AddToListContactCommand", MenuItem_AddContactToList);
mi.position = -2050000000;
mi.flags |= CMIF_NOTONLIST;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_ADDCONTACT);
mi.name.a = LPGEN("&Add permanently to list");
mi.pszService = "CList/AddToListContactCommand";
Menu_AddContactMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, MenuItem_AddContactToList);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuItem_PreBuild);
return 0;
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp
index 724a1216ed..2a4b5e29b8 100644
--- a/src/mir_app/src/findadd.cpp
+++ b/src/mir_app/src/findadd.cpp
@@ -1028,7 +1028,7 @@ int LoadFindAddModule(void)
HookEvent(ME_PROTO_ACCLISTCHANGED, OnSystemModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, FindAddPreShutdown);
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = 500020000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
mi.name.a = LPGEN("&Find/add contacts...");
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp
index a420ced350..414ae1db32 100644
--- a/src/mir_app/src/genmenu.cpp
+++ b/src/mir_app/src/genmenu.cpp
@@ -621,7 +621,7 @@ struct KillMenuItemsParam
int KillMenuItems(TMO_IntMenuItem *pimi, KillMenuItemsParam* param)
{
- if (pimi->hLangpack == param->hLangpack)
+ if (pimi->mi.hLangpack == param->hLangpack)
param->arItems.insert(pimi);
return FALSE;
}
@@ -686,7 +686,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos
if (oldroot != NULL)
return oldroot;
- TMO_MenuItem tmi = { 0 };
+ CMenuItem tmi;;
tmi.flags = CMIF_TCHAR;
tmi.hIcolibItem = hIcoLib;
tmi.hLangpack = hLang;
@@ -719,7 +719,6 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi)
p->iconId = -1;
p->OverrideShow = TRUE;
p->originalPosition = pmi->position;
- p->hLangpack = pmi->hLangpack;
if (pmi->flags & CMIF_UNICODE)
p->mi.name.t = mir_tstrdup(pmi->name.t);
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h
index 6c6be6aeae..a100379541 100644
--- a/src/mir_app/src/genmenu.h
+++ b/src/mir_app/src/genmenu.h
@@ -55,7 +55,6 @@ struct TMO_IntMenuItem
int originalPosition;
DWORD hotKey;
WPARAM execParam;
- int hLangpack;
TMO_IntMenuItem *next; // next item in list
TIntMenuObject *parent;
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp
index d848d09c17..2ae402110f 100644
--- a/src/mir_app/src/meta_menu.cpp
+++ b/src/mir_app/src/meta_menu.cpp
@@ -356,7 +356,7 @@ INT_PTR Meta_OnOff(WPARAM, LPARAM)
void InitMenus()
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
// main menu item
mi.hIcolibItem = GetIconHandle(I_MENUOFF);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp
index 569521472c..1a1c3e62e4 100644
--- a/src/mir_app/src/movetogroup.cpp
+++ b/src/mir_app/src/movetogroup.cpp
@@ -67,7 +67,7 @@ static TCHAR* PrepareGroupName(TCHAR* str)
static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.root = hRoot;
mi.position = pos;
mi.name.t = PrepareGroupName(name);
@@ -88,7 +88,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);
if (!hMoveToGroupItem) {
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.position = 100000;
mi.name.a = LPGEN("&Move to group");
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 76d34ace71..f82806f8a5 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -1293,7 +1293,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam)
static int OptModulesLoaded(WPARAM, LPARAM)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
mi.name.a = LPGEN("&Options...");
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index d4cbfc84f7..d4f29726c7 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -1018,7 +1018,7 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM)
int OptProtosLoaded(WPARAM, LPARAM)
{
- TMO_MenuItem mi = { 0 };
+ CMenuItem mi;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
mi.name.a = LPGEN("&Accounts...");