summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clcopts.cpp
diff options
context:
space:
mode:
authorslotwin <slotwin@users.noreply.github.com>2014-05-23 01:31:00 +0000
committerslotwin <slotwin@users.noreply.github.com>2014-05-23 01:31:00 +0000
commitadb15a53d1b4f617f30536b8f622b3eca6060af1 (patch)
treeb82a2aad1dcd980b2f932111189cccd41336a6d0 /plugins/Clist_modern/src/modern_clcopts.cpp
parent7c8227d28d71752509dfac29723141eba4733f06 (diff)
Clist_modern: proper capitalization in options and menus
options: fixed highlighting Apply button only when settings changed code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@9285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clcopts.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp71
1 files changed, 39 insertions, 32 deletions
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index f8c61b48ac..fd3bbd2154 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -56,20 +56,20 @@ struct FontOptionsList
char size;
};
-#define CLCGROUP LPGENT("Contact list")_T("/")LPGENT("Contact names")
-#define CLCLINESGROUP LPGENT("Contact list")_T("/")LPGENT("Row items")
-#define CLCFRAMESGROUP LPGENT("Contact list")_T("/")LPGENT("Frame texts")
-#define CLCCOLOURSGROUP LPGENT("Contact list")_T("/")LPGENT("Special colors")
+#define CLCGROUP LPGENT("Contact list")_T("/")LPGENT("Contact names")
+#define CLCLINESGROUP LPGENT("Contact list")_T("/")LPGENT("Row items")
+#define CLCFRAMESGROUP LPGENT("Contact list")_T("/")LPGENT("Frame texts")
+#define CLCCOLOURSGROUP LPGENT("Contact list")_T("/")LPGENT("Special colors")
-#define DEFAULT_COLOUR RGB(0, 0, 0)
-#define DEFAULT_GREYCOLOUR RGB(128, 128, 128)
-#define DEFAULT_BACKCOLOUR RGB(255, 255, 255)
+#define DEFAULT_COLOUR RGB(0, 0, 0)
+#define DEFAULT_GREYCOLOUR RGB(128, 128, 128)
+#define DEFAULT_BACKCOLOUR RGB(255, 255, 255)
-#define DEFAULT_FAMILY _T("Arial")
-#define DEFAULT_EFFECT { 0, 0x00000000, 0x00000000 }
+#define DEFAULT_FAMILY _T("Arial")
+#define DEFAULT_EFFECT { 0, 0x00000000, 0x00000000 }
-#define DEFAULT_SIZE -11
-#define DEFAULT_SMALLSIZE -8
+#define DEFAULT_SIZE -11
+#define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
{ FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
@@ -102,10 +102,10 @@ static struct FontOptionsList fontOptionsList[] = {
struct ColourOptionsList
{
- char* chGroup;
- char* chName;
- TCHAR* szGroup;
- TCHAR* szDescr;
+ char* chGroup;
+ char* chName;
+ TCHAR* szGroup;
+ TCHAR* szDescr;
COLORREF defColour;
};
@@ -126,7 +126,7 @@ static struct ColourOptionsList colourOptionsList[] =
{ "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
};
-void RegisterCLUIFonts( void )
+void RegisterCLUIFonts(void)
{
static bool registered = false;
if (registered)
@@ -287,19 +287,19 @@ static const struct CheckBoxValues_t offlineValues[] =
{ PF2_ONTHEPHONE, LPGENT("On the phone") }
};
-static void FillCheckBoxTree(HWND hwndTree,const struct CheckBoxValues_t *values,int nValues,DWORD style)
+static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
{
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_STATE|TVIF_IMAGE;
- for (int i=0; i < nValues; i++) {
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE | TVIF_IMAGE;
+ for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
tvis.item.pszText = TranslateTS(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam) != 0?2:1);
- tvis.item.iImage = tvis.item.iSelectedImage = (style&tvis.item.lParam) != 0?1:0;
- TreeView_InsertItem(hwndTree,&tvis);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam) != 0 ? 2 : 1);
+ tvis.item.iImage = tvis.item.iSelectedImage = (style & tvis.item.lParam) != 0 ? 1 : 0;
+ TreeView_InsertItem(hwndTree, &tvis);
}
}
@@ -309,11 +309,11 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_IMAGE;
tvi.hItem = TreeView_GetRoot(hwndTree);
- while(tvi.hItem) {
- TreeView_GetItem(hwndTree,&tvi);
+ while (tvi.hItem) {
+ TreeView_GetItem(hwndTree, &tvi);
if (tvi.iImage)
flags |= tvi.lParam;
- tvi.hItem = TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
}
return flags;
}
@@ -640,7 +640,7 @@ static int _GetNetVisibleProtoCount()
return netProtoCount;
}
-TCHAR *sortby[] = { LPGENT("Name"), LPGENT("Name (use locale settings)"), LPGENT("Status"), LPGENT("Last message time"), LPGENT("Account Name"), LPGENT("Rate"), LPGENT("-Nothing-") };
+TCHAR *sortby[] = { LPGENT("Name"), LPGENT("Name (use locale settings)"), LPGENT("Status"), LPGENT("Last message time"), LPGENT("Account name"), LPGENT("Rate"), LPGENT("-Nothing-") };
int sortbyValue[] = { SORTBY_NAME, SORTBY_NAME_LOCALE, SORTBY_STATUS, SORTBY_LASTMSG, SORTBY_PROTO, SORTBY_RATE, SORTBY_NOTHING };
static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -689,6 +689,8 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
return TRUE;
case WM_COMMAND:
+ if ((LOWORD(wParam) == IDC_CLSORT1 || LOWORD(wParam) == IDC_CLSORT2 || LOWORD(wParam) == IDC_CLSORT3) && HIWORD(wParam) != CBN_SELCHANGE)
+ break;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
@@ -835,8 +837,10 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY));
EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSPRIMARY), IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE));
}
- if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE) break;
- if (LOWORD(wParam) == IDC_BLINKTIME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0; // dont make apply enabled during buddy set crap
+ if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE)
+ return 0;
+ if ((LOWORD(wParam) == IDC_BLINKTIME || LOWORD(wParam) == IDC_CYCLETIME) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
@@ -865,7 +869,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
db_set_b(NULL, "CLUI", "XStatusTray", xOptions);
int cursel = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
- PROTOACCOUNT *pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cursel, 0);
+ PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cursel, 0);
if (!pa)
db_unset(NULL, "CList", "PrimaryStatus");
else
@@ -998,9 +1002,12 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC8), mode != 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC10), mode != 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC13), mode != 0);
+ if (HIWORD(wParam) != CBN_SELCHANGE || (HWND)lParam != GetFocus())
+ return 0;
}
- if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_HIDEDELAY2 || LOWORD(wParam) == IDC_HIDEDELAY || LOWORD(wParam) == IDC_SHOWDELAY || LOWORD(wParam) == IDC_MAXSIZEHEIGHT || LOWORD(wParam) == IDC_MINSIZEHEIGHT) &&
- (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_HIDEDELAY2 || LOWORD(wParam) == IDC_HIDEDELAY
+ || LOWORD(wParam) == IDC_SHOWDELAY || LOWORD(wParam) == IDC_MAXSIZEHEIGHT || LOWORD(wParam) == IDC_MINSIZEHEIGHT)
+ && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
// Enable apply button
@@ -1931,7 +1938,7 @@ static clist_opt_items[] =
{ LPGEN("List"), IDD_OPT_CLC, DlgProcClistListOpts, 0 },
{ LPGEN("Window"), IDD_OPT_CLUI, DlgProcClistWindowOpts, 0 },
{ LPGEN("Behavior"), IDD_OPT_CLUI_2, DlgProcClistBehaviourOpts, 0 },
- { LPGEN("Status Bar"), IDD_OPT_SBAR, DlgProcSBarOpts, 0 },
+ { LPGEN("Status bar"), IDD_OPT_SBAR, DlgProcSBarOpts, 0 },
{ LPGEN("Additional stuff"), IDD_OPT_META_CLC, DlgProcClistAdditionalOpts, 0 }
};