diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-25 12:56:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-25 12:56:12 +0000 |
commit | 362a084bb51caf3da238020637a478499781eea4 (patch) | |
tree | dc12da6ba3b27a422b0a273b825613de97176176 /plugins/MirOTR | |
parent | 7f1c59f929275ac7536c17e10f7267026957ae8f (diff) |
experimental menu adding function without CLISTMENUITEM
git-svn-id: http://svn.miranda-ng.org/main/trunk@14380 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r-- | plugins/MirOTR/src/mirotrmenu.cpp | 91 |
1 files changed, 39 insertions, 52 deletions
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 8893296cff..38a1623905 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -16,21 +16,13 @@ MirOTRMenuExecParam,*lpMirOTRMenuExecParam; // MirOTR MENU /////////////////////////////////////////// -static HGENMENU AddMirOTRMenuItem(CLISTMENUITEM *mi) +static HGENMENU AddMirOTRMenuItem(TMO_MenuItem *pmi, const char *pszService) { - TMO_MenuItem tmi = { 0 }; - tmi.flags = mi->flags; - tmi.hIcon = mi->hIcon; - tmi.hIcolibItem = mi->icolibItem; - tmi.position = mi->position; - tmi.name.t = mi->ptszName; - tmi.root = mi->hParentMenu; - - // owner data + // add owner data lpMirOTRMenuExecParam cmep = ( lpMirOTRMenuExecParam )mir_calloc(sizeof(MirOTRMenuExecParam)); - cmep->szServiceName = mir_strdup(mi->pszService); - tmi.ownerdata = cmep; - return Menu_AddItem(hMirOTRMenuObject, &tmi); + cmep->szServiceName = mir_strdup(pszService); + pmi->ownerdata = cmep; + return Menu_AddItem(hMirOTRMenuObject, pmi); } //called with: @@ -177,45 +169,40 @@ void InitMirOTRMenu(void) Menu_ConfigureObject(hMirOTRMenuObject, MCO_OPT_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu"); // menu items - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIF_DISABLED | CMIF_TCHAR; - mi.ptszName = LPGENT("OTR Status"); - mi.position = 0; - hStatusInfoItem = AddMirOTRMenuItem(&mi); - - mi.flags = CMIF_TCHAR | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED; - mi.ptszName = LANG_MENU_START; - mi.position = 100001; - mi.pszService = MS_OTR_MENUSTART; - mi.icolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); - AddMirOTRMenuItem(&mi); - - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; - mi.ptszName = LANG_MENU_REFRESH; - mi.position = 100002; - mi.pszService = MS_OTR_MENUREFRESH; - mi.icolibItem = IcoLib_GetIconHandle(ICON_FINISHED); - AddMirOTRMenuItem(&mi); - - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE; - mi.ptszName = LANG_MENU_STOP; - mi.position = 100003; - mi.pszService = MS_OTR_MENUSTOP; - mi.icolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); - AddMirOTRMenuItem(&mi); - - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; - mi.ptszName = LANG_MENU_VERIFY; - mi.position = 200001; - mi.pszService = MS_OTR_MENUVERIFY; - mi.icolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); - AddMirOTRMenuItem(&mi); - - mi.flags = CMIF_TCHAR | CMIF_CHECKED; - mi.ptszName = LANG_MENU_TOGGLEHTML; - mi.position = 300001; - mi.pszService = MS_OTR_MENUTOGGLEHTML; - hHTMLConvMenuItem = AddMirOTRMenuItem(&mi); + TMO_MenuItem tmi = { 0 }; + tmi.flags = CMIF_DISABLED | CMIF_TCHAR; + tmi.name.t = LPGENT("OTR Status"); + tmi.position = 0; + hStatusInfoItem = AddMirOTRMenuItem(&tmi, NULL); + + tmi.flags = CMIF_TCHAR | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED; + tmi.name.t = LANG_MENU_START; + tmi.position = 100001; + tmi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); + AddMirOTRMenuItem(&tmi, MS_OTR_MENUSTART); + + tmi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; + tmi.name.t = LANG_MENU_REFRESH; + tmi.position = 100002; + tmi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED); + AddMirOTRMenuItem(&tmi, MS_OTR_MENUREFRESH); + + tmi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE; + tmi.name.t = LANG_MENU_STOP; + tmi.position = 100003; + tmi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); + AddMirOTRMenuItem(&tmi, MS_OTR_MENUSTOP); + + tmi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; + tmi.name.t = LANG_MENU_VERIFY; + tmi.position = 200001; + tmi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); + AddMirOTRMenuItem(&tmi, MS_OTR_MENUVERIFY); + + tmi.flags = CMIF_TCHAR | CMIF_CHECKED; + tmi.name.t = LANG_MENU_TOGGLEHTML; + tmi.position = 300001; + hHTMLConvMenuItem = AddMirOTRMenuItem(&tmi, MS_OTR_MENUTOGGLEHTML); } void UninitMirOTRMenu(void) |