summaryrefslogtreecommitdiff
path: root/plugins/MyDetails/src/options.cpp
diff options
context:
space:
mode:
authorslotwin <slotwin@users.noreply.github.com>2014-05-31 14:06:32 +0000
committerslotwin <slotwin@users.noreply.github.com>2014-05-31 14:06:32 +0000
commitabe57dd9c571cc80cf50aad3436e4d6f3cf421a2 (patch)
treeffe940ad0ed29d7b45d9d1df719a2906e9d6d93a /plugins/MyDetails/src/options.cpp
parent89df71f0740a1fe0a0424e4c71c2a15e8bfe8dc7 (diff)
MyDetails plugin: proper capitalization in options and menus
option page - improved display of disabled options code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@9377 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MyDetails/src/options.cpp')
-rw-r--r--plugins/MyDetails/src/options.cpp142
1 files changed, 83 insertions, 59 deletions
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp
index 148f63e633..b78db698d9 100644
--- a/plugins/MyDetails/src/options.cpp
+++ b/plugins/MyDetails/src/options.cpp
@@ -26,34 +26,34 @@ Options opts;
// Functions //////////////////////////////////////////////////////////////////////////////////////
-static OptPageControl pageControls[] = {
- { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE) 1 },
- { &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD) 5, IDC_CYCLE_TIME_SPIN, (WORD) 1, (WORD) 255 },
- { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (BYTE) 1 },
- { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (BYTE) 0 },
- { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (BYTE) 0 },
- { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (BYTE) 0 },
- { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (BYTE) 1 },
- { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (BYTE) 0 },
- { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (BYTE) 0 },
- { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (BYTE) 0 },
- { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (BYTE) 0 },
- { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (BYTE) 0 },
- { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (BYTE) 0 },
- { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (BYTE) 0 },
- { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (BYTE) 0 },
- { &opts.draw_avatar_custom_size_pixels, CONTROL_SPIN, IDC_AVATAR_CUSTOM_SIZE, "AvatarCustomSizePixels", (WORD) 30, IDC_AVATAR_CUSTOM_SIZE_SPIN, (WORD) 1, (WORD) 255 },
- { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (BYTE) 0 },
- { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (BYTE) 1 },
- { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (BYTE) 0 },
- { &opts.draw_avatar_custom_corner_size, CONTROL_SPIN, IDC_AVATAR_CUSTOM_CORNER_SIZE, "AvatarCustomCornerSize", (WORD) 4, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, (WORD) 1, (WORD) 255 },
- { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (BYTE) 1 },
- { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (BYTE) 0 },
- { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (BYTE) 0 },
- { &opts.borders[RIGHT], CONTROL_SPIN, IDC_BORDER_RIGHT, "BorderRight", (WORD) 8, IDC_BORDER_RIGHT_SPIN, (WORD) 0, (WORD) 255 },
- { &opts.borders[LEFT], CONTROL_SPIN, IDC_BORDER_LEFT, "BorderLeft", (WORD) 8, IDC_BORDER_LEFT_SPIN, (WORD) 0, (WORD) 255 },
- { &opts.borders[TOP], CONTROL_SPIN, IDC_BORDER_TOP, "BorderTop", (WORD) 8, IDC_BORDER_TOP_SPIN, (WORD) 0, (WORD) 255 },
- { &opts.borders[BOTTOM], CONTROL_SPIN, IDC_BORDER_BOTTOM, "BorderBottom", (WORD) 8, IDC_BORDER_BOTTOM_SPIN, (WORD) 0, (WORD) 255 },
+static OptPageControl pageControls[] = {
+ { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE)1 },
+ { &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD)5, IDC_CYCLE_TIME_SPIN, (WORD)1, (WORD)255 },
+ { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (BYTE)1 },
+ { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (BYTE)0 },
+ { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (BYTE)0 },
+ { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (BYTE)0 },
+ { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (BYTE)1 },
+ { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (BYTE)0 },
+ { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (BYTE)0 },
+ { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (BYTE)0 },
+ { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (BYTE)0 },
+ { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (BYTE)0 },
+ { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (BYTE)0 },
+ { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (BYTE)0 },
+ { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (BYTE)0 },
+ { &opts.draw_avatar_custom_size_pixels, CONTROL_SPIN, IDC_AVATAR_CUSTOM_SIZE, "AvatarCustomSizePixels", (WORD)30, IDC_AVATAR_CUSTOM_SIZE_SPIN, (WORD)1, (WORD)255 },
+ { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (BYTE)0 },
+ { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (BYTE)1 },
+ { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (BYTE)0 },
+ { &opts.draw_avatar_custom_corner_size, CONTROL_SPIN, IDC_AVATAR_CUSTOM_CORNER_SIZE, "AvatarCustomCornerSize", (WORD)4, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, (WORD)1, (WORD)255 },
+ { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (BYTE)1 },
+ { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (BYTE)0 },
+ { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (BYTE)0 },
+ { &opts.borders[RIGHT], CONTROL_SPIN, IDC_BORDER_RIGHT, "BorderRight", (WORD)8, IDC_BORDER_RIGHT_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[LEFT], CONTROL_SPIN, IDC_BORDER_LEFT, "BorderLeft", (WORD)8, IDC_BORDER_LEFT_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[TOP], CONTROL_SPIN, IDC_BORDER_TOP, "BorderTop", (WORD)8, IDC_BORDER_TOP_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[BOTTOM], CONTROL_SPIN, IDC_BORDER_BOTTOM, "BorderBottom", (WORD)8, IDC_BORDER_BOTTOM_SPIN, (WORD)0, (WORD)255 },
};
@@ -63,8 +63,8 @@ void LoadOptions()
LoadOpts(pageControls, SIZEOF(pageControls), MODULE_NAME);
// This is created here to assert that this key always exists
- opts.refresh_status_message_timer = db_get_w(NULL,"MyDetails","RefreshStatusMessageTimer",12);
- db_set_w(NULL,"MyDetails","RefreshStatusMessageTimer", opts.refresh_status_message_timer);
+ opts.refresh_status_message_timer = db_get_w(NULL, "MyDetails", "RefreshStatusMessageTimer", 12);
+ db_set_w(NULL, "MyDetails", "RefreshStatusMessageTimer", opts.refresh_status_message_timer);
SetCycleTime();
RefreshFrameAndCalcRects();
@@ -76,46 +76,70 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (msg) {
case WM_INITDIALOG:
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),FALSE);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK), FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS) || !IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN), FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW_PROTO_NAME))
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_CYCLE_PROTO_BUTTON),FALSE);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_SHOW_PROTO_NAME))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_CYCLE_PROTO_BUTTON), FALSE);
- if ( !ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_REPLACE_SMILEYS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USE_CONTACT_LIST_SMILEYS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_RESIZE_SMILEYS),FALSE);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_SIZE_CHK)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_SIZE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_SIZE_SPIN), FALSE);
}
- if ( !ServiceExists(MS_CLIST_FRAMES_SETFRAMEOPTIONS))
- EnableWindow(GetDlgItem(hwndDlg,IDC_RESIZE_FRAME),FALSE);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_CYCLE_THROUGH_PROTOS)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLE_TIME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLE_TIME_SPIN), FALSE);
+ }
+
+ if (!IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USE_CONTACT_LIST_SMILEYS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RESIZE_SMILEYS), FALSE);
+ }
+
+ if (!ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REPLACE_SMILEYS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USE_CONTACT_LIST_SMILEYS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RESIZE_SMILEYS), FALSE);
+ }
+
+ if (!ServiceExists(MS_CLIST_FRAMES_SETFRAMEOPTIONS))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RESIZE_FRAME), FALSE);
break;
case WM_COMMAND:
- if (LOWORD(wParam)==IDC_AVATAR_DRAW_BORDER) {
- BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),enabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),enabled);
+ if (LOWORD(wParam) == IDC_AVATAR_ROUND_CORNERS || LOWORD(wParam) == IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK) {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK), enabled);
+ enabled = enabled && IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN), enabled);
+ }
+ else if (LOWORD(wParam) == IDC_SHOW_PROTO_NAME) {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_SHOW_PROTO_NAME);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_CYCLE_PROTO_BUTTON), enabled);
+ }
+ else if (LOWORD(wParam) == IDC_AVATAR_CUSTOM_SIZE_CHK) {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_SIZE_CHK);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_SIZE), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_SIZE_SPIN), enabled);
}
- else if (LOWORD(wParam)==IDC_AVATAR_ROUND_CORNERS) {
- BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),enabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),enabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),enabled);
+ else if (LOWORD(wParam) == IDC_CYCLE_THROUGH_PROTOS) {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_CYCLE_THROUGH_PROTOS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLE_TIME), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLE_TIME_SPIN), enabled);
}
- else if (LOWORD(wParam)==IDC_SHOW_PROTO_NAME) {
- BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW_PROTO_NAME);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_CYCLE_PROTO_BUTTON),enabled);
+ else if (LOWORD(wParam) == IDC_REPLACE_SMILEYS) {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USE_CONTACT_LIST_SMILEYS), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RESIZE_SMILEYS), enabled);
}
break;
@@ -135,7 +159,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
return ret;
}
-int InitOptionsCallback(WPARAM wParam,LPARAM)
+int InitOptionsCallback(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.position = -200000000;
@@ -143,7 +167,7 @@ int InitOptionsCallback(WPARAM wParam,LPARAM)
odp.pfnDlgProc = DlgProcOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
odp.ptszGroup = LPGENT("Contact list");
- odp.ptszTitle = LPGENT("My Details");
+ odp.ptszTitle = LPGENT("My details");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
return 0;