summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP/src/watchedvars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-21 12:01:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-21 12:01:49 +0000
commite865872b4ef16b6e40cfe868843f1070fa3a239b (patch)
tree0710f76e005c25ce151c46015c0853af6101d2cc /plugins/DbEditorPP/src/watchedvars.cpp
parent87cf54594168e5579bbb852bcb4aaae3fefa3b89 (diff)
- resizer moved to mir_core, because it uses hard-coded windows structures;
- MS_UTILS_RESIZEDIALOG replaced with a short call of Utils_ResizeDialog; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14295 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP/src/watchedvars.cpp')
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp72
1 files changed, 29 insertions, 43 deletions
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index a43c1e46c3..0fa41b0532 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -238,18 +238,16 @@ LRESULT CALLBACK WatchSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
- {
- hwnd2watchedVarsWindow = hwnd;
+ hwnd2watchedVarsWindow = hwnd;
// do the icon
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT)));
TranslateMenu(GetMenu(hwnd));
TranslateMenu(GetSubMenu(GetMenu(hwnd), 0));
TranslateDialogDefault(hwnd);
-
- SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_APPWINDOW); // taskbar icon
+
+ SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_APPWINDOW); // taskbar icon
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_VARS), 32 | LVS_EX_LABELTIP); // LVS_EX_GRIDLINES
@@ -259,33 +257,23 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
mir_subclassWindow(GetDlgItem(hwnd, IDC_VARS), WatchSubclassProc);
PopulateWatchedWindow();
- }
- return TRUE;
+ return TRUE;
+
// for the resize
case WM_GETMINMAXINFO:
- {
- MINMAXINFO *mmi = (MINMAXINFO*)lParam;
- mmi->ptMinTrackSize.x = 500;
- mmi->ptMinTrackSize.y = 300;
+ {
+ MINMAXINFO *mmi = (MINMAXINFO*)lParam;
+ mmi->ptMinTrackSize.x = 500;
+ mmi->ptMinTrackSize.y = 300;
+ }
return 0;
- }
+
case WM_SIZE:
- {
- UTILRESIZEDIALOG urd;
- memset(&urd, 0, sizeof(urd));
- urd.cbSize = sizeof(urd);
- urd.hInstance = hInst;
- urd.hwndDlg = hwnd;
- urd.lParam = 0;
- urd.lpTemplate = MAKEINTRESOURCEA(IDD_WATCH_DIAG);
- urd.pfnResizer = WatchDialogResize;
- CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
+ Utils_ResizeDialog(hwnd, hInst, MAKEINTRESOURCEA(IDD_WATCH_DIAG), WatchDialogResize);
break;
- }
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case MENU_REMALL_WATCHES:
freeAllWatches();
break;
@@ -300,14 +288,13 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_NOTIFY:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_VARS:
switch (((NMHDR*)lParam)->code) {
case NM_DBLCLK:
+ LVHITTESTINFO hti;
+ LVITEM lvi;
{
- LVHITTESTINFO hti;
- LVITEM lvi;
HWND hwndVars = GetDlgItem(hwnd, IDC_VARS);
hti.pt = ((NMLISTVIEW*)lParam)->ptAction;
if (ListView_SubItemHitTest(hwndVars, &hti) > -1)
@@ -330,21 +317,21 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
}
break;
+
case LVN_COLUMNCLICK:
- {
- LPNMLISTVIEW lv = (LPNMLISTVIEW)lParam;
- ColumnsSortParams params;
- params.hList = GetDlgItem(hwnd, IDC_VARS);
- params.column = lv->iSubItem;
- params.last = lastColumn;
- ListView_SortItemsEx(params.hList, ColumnsCompare, (LPARAM)&params);
- lastColumn = (params.column == lastColumn) ? -1 : params.column;
- break;
- }
+ LPNMLISTVIEW lv = (LPNMLISTVIEW)lParam;
+ ColumnsSortParams params;
+ params.hList = GetDlgItem(hwnd, IDC_VARS);
+ params.column = lv->iSubItem;
+ params.last = lastColumn;
+ ListView_SortItemsEx(params.hList, ColumnsCompare, (LPARAM)&params);
+ lastColumn = (params.column == lastColumn) ? -1 : params.column;
+ break;
}
break;
}
break;
+
case WM_DESTROY:
ListView_DeleteAllItems(GetDlgItem(hwnd, IDC_VARS));
saveListSettings(GetDlgItem(hwnd, IDC_VARS), csWatchList);
@@ -355,9 +342,8 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
-
-void openWatchedVarWindow() {
-
+void openWatchedVarWindow()
+{
if (!hwnd2watchedVarsWindow)
CreateDialog(hInst, MAKEINTRESOURCE(IDD_WATCH_DIAG), NULL, WatchDlgProc);
else