summaryrefslogtreecommitdiff
path: root/plugins/Clist_blind
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-01 21:49:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-01 21:49:02 +0300
commitb740f55d6ae94416487e0755c452fb3ceb43a87f (patch)
tree2281bcc8041c82a0e5e379c967f6491f51a6cf7b /plugins/Clist_blind
parent01313480057e4272d545732fc3a21150869edf54 (diff)
Clist_blind: CLUI options -> UI classes
Diffstat (limited to 'plugins/Clist_blind')
-rw-r--r--plugins/Clist_blind/src/cluiopts.cpp529
-rw-r--r--plugins/Clist_blind/src/stdafx.h1
2 files changed, 262 insertions, 268 deletions
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp
index f6db0ad4f8..3464f9b892 100644
--- a/plugins/Clist_blind/src/cluiopts.cpp
+++ b/plugins/Clist_blind/src/cluiopts.cpp
@@ -24,296 +24,289 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+// Common contact list window options
+
+class CCluiOptsDlg : public CDlgBase
{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TOOLWND, g_plugin.getByte("ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MIN2TRAY, g_plugin.getByte("Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
- EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE);
- }
- CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(0, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
- SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(0, "CLUI", "MaxSizeHeight", 75));
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(0, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, g_plugin.getByte("AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
- SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("HideTime", SETTING_HIDETIME_DEFAULT), 0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), FALSE);
- }
+ CCtrlSpin spinMaxSize, spinHideTime;
+ CCtrlCheck chkAutoHide, chkAutoSize, chkCaption, chkToolWnd, chkTransparent;
+ CCtrlSlider m_active, m_inactive;
- {
- DBVARIANT dbv;
- if (!g_plugin.getWString("TitleText", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.pwszVal);
- db_free(&dbv);
- }
- else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
- }
- CheckDlgButton(hwndDlg, IDC_TRANSPARENT, g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
-
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), FALSE);
- }
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE,
- g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
- SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
- return TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_AUTOHIDE) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- }
- else if (LOWORD(wParam) == IDC_TRANSPARENT) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- }
- else if (LOWORD(wParam) == IDC_AUTOSIZE) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- }
- else if (LOWORD(wParam) == IDC_TOOLWND) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- }
- else if (LOWORD(wParam) == IDC_SHOWCAPTION) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)
- && IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- }
+public:
+ CCluiOptsDlg() :
+ CDlgBase(g_plugin, IDD_OPT_CLUI),
+ m_active(this, IDC_TRANSACTIVE, 255, 1),
+ m_inactive(this, IDC_TRANSINACTIVE, 255, 1),
+ chkCaption(this, IDC_SHOWCAPTION),
+ chkToolWnd(this, IDC_TOOLWND),
+ chkAutoHide(this, IDC_AUTOHIDE),
+ chkAutoSize(this, IDC_AUTOSIZE),
+ chkTransparent(this, IDC_TRANSPARENT),
+ spinMaxSize(this, IDC_MAXSIZESPIN, 100),
+ spinHideTime(this, IDC_HIDETIMESPIN, 900, 1)
+ {
+ m_active.OnChange = m_inactive.OnChange = Callback(this, &CCluiOptsDlg::onChange_Slider);
- if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) &&
- (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
- return 0;
-
- // Enable apply button
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_HSCROLL:
- {
- char str[10];
- mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
- }
- if (wParam != 0x12345678)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
- db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
- db_set_b(0, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- g_plugin.setByte("AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- g_plugin.setWord("HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- g_plugin.setByte("Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
- g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
- {
- wchar_t title[256];
- GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- g_plugin.setWString("TitleText", title);
- SetWindowText(g_clistApi.hwndContactList, title);
- }
- g_clistApi.pfnLoadCluiGlobalOpts();
- SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
- SWP_NOMOVE | SWP_NOSIZE);
- if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) {
- // Window must be hidden to dynamically remove the taskbar button.
- // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
- WINDOWPLACEMENT p;
- p.length = sizeof(p);
- GetWindowPlacement(g_clistApi.hwndContactList, &p);
- ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
- SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE,
- GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- SetWindowPlacement(g_clistApi.hwndContactList, &p);
- }
- else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
-
- if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindowA("Progman", nullptr);
- if (IsWindow(hProgMan))
- SetParent(g_clistApi.hwndContactList, hProgMan);
- }
- else SetParent(g_clistApi.hwndContactList, nullptr);
-
- if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION))
- SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
- GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
- else
- SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
- GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
-
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(g_clistApi.hwndContactList, nullptr);
- else
- SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
-
- SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
- if (IsIconic(g_clistApi.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
- ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
- if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
- }
- else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
-
- SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
- return TRUE;
- }
- break;
+ chkCaption.OnChange = Callback(this, &CCluiOptsDlg::onChange_Caption);
+ chkToolWnd.OnChange = Callback(this, &CCluiOptsDlg::onChange_ToolWnd);
+ chkAutoHide.OnChange = Callback(this, &CCluiOptsDlg::onChange_AutoHide);
+ chkAutoSize.OnChange = Callback(this, &CCluiOptsDlg::onChange_AutoSize);
+ chkTransparent.OnChange = Callback(this, &CCluiOptsDlg::onChange_Transparent);
}
- return FALSE;
-}
-static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(0, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
- {
- BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
- CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
- }
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(0, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, db_get_b(0, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(0, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWGRIP, db_get_b(0, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), FALSE);
+ bool OnInitDialog() override
+ {
+ CheckDlgButton(m_hwnd, IDC_BRINGTOFRONT, g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_ONTOP, g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_TOOLWND, g_plugin.getByte("ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_MIN2TRAY, g_plugin.getByte("Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SHOWMAINMENU, db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_CLIENTDRAG, db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_AUTOSIZEUPWARD, db_get_b(0, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
+
+ spinMaxSize.SetPosition(db_get_b(0, "CLUI", "MaxSizeHeight", 75));
+ spinHideTime.SetPosition(g_plugin.getWord("HideTime", SETTING_HIDETIME_DEFAULT));
+
+ chkCaption.SetState(db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT));
+ chkAutoSize.SetState(db_get_b(0, "CLUI", "AutoSize", 0));
+ chkAutoHide.SetState(g_plugin.getByte("AutoHide", SETTING_AUTOHIDE_DEFAULT));
+ chkTransparent.SetState(g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT));
+
+ ptrW wszTitle(g_plugin.getWStringA("TitleText"));
+ if (wszTitle)
+ SetDlgItemTextW(m_hwnd, IDC_TITLETEXT, wszTitle);
+ else
+ SetDlgItemTextA(m_hwnd, IDC_TITLETEXT, MIRANDANAME);
+
+ m_active.SetPosition(g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT));
+ m_inactive.SetPosition(g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONTOP));
+ g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TOOLWND));
+ g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_BRINGTOFRONT));
+ db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTOSIZEUPWARD));
+ g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
+ g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
+ db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWCAPTION));
+ db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_CLIENTDRAG));
+ g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_MIN2TRAY));
+
+ g_plugin.setWord("HideTime", spinHideTime.GetPosition());
+ db_set_b(0, "CLUI", "MaxSizeHeight", spinMaxSize.GetPosition());
+
+ db_set_b(0, "CLUI", "AutoSize", chkAutoSize.GetState());
+ g_plugin.setByte("AutoHide", chkAutoHide.GetState());
+ g_plugin.setByte("Transparent", chkTransparent.GetState());
+
+ g_plugin.setByte("Alpha", m_active.GetPosition());
+ g_plugin.setByte("AutoAlpha", m_inactive.GetPosition());
+
+ wchar_t title[256];
+ GetDlgItemText(m_hwnd, IDC_TITLETEXT, title, _countof(title));
+ g_plugin.setWString("TitleText", title);
+ SetWindowText(g_clistApi.hwndContactList, title);
+
+ g_clistApi.pfnLoadCluiGlobalOpts();
+ SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(m_hwnd, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE);
+ if (IsDlgButtonChecked(m_hwnd, IDC_TOOLWND)) {
+ // Window must be hidden to dynamically remove the taskbar button.
+ // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
+ WINDOWPLACEMENT p;
+ p.length = sizeof(p);
+ GetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(g_clistApi.hwndContactList, &p);
}
- return TRUE;
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_SHOWSBAR) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
+
+ if (IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP)) {
+ HWND hProgMan = FindWindowA("Progman", nullptr);
+ if (IsWindow(hProgMan))
+ ::SetParent(g_clistApi.hwndContactList, hProgMan);
}
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- db_set_b(0, "CLUI", "SBarShow",
- (BYTE)((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0)));
- db_set_b(0, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
- db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- db_set_b(0, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
- g_clistApi.pfnLoadCluiGlobalOpts();
- if (db_get_b(0, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(g_clistApi.hwndStatus);
- int flags = WS_CHILD | CCS_BOTTOM;
- db_set_b(0, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
- DestroyWindow(g_clistApi.hwndStatus);
- flags |= db_get_b(0, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= db_get_b(0, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
- }
- if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
- ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
- else
- ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
- SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
- return TRUE;
+ else ::SetParent(g_clistApi.hwndContactList, nullptr);
+
+ if (IsDlgButtonChecked(m_hwnd, IDC_SHOWCAPTION))
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
+ else
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+
+ if (BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU))
+ SetMenu(g_clistApi.hwndContactList, nullptr);
+ else
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
+
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
+ if (IsIconic(g_clistApi.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_TOOLWND))
+ ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(m_hwnd, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
+ if (IsDlgButtonChecked(m_hwnd, IDC_TRANSPARENT)) {
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
- break;
+ else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+
+ SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ return true;
}
- return FALSE;
-}
-/****************************************************************************************/
+ void onChange_AutoHide(CCtrlCheck *pCheck)
+ {
+ bool bEnabled = pCheck->IsChecked();
+ EnableWindow(GetDlgItem(m_hwnd, IDC_HIDETIME), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_HIDETIMESPIN), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_STATIC01), bEnabled);
+ }
+
+ void onChange_AutoSize(CCtrlCheck *pCheck)
+ {
+ bool bEnabled = pCheck->IsChecked();
+ EnableWindow(GetDlgItem(m_hwnd, IDC_STATIC21), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_STATIC22), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MAXSIZEHEIGHT), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MAXSIZESPIN), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_AUTOSIZEUPWARD), bEnabled);
+ }
+
+ void onChange_Caption(CCtrlCheck *pCheck)
+ {
+ bool bEnabled = pCheck->IsChecked();
+ EnableWindow(GetDlgItem(m_hwnd, IDC_TOOLWND), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MIN2TRAY), !chkToolWnd.IsChecked() && bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_TITLETEXT), bEnabled);
+ }
+
+ void onChange_Transparent(CCtrlCheck *pCheck)
+ {
+ bool bEnabled = pCheck->IsChecked();
+ EnableWindow(GetDlgItem(m_hwnd, IDC_STATIC11), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_STATIC12), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_TRANSACTIVE), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_TRANSINACTIVE), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_ACTIVEPERC), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_INACTIVEPERC), bEnabled);
+ }
-static UINT expertOnlyControls[] =
+ void onChange_ToolWnd(CCtrlCheck *pCheck)
+ {
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MIN2TRAY), !pCheck->IsChecked());
+ }
+
+ void onChange_Slider(CCtrlSlider*)
+ {
+ char str[10];
+ mir_snprintf(str, "%d%%", 100 * m_inactive.GetPosition() / 255);
+ SetDlgItemTextA(m_hwnd, IDC_INACTIVEPERC, str);
+ mir_snprintf(str, "%d%%", 100 * m_active.GetPosition() / 255);
+ SetDlgItemTextA(m_hwnd, IDC_ACTIVEPERC, str);
+ }
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Status bar options
+
+class CStatusBarOpts : public CDlgBase
{
- IDC_BRINGTOFRONT, IDC_AUTOSIZE, IDC_STATIC21, IDC_MAXSIZEHEIGHT, IDC_MAXSIZESPIN,
- IDC_STATIC22, IDC_AUTOSIZEUPWARD, IDC_SHOWMAINMENU, IDC_SHOWCAPTION, IDC_CLIENTDRAG
+ CCtrlCheck chkShow;
+
+public:
+ CStatusBarOpts() :
+ CDlgBase(g_plugin, IDD_OPT_SBAR),
+ chkShow(this, IDC_SHOWSBAR)
+ {
+ chkShow.OnChange = Callback(this, &CStatusBarOpts::onChange_Show);
+ }
+
+ bool OnInitDialog() override
+ {
+ chkShow.SetState(db_get_b(0, "CLUI", "ShowSBar", 1));
+
+ BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
+ CheckDlgButton(m_hwnd, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(m_hwnd, IDC_RIGHTSTATUS, db_get_b(0, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(m_hwnd, IDC_RIGHTMIRANDA, IsDlgButtonChecked(m_hwnd, IDC_RIGHTSTATUS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_EQUALSECTIONS, db_get_b(0, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SBPANELBEVEL, db_get_b(0, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SHOWGRIP, db_get_b(0, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ db_set_b(0, "CLUI", "ShowSBar", chkShow.GetState());
+ db_set_b(0, "CLUI", "SBarShow",
+ (BYTE)((IsDlgButtonChecked(m_hwnd, IDC_SHOWICON) ? 1 : 0) |
+ (IsDlgButtonChecked(m_hwnd, IDC_SHOWPROTO) ? 2 : 0) |
+ (IsDlgButtonChecked(m_hwnd, IDC_SHOWSTATUS) ? 4 : 0)));
+ db_set_b(0, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_RIGHTMIRANDA));
+ db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SBPANELBEVEL));
+ g_clistApi.pfnLoadCluiGlobalOpts();
+ if (db_get_b(0, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP)) {
+ HWND parent = GetParent(g_clistApi.hwndStatus);
+ int flags = WS_CHILD | CCS_BOTTOM;
+ db_set_b(0, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP));
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ DestroyWindow(g_clistApi.hwndStatus);
+ flags |= db_get_b(0, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= db_get_b(0, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ }
+
+ if (chkShow.GetState())
+ ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
+ else
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ return true;
+ }
+
+ void onChange_Show(CCtrlCheck *pCheck)
+ {
+ bool bEnabled = pCheck->IsChecked();
+ EnableWindow(GetDlgItem(m_hwnd, IDC_SHOWICON), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_SHOWPROTO), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_SHOWSTATUS), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_RIGHTSTATUS), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_RIGHTMIRANDA), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_EQUALSECTIONS), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_SBPANELBEVEL), bEnabled);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_SHOWGRIP), bEnabled);
+ }
};
+/****************************************************************************************/
+
int CluiOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI);
+ odp.flags = ODPF_BOLDGROUPS;
+
odp.szTitle.a = LPGEN("Window");
odp.szGroup.a = LPGEN("Contact list");
- odp.pfnDlgProc = DlgProcCluiOpts;
- odp.flags = ODPF_BOLDGROUPS;
+ odp.pDialog = new CCluiOptsDlg();
g_plugin.addOptions(wParam, &odp);
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SBAR);
odp.szTitle.a = LPGEN("Status bar");
- odp.pfnDlgProc = DlgProcSBarOpts;
+ odp.pDialog = new CStatusBarOpts();
odp.flags = ODPF_BOLDGROUPS;
g_plugin.addOptions(wParam, &odp);
return 0;
diff --git a/plugins/Clist_blind/src/stdafx.h b/plugins/Clist_blind/src/stdafx.h
index 667a637575..95e56c9044 100644
--- a/plugins/Clist_blind/src/stdafx.h
+++ b/plugins/Clist_blind/src/stdafx.h
@@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <newpluginapi.h>
#include <m_clistint.h>
#include <m_database.h>
+#include <m_gui.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_protosvc.h>