summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/TopToolBar/main.rc66
-rw-r--r--plugins/TopToolBar/toolbar.cpp3
-rw-r--r--plugins/TopToolBar/ttbopt.cpp131
3 files changed, 3 insertions, 197 deletions
diff --git a/plugins/TopToolBar/main.rc b/plugins/TopToolBar/main.rc
index 84b1421f1f..8f9f3bedce 100644
--- a/plugins/TopToolBar/main.rc
+++ b/plugins/TopToolBar/main.rc
@@ -175,72 +175,6 @@ IDI_MIRANDAUP ICON "icos\\Show Main Menu_UP.ico"
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// English (Canada) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_OPT_TTBBKG DIALOGEX 0, 0, 235, 132
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "TopToolBar Background",IDC_STATIC,4,4,227,124
- LTEXT "Background colour:",IDC_STATIC,12,20,72,8,NOT WS_GROUP
- CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,84,19,32,10
- LTEXT "Selection colour:",IDC_STATIC,12,36,72,8,NOT WS_VISIBLE
- CONTROL "",IDC_SELCOLOUR,"ColourPicker",NOT WS_VISIBLE | WS_TABSTOP,84,35,32,10
- CONTROL "Use background bitmap",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,53,161,10
- EDITTEXT IDC_FILENAME,22,67,184,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_BROWSE,208,67,15,11
- CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,84,100,10
- CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,84,101,10
- CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,97,100,10
- CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,97,101,10
- CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,22,110,100,10
- CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,110,101,10
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_OPT_TTBBKG, DIALOG
- BEGIN
- LEFTMARGIN, 4
- RIGHTMARGIN, 231
- VERTGUIDE, 12
- VERTGUIDE, 22
- VERTGUIDE, 122
- TOPMARGIN, 4
- BOTTOMMARGIN, 128
- HORZGUIDE, 24
- HORZGUIDE, 40
- HORZGUIDE, 73
- HORZGUIDE, 89
- HORZGUIDE, 102
- HORZGUIDE, 115
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // English (Canada) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp
index 6d41d19aff..e51d99f259 100644
--- a/plugins/TopToolBar/toolbar.cpp
+++ b/plugins/TopToolBar/toolbar.cpp
@@ -826,11 +826,10 @@ int OnModulesLoad(WPARAM wParam, LPARAM lParam)
if (hEvent != 0)
CallService(MS_SYSTEM_WAITONHANDLE, (WPARAM)hEvent, (LPARAM)"TTB_ONSTARTUPFIRE");
- if ( ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
+ if ( HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange)) {
char buf[256];
sprintf(buf, "TopToolBar Background/%s", TTB_OPTDIR);
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)buf, 0);
- HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange);
}
ttbOptionsChanged();
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp
index 05a0a63221..e410f71dfa 100644
--- a/plugins/TopToolBar/ttbopt.cpp
+++ b/plugins/TopToolBar/ttbopt.cpp
@@ -520,144 +520,17 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Options window: background
-
-static INT_PTR CALLBACK DlgProcTTBBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BITMAP, DBGetContactSettingByte(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
- SendMessage(hwndDlg, WM_USER+10, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, TTBDEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, TTB_OPTDIR, "BkColour", TTBDEFAULT_BKCOLOUR));
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, TTBDEFAULT_SELBKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, TTB_OPTDIR, "SelBkColour", TTBDEFAULT_SELBKCOLOUR));
- {
- DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, TTB_OPTDIR, "BkBitmap", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
- DBFreeVariant(&dbv);
- }
-
- WORD bmpUse = DBGetContactSettingWord(NULL, TTB_OPTDIR, "BkBmpUse", TTBDEFAULT_BKBMPUSE);
- CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TILEV, bmpUse&CLBF_TILEV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SCROLL, bmpUse&CLBF_SCROLL?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, bmpUse&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
-
- HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND, DWORD);
- MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND, DWORD))GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
- if (MySHAutoComplete)
- MySHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
- }
- return TRUE;
-
- case WM_USER+10:
- EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TILEH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TILEV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- EnableWindow(GetDlgItem(hwndDlg, IDC_PROPORTIONAL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- break;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_BROWSE) {
- TCHAR str[MAX_PATH];
- OPENFILENAME ofn = {0};
- TCHAR filter[512];
-
- GetDlgItemText(hwndDlg, IDC_FILENAME, str, sizeof(str));
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
- ofn.hInstance = NULL;
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGST, SIZEOF(filter), (LPARAM)filter);
- ofn.lpstrFilter = filter;
- ofn.lpstrFile = str;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- ofn.nMaxFile = sizeof(str);
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T("bmp");
- if (!GetOpenFileName(&ofn))
- break;
-
- SetDlgItemText(hwndDlg, IDC_FILENAME, str);
- }
- else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE)
- break;
-
- if (LOWORD(wParam) == IDC_BITMAP) SendMessage(hwndDlg, WM_USER+10, 0, 0);
- if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_APPLY:
- DBWriteContactSettingByte(NULL, TTB_OPTDIR, "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- {
- COLORREF col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
- if (col == TTBDEFAULT_BKCOLOUR)
- DBDeleteContactSetting(NULL, TTB_OPTDIR, "BkColour");
- else
- DBWriteContactSettingDword(NULL, TTB_OPTDIR, "BkColour", col);
- col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
- if (col == TTBDEFAULT_SELBKCOLOUR)
- DBDeleteContactSetting(NULL, TTB_OPTDIR, "SelBkColour");
- else
- DBWriteContactSettingDword(NULL, TTB_OPTDIR, "SelBkColour", col);
-
- TCHAR str[MAX_PATH];
- GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- DBWriteContactSettingTString(NULL, TTB_OPTDIR, "BkBitmap", str);
-
- WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH)) flags |= CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV)) flags |= CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg, IDC_TILEH)) flags |= CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg, IDC_TILEV)) flags |= CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL)) flags |= CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
- DBWriteContactSettingWord(NULL, TTB_OPTDIR, "BkBmpUse", flags);
- }
-
- ttbOptionsChanged();
- return TRUE;
- }
- break;
- }
- break;
- }
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
int TTBOptInit(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
- odp.pszGroup = LPGEN("TopToolBar");
-
- if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TTBBKG);
- odp.pszTitle = LPGEN("Background");
- odp.pfnDlgProc = DlgProcTTBBkgOpts;
- odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wParam, &odp);
- }
+ odp.pszGroup = LPGEN("Contact List");
odp.position = -1000000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER);
- odp.pszTitle = LPGEN("Buttons");
+ odp.pszTitle = LPGEN("Toolbar");
odp.pfnDlgProc = ButOrderOpts;
odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY;
Options_AddPage(wParam, &odp);