diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-15 16:48:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-15 16:48:03 +0000 |
commit | 3744b5146df8530d3b43a972d58223cb3ffb533c (patch) | |
tree | a322ca4d0f8eda203cdb618071399c2d0a30e841 /src/modules/clist | |
parent | b92b010ae92db3f61a20ff2f579a5b717cfc8168 (diff) |
- fixes for the plugins options' dialog;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@430 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/genmenu.cpp | 29 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 4 |
3 files changed, 21 insertions, 14 deletions
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index c6413ee556..2399286f72 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -772,6 +772,17 @@ static int WhereToPlace( HMENU hMenu, PMO_MenuItem mi ) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static DWORD GetMenuItemType(HMENU hMenu, int uItem)
+{
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_TYPE;
+ GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
+ return mii.fType;
+}
+
static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *lpmii)
{
PMO_IntMenuItem pimi = MO_GetIntMenuItem(( HGENMENU )lpmii->dwItemData );
@@ -782,20 +793,14 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l mii.cbSize = MENUITEMINFO_V4_SIZE;
//check for separator before
if ( uItem ) {
- mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ mii.fMask = MIIM_DATA;
GetMenuItemInfo( hMenu, uItem-1, TRUE, &mii );
PMO_IntMenuItem p = MO_GetIntMenuItem(( HGENMENU )mii.dwItemData );
if ( p != NULL && mii.fType != MFT_SEPARATOR) {
int needSeparator = (p->mi.position / SEPARATORPOSITIONINTERVAL) != (pimi->mi.position / SEPARATORPOSITIONINTERVAL);
if ( needSeparator) {
//but might be supposed to be after the next one instead
- memset(&mii, 0, sizeof(mii));
- mii.cbSize = MENUITEMINFO_V4_SIZE;
- if ( uItem < GetMenuItemCount( hMenu )) {
- mii.fMask = MIIM_TYPE;
- GetMenuItemInfo( hMenu, uItem, TRUE, &mii );
- }
- if ( mii.fType != MFT_SEPARATOR) {
+ if ( uItem < GetMenuItemCount(hMenu) && GetMenuItemType(hMenu, uItem) != MFT_SEPARATOR) {
mii.fMask = MIIM_TYPE;
mii.fType = MFT_SEPARATOR;
InsertMenuItem( hMenu, uItem, TRUE, &mii );
@@ -834,9 +839,11 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l InsertMenuItem( hMenu, uItem, TRUE, &mii);
}
-//wparam started hMenu
-//lparam ListParam*
-//result hMenu
+/////////////////////////////////////////////////////////////////////////////////////////
+// wparam started hMenu
+// lparam ListParam*
+// result hMenu
+
INT_PTR MO_BuildMenu(WPARAM wParam, LPARAM lParam)
{
if ( !bIsGenMenuInited )
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 421616b5e5..3937306464 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -731,7 +731,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HWND tvw;
HTREEITEM * pSIT;
HTREEITEM FirstItem=NULL;
- UINT uITCnt, uSic ;
+ UINT uITCnt, uSic;
tvw=GetDlgItem(hwndDlg, IDC_MENUITEMS);
uITCnt=TreeView_GetCount(tvw);
uSic=0;
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 75e18e0a4e..c741c02008 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -184,7 +184,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) CLISTGROUPCHANGE grpChg = { sizeof(CLISTGROUPCHANGE), NULL, NULL };
for (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- hContact ;
+ hContact;
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0))
{
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
@@ -541,7 +541,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) int InitGroupServices(void)
{
- for (int i = 0; ; i++)
+ for (int i = 0;; i++)
{
char str[32];
_itoa(i, str, 10);
|