diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-17 19:53:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-17 19:53:11 +0000 |
commit | b1d1c1adee5a98a6f048b44fb61105d17f8de7e8 (patch) | |
tree | 40b66695522ede885fb3fba8fc5369cb55956b23 /src/modules/options | |
parent | 9a7fd4befd52e57a8ccd624cf7628b532bcd699a (diff) |
fix for core visibility icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@2341 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/options')
-rw-r--r-- | src/modules/options/filter.cpp | 71 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 66 |
2 files changed, 73 insertions, 64 deletions
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index f931012ad5..13799b602f 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -89,43 +89,47 @@ void AddDialogString(HWND hWndDlg, const PageHash key) if (lstrcmpi(szClass, _T("SysTreeView32")) == 0) {
HTREEITEM hItem = TreeView_GetRoot(hWndDlg);
AddTreeViewNodes(hWndDlg, key, hItem);
+ return;
}
- else {
- if (lstrcmpi(szClass, _T("listbox")) == 0) {
- if (GetWindowStyle(hWndDlg) & LBS_HASSTRINGS) {
- int count = ListBox_GetCount(hWndDlg);
- for (int i=0; i < count; i++) {
- title[0] = 0; //safety
- int res = ListBox_GetText(hWndDlg, i, title);
- if (res != LB_ERR) {
- title[SIZEOF(title) - 1] = 0;
- if (_tcslen(title) > 0)
- AddFilterString(key, title);
- } } }
- }
- else {
- if (lstrcmpi(szClass, _T("SysListView32")) == 0) {
- int count = ListView_GetItemCount(hWndDlg);
- for (int i=0; i < count; i++) {
- title[0] = 0; //safety
- ListView_GetItemText(hWndDlg, i, 0, title, SIZEOF(title));
-
+
+ if (lstrcmpi(szClass, _T("listbox")) == 0) {
+ if (GetWindowStyle(hWndDlg) & LBS_HASSTRINGS) {
+ int count = ListBox_GetCount(hWndDlg);
+ for (int i=0; i < count; i++) {
+ title[0] = 0; //safety
+ int res = ListBox_GetText(hWndDlg, i, title);
+ if (res != LB_ERR) {
+ title[SIZEOF(title) - 1] = 0;
if (_tcslen(title) > 0)
AddFilterString(key, title);
- } }
-
- if (lstrcmpi(szClass, _T("combobox")) == 0) {
- if (GetWindowStyle(hWndDlg) & CBS_HASSTRINGS) {
- int count = ComboBox_GetCount(hWndDlg);
- for (int i=0; i < count; i++) {
- title[0] = 0; //safety
- int res = ComboBox_GetLBText(hWndDlg, i, title);
- if (res != CB_ERR) {
- title[SIZEOF(title) - 1] = 0;
+ } } }
+ return;
+ }
+
+ if (lstrcmpi(szClass, _T("SysListView32")) == 0) {
+ int count = ListView_GetItemCount(hWndDlg);
+ for (int i=0; i < count; i++) {
+ title[0] = 0; //safety
+ ListView_GetItemText(hWndDlg, i, 0, title, SIZEOF(title));
+
+ if (_tcslen(title) > 0)
+ AddFilterString(key, title);
+ }
+ return;
+ }
+
+ if (lstrcmpi(szClass, _T("combobox")) == 0) {
+ if (GetWindowStyle(hWndDlg) & CBS_HASSTRINGS) {
+ int count = ComboBox_GetCount(hWndDlg);
+ for (int i=0; i < count; i++) {
+ title[0] = 0; //safety
+ int res = ComboBox_GetLBText(hWndDlg, i, title);
+ if (res != CB_ERR) {
+ title[SIZEOF(title) - 1] = 0;
- if (_tcslen(title) > 0)
- AddFilterString(key, title);
-} } } } } } }
+ if (_tcslen(title) > 0)
+ AddFilterString(key, title);
+} } } } }
static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam)
{
@@ -178,7 +182,6 @@ static INT_PTR CALLBACK DlgProcOptSearch(HWND hWnd, UINT msg, WPARAM wParam, LPA DBWriteContactSettingWord(NULL, "Options", "EnableKeywordFiltering", IsDlgButtonChecked(hWnd, IDC_ENABLE_KEYWORDFILTERING));
break;
}
- break;
}
break;
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 56f15f7c86..64879ee5c8 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -427,33 +427,32 @@ static void AeroPaintControl(HWND hwnd, HDC hdc, WNDPROC OldWndProc, UINT msg = static LRESULT CALLBACK AeroPaintSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WNDPROC OldWndProc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- switch (msg)
- {
- case WM_CTLCOLOREDIT:
- if ( !GetPropA((HWND)lParam, "Miranda.AeroRender.Active"))
- RedrawWindow((HWND)lParam, NULL, NULL, RDW_INVALIDATE);
- break;
+ switch (msg) {
+ case WM_CTLCOLOREDIT:
+ if ( !GetPropA((HWND)lParam, "Miranda.AeroRender.Active"))
+ RedrawWindow((HWND)lParam, NULL, NULL, RDW_INVALIDATE);
+ break;
- case WM_ERASEBKGND:
- return TRUE;
+ case WM_ERASEBKGND:
+ return TRUE;
- case WM_PRINT:
- case WM_PRINTCLIENT:
- AeroPaintControl(hwnd, (HDC)wParam, OldWndProc, msg, lParam);
- return TRUE;
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ AeroPaintControl(hwnd, (HDC)wParam, OldWndProc, msg, lParam);
+ return TRUE;
- case WM_PAINT:
+ case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
AeroPaintControl(hwnd, hdc, OldWndProc);
EndPaint(hwnd, &ps);
- return TRUE;
}
+ return TRUE;
- case WM_DESTROY:
- RemovePropA(hwnd, "Miranda.AeroRender.Active");
- break;
+ case WM_DESTROY:
+ RemovePropA(hwnd, "Miranda.AeroRender.Active");
+ break;
}
return CallWindowProc(OldWndProc, hwnd, msg, wParam, lParam);
}
@@ -493,31 +492,36 @@ static void ExecuteFindFilterStringsTimer(HWND hdlg) static void FillFilterCombo(int enableKeywordFiltering, HWND hDlg, OptionsDlgData* dat)
{
- HINSTANCE* KnownInstances = (HINSTANCE*)alloca(sizeof(HINSTANCE)*dat->arOpd.getCount());
+ HINSTANCE *KnownInstances = (HINSTANCE*)alloca(sizeof(HINSTANCE)*dat->arOpd.getCount());
int countKnownInst = 0;
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_RESETCONTENT, 0, 0);
int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_ADDSTRING, 0, (LPARAM)TranslateTS(ALL_MODULES_FILTER));
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_SETITEMDATA, (WPARAM)index, 0);
index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_ADDSTRING, 0, (LPARAM)TranslateTS(CORE_MODULES_FILTER));
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_SETITEMDATA, (WPARAM)index, (LPARAM)hInst);
- TCHAR* tszModuleName = (TCHAR*)alloca(MAX_PATH*sizeof(TCHAR));
+ TCHAR *tszModuleName = (TCHAR*)alloca(MAX_PATH*sizeof(TCHAR));
for (int i=0; i < dat->arOpd.getCount(); i++) {
- TCHAR *dllName = NULL;
- int j;
- HINSTANCE inst = dat->arOpd[i]->hInst;
-
if ( !enableKeywordFiltering)
FindFilterStrings(enableKeywordFiltering, FALSE, hDlg, dat->arOpd[i]); // only modules name (fast enougth)
- if (inst == hInst) continue;
+ HINSTANCE inst = dat->arOpd[i]->hInst;
+ if (inst == hInst)
+ continue;
+
+ int j;
for (j = 0; j<countKnownInst; j++)
- if (KnownInstances[j] == inst) break;
- if (j != countKnownInst) continue;
+ if (KnownInstances[j] == inst)
+ break;
+ if (j != countKnownInst)
+ continue;
+
KnownInstances[countKnownInst] = inst;
countKnownInst++;
GetModuleFileName(inst, tszModuleName, MAX_PATH);
+
+ TCHAR *dllName = NULL;
{
- char * name = GetPluginNameByInstance(inst);
+ char *name = GetPluginNameByInstance(inst);
if (name)
dllName = mir_a2t(name);
}
@@ -539,7 +543,7 @@ static void FillFilterCombo(int enableKeywordFiltering, HWND hDlg, OptionsDlgDat static BOOL IsInsideTab(HWND hdlg, OptionsDlgData * dat, int i)
{
- OptionsPageData* opd = dat->arOpd[i];
+ OptionsPageData *opd = dat->arOpd[i];
int pages = 0;
if (opd->ptszTab != NULL) {
// Count tabs to calc position
@@ -557,10 +561,12 @@ static BOOL IsInsideTab(HWND hdlg, OptionsDlgData * dat, int i) static bool LoadOptionsPage(OPTIONSDIALOGPAGE *src, OptionsPageData *dst)
{
HRSRC hrsrc = FindResourceA(src->hInstance, src->pszTemplate, MAKEINTRESOURCEA(5));
- if (hrsrc == NULL) return false;
+ if (hrsrc == NULL)
+ return false;
HGLOBAL hglb = LoadResource(src->hInstance, hrsrc);
- if (hglb == NULL) return false;
+ if (hglb == NULL)
+ return false;
DWORD resSize = SizeofResource(src->hInstance, hrsrc);
dst->pTemplate = (DLGTEMPLATE*)mir_alloc(resSize);
|