diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-02-21 05:08:00 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-02-21 05:08:00 +0000 |
commit | 11ded3a2ad74ab15a67aaf46b1c7ee452a5757ed (patch) | |
tree | 60f043c0fe7535a5885347250f15eeae08b197fa /src/modules | |
parent | 509f52fe07c0b035dfeea810b99edf92a9781380 (diff) |
small cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@3655 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/options/filter.cpp | 28 | ||||
-rw-r--r-- | src/modules/options/headerbar.cpp | 11 | ||||
-rw-r--r-- | src/modules/options/iconheader.cpp | 4 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 19 |
4 files changed, 38 insertions, 24 deletions
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index 5b9d53a707..f52598d17b 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -53,13 +53,13 @@ void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root) {
if (root) {
TCHAR title[2048] = {0};
-
+
TVITEM item = {0};
item.mask = TVIF_TEXT;
item.hItem = root;
item.pszText = title;
item.cchTextMax = SIZEOF(title);
-
+
if (TreeView_GetItem(hWndDlg, &item))
if (_tcslen(title) > 0)
AddFilterString(key, title);
@@ -69,7 +69,7 @@ void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root) child = TreeView_GetNextItem(hWndDlg, child, TVGN_CHILD);
AddTreeViewNodes(hWndDlg, key, child);
}
-
+
AddTreeViewNodes(hWndDlg, key, TreeView_GetNextSibling(hWndDlg, root));
}
}
@@ -80,10 +80,10 @@ void AddDialogString(HWND hWndDlg, const PageHash key) GetWindowText(hWndDlg, title, SIZEOF(title));
if (_tcslen(title) > 0)
AddFilterString(key, title);
-
+
TCHAR szClass[64];
GetClassName(hWndDlg, szClass, SIZEOF(szClass));
-
+
if (lstrcmpi(szClass, _T("SysTreeView32")) == 0) {
HTREEITEM hItem = TreeView_GetRoot(hWndDlg);
AddTreeViewNodes(hWndDlg, key, hItem);
@@ -100,7 +100,9 @@ void AddDialogString(HWND hWndDlg, const PageHash key) title[SIZEOF(title) - 1] = 0;
if (_tcslen(title) > 0)
AddFilterString(key, title);
- } } }
+ }
+ }
+ }
return;
}
@@ -109,7 +111,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) 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);
}
@@ -124,15 +126,19 @@ void AddDialogString(HWND hWndDlg, const PageHash key) int res = ComboBox_GetLBText(hWndDlg, i, title);
if (res != CB_ERR) {
title[SIZEOF(title) - 1] = 0;
-
+
if (_tcslen(title) > 0)
AddFilterString(key, title);
-} } } } }
+ }
+ }
+ }
+ }
+}
static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam)
{
AddDialogString(hWnd, lParam);
-
+
return TRUE;
}
@@ -146,7 +152,7 @@ void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *plu if ((enableKeywordFiltering) && (hWnd != 0)) {
AddDialogString(hWnd, key);
-
+
EnumChildWindows(hWnd, GetDialogStringsCallback, (LPARAM) key);
}
}
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp index a94c196567..8b124cd14b 100644 --- a/src/modules/options/headerbar.cpp +++ b/src/modules/options/headerbar.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
-
static BOOL IsAeroMode()
{
BOOL result;
@@ -55,7 +54,7 @@ struct MHeaderbarCtrl : public MZeroedObject // UI info
RECT rc;
int width, height;
- HICON hIcon;
+ HICON hIcon;
// control colors
RGBQUAD rgbBkgTop, rgbBkgBottom;
@@ -195,7 +194,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, if (mit->hIcon)
DrawIcon(tempDC, 10, iTopSpace, mit->hIcon);
- else {
+ else {
HICON hIcon = (HICON)SendMessage(GetParent(hwndDlg), WM_GETICON, ICON_BIG, 0);
if (hIcon == NULL)
hIcon = (HICON)SendMessage(GetParent(hwndDlg), WM_GETICON, ICON_SMALL, 0);
@@ -241,7 +240,8 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, textRect.left = 66;
SelectObject(tempDC, hFont);
DrawText(tempDC, szSubTitle, -1, &textRect, DT_BOTTOM|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX|DT_NOCLIP|DT_END_ELLIPSIS);
- } }
+ }
+ }
DeleteObject(hFntBold);
@@ -295,7 +295,8 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(hwndDlg, 0, (LONG_PTR)itc);
MHeaderbar_SetupColors(itc);
- { HWND hParent = GetParent(hwndDlg);
+ {
+ HWND hParent = GetParent(hwndDlg);
RECT rcWnd; GetWindowRect(hwndDlg, &rcWnd);
itc->controlsToRedraw = 0;
itc->nControlsToRedraw = 0;
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index 6b51a0afe9..cf90cf8b25 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h"
#include "m_iconheader.h"
-
extern HINSTANCE hInst;
static BOOL IsAeroMode()
@@ -292,7 +291,8 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM MIcoTab_FillRect(tempDC, 0, mit->height-2, mit->width, 1, GetSysColor(COLOR_BTNSHADOW));
MIcoTab_FillRect(tempDC, 0, mit->height-1, mit->width, 1, GetSysColor(COLOR_BTNHIGHLIGHT));
- } }
+ }
+ }
//Draw Items
HFONT hFont = mit->hFont;
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 285c38dc4e..9d1bed50dc 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -169,7 +169,8 @@ static void SaveOptionsTreeState(HWND hdlg) db_set_b(NULL, "Options", buf, (BYTE)((tvi.state&TVIS_EXPANDED)?1:0));
}
tvi.hItem = TreeView_GetNextSibling( GetDlgItem(hdlg, IDC_PAGETREE), tvi.hItem);
-} }
+ }
+}
#define DM_FOCUSPAGE (WM_USER+10)
#define DM_REBUILDPAGETREE (WM_USER+11)
@@ -229,7 +230,8 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd {
hWnd = CreateDialogIndirectParamA(page->hInst, page->pTemplate, hWndParent, page->dlgProc, page->dwInitParam); //create the options dialog page so we can parse it
ShowWindow(hWnd, SW_HIDE); //make sure it's hidden
- } }
+ }
+ }
DWORD key = GetPluginPageHash(page); //get the plugin page hash
@@ -786,7 +788,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (pos) pos++;
else pos = szFileName;
_tcsncpy(dat->szFilterString, pos, SIZEOF(dat->szFilterString));
- } }
+ }
+ }
_tcslwr_locale(dat->szFilterString); //all strings are stored as lowercase ... make sure filter string is lowercase too
@@ -853,7 +856,9 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L tvi.lParam = i;
TreeView_SetItem(hwndTree, &tvi);
continue;
- } } }
+ }
+ }
+ }
if (ptszTab != NULL) {
HTREEITEM hItem;
@@ -1163,7 +1168,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (opd)
ShowWindow(opd->hwnd, SW_SHOW);
return 0;
- } }
+ }
+ }
if (LOWORD(wParam) == IDOK)
DestroyWindow(hdlg);
@@ -1290,7 +1296,8 @@ static void OpenOptionsNow(int hLangpack, const char *pszGroup, const char *pszP NULL, OptionsDlgProc, (LPARAM)&psh);
FreeOptionsData(&opi);
-} }
+ }
+}
static INT_PTR OpenOptions(WPARAM wParam, LPARAM lParam)
{
|