From 13de244e9d4454d23b6f8fbc52a498d368298ad2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 25 May 2012 11:02:42 +0000 Subject: clist modern options fix git-svn-id: http://svn.miranda-ng.org/main/trunk@171 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Modernb/modern_statusbar_options.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/Modernb/modern_statusbar_options.cpp b/plugins/Modernb/modern_statusbar_options.cpp index 6e46584b8d..7bea01fe57 100644 --- a/plugins/Modernb/modern_statusbar_options.cpp +++ b/plugins/Modernb/modern_statusbar_options.cpp @@ -82,8 +82,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) BOOL perProto = (BOOL)IsDlgButtonChecked(hwndDlg,IDC_STATUSBAR_PER_PROTO); HWND hwndComboBox = GetDlgItem( hwndDlg, IDC_STATUSBAR_PROTO_LIST ); StatusBarProtocolOptions sbpo; - int curSelProto = SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0) - 1; //first entry is the combo box is a constant. - + int curSelProto = SendMessage(hwndComboBox, CB_GETITEMDATA, SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0), NULL) - 1; //first entry is the combo box is a constant. if (curSelProto < 0) perProto = FALSE; @@ -169,8 +168,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) LOGFONTA lf; BOOL perProto = IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO); HWND hwndComboBox = GetDlgItem( hwndDlg, IDC_STATUSBAR_PROTO_LIST ); - int curSelProto = SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0) - 1; //first entry in the combo box is a constant - + int curSelProto = SendMessage(hwndComboBox, CB_GETITEMDATA, SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0), NULL) - 1; //first entry is the combo box is a constant. if (curSelProto < 0) perProto = FALSE; @@ -203,17 +201,15 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_STATUSBAR_PROTO_LIST),GWLP_USERDATA,(LONG_PTR)dat); SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT( "<>" )); + SendMessage(hwndComboBox, CB_SETITEMDATA, 0, (LPARAM)0); for ( i = 0; i < count; i++ ) { - szName = accs[i]->szProtoName; + szName = accs[i]->szModuleName; dat[i].szName = szName; -#ifdef UNICODE - SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName); -#else - SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName); -#endif + DWORD dwNewId = SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName); + SendMessage(hwndComboBox, CB_SETITEMDATA, dwNewId, (LPARAM)(i+1)); mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szName); dat[i].AccountIsCustomized = ModernGetSettingByte(NULL,"CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT); -- cgit v1.2.3