summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-03 17:52:16 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-03 17:52:16 +0300
commiteac7c468a6ef15d13477e6e5821bc53c2f9be845 (patch)
tree80a355822ad592a571c92cab270752d36097a711
parentc84d7f73fe819e830d90c59c06c7ba82265982ed (diff)
fixes #3768 (NewStory: добавить опцию сдвига выделения при прокрутке стрелками)
-rw-r--r--plugins/NewStory/res/resource.rc43
-rw-r--r--plugins/NewStory/src/history_control.cpp18
-rw-r--r--plugins/NewStory/src/main.cpp2
-rw-r--r--plugins/NewStory/src/options.cpp6
-rw-r--r--plugins/NewStory/src/resource.h2
-rw-r--r--plugins/NewStory/src/stdafx.h4
6 files changed, 48 insertions, 27 deletions
diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc
index c330de5a5c..9e0f885c67 100644
--- a/plugins/NewStory/res/resource.rc
+++ b/plugins/NewStory/res/resource.rc
@@ -26,6 +26,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
+IDI_BOOKMARK ICON "star.ico"
+
IDI_NEWSTORY ICON "newstory.ico"
IDI_USERINFO ICON "userinfo.ico"
@@ -66,10 +68,9 @@ IDI_TPLGROUP ICON "folder.ico"
IDI_TIMETREE ICON "timetree.ico"
-IDI_BOOKMARK ICON "star.ico"
-
IDI_OK ICON "ok.ico"
+
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
@@ -79,23 +80,23 @@ IDD_HISTORY DIALOGEX 0, 0, 380, 319
STYLE DS_SETFONT | DS_NOIDLEMSG | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_USERINFO,"MButtonClass",NOT WS_TABSTOP,0,99,16,14
- CONTROL "",IDC_USERMENU,"MButtonClass",NOT WS_TABSTOP,21,99,16,14
- CONTROL "",IDC_MESSAGE,"MButtonClass",NOT WS_TABSTOP,37,99,16,14
- CONTROL "",IDC_SEARCH,"MButtonClass",NOT WS_TABSTOP,53,99,16,14
- CONTROL "",IDC_COPY,"MButtonClass",NOT WS_TABSTOP,74,99,16,14
- CONTROL "",IDC_EXPORT,"MButtonClass",NOT WS_TABSTOP,90,99,16,14
- CONTROL "",IDC_DELETE,"MButtonClass",NOT WS_TABSTOP,104,99,16,14
- CONTROL "",IDC_TIMETREE,"MButtonClass",NOT WS_TABSTOP,118,99,16,14
- CONTROL "",IDC_FILTER,"MButtonClass",NOT WS_TABSTOP,132,99,16,14
- CONTROL "",IDC_FINDPREV,"MButtonClass",NOT WS_TABSTOP,364,305,16,14
- CONTROL "",IDOK,"MButtonClass",NOT WS_TABSTOP,337,305,16,14
+ CONTROL "",IDC_USERINFO,"MButtonClass",0x0,0,99,16,14
+ CONTROL "",IDC_USERMENU,"MButtonClass",0x0,21,99,16,14
+ CONTROL "",IDC_MESSAGE,"MButtonClass",0x0,37,99,16,14
+ CONTROL "",IDC_SEARCH,"MButtonClass",0x0,53,99,16,14
+ CONTROL "",IDC_COPY,"MButtonClass",0x0,74,99,16,14
+ CONTROL "",IDC_EXPORT,"MButtonClass",0x0,90,99,16,14
+ CONTROL "",IDC_DELETE,"MButtonClass",0x0,104,99,16,14
+ CONTROL "",IDC_TIMETREE,"MButtonClass",0x0,118,99,16,14
+ CONTROL "",IDC_FILTER,"MButtonClass",0x0,132,99,16,14
+ CONTROL "",IDC_FINDPREV,"MButtonClass",0x0,364,305,16,14
+ CONTROL "",IDOK,"MButtonClass",0x0,337,305,16,14
EDITTEXT IDC_SEARCHTEXT,19,305,305,14,ES_AUTOHSCROLL
ICON "",IDC_SEARCHICON,1,298,20,20,SS_CENTERIMAGE
- CONTROL "",IDC_LOGOPTIONS,"MButtonClass",NOT WS_TABSTOP,116,99,16,14
+ CONTROL "",IDC_LOGOPTIONS,"MButtonClass",0x0,116,99,16,14
CONTROL "",IDC_TIMETREEVIEW,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_SINGLEEXPAND | NOT WS_VISIBLE | WS_TABSTOP,0,134,84,160,WS_EX_STATICEDGE
CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,132,251,6
- CONTROL "",IDC_DATEPOPUP,"MButtonClass",NOT WS_TABSTOP,148,99,16,14
+ CONTROL "",IDC_DATEPOPUP,"MButtonClass",0x0,148,99,16,14
CONTROL "",IDC_HISTORYCONTROL,"NewstoryList",WS_TABSTOP,90,132,290,166
CONTROL "",IDC_IB_SEPARATOR,"Static",SS_ETCHEDHORZ,21,76,124,1
ICON "",IDC_ICO_MESSAGES,4,7,20,20
@@ -140,11 +141,12 @@ IDD_OPT_ADVANCED DIALOGEX 0, 0, 307, 223
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Group messages",IDC_GROUPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,9,289,14
- GROUPBOX "Log window",IDC_STATIC,0,0,307,65
- CONTROL "Enable vertical scroll bar",IDC_VSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,22,289,14
- CONTROL "Draw window edge",IDC_DRAWEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,35,289,14
- CONTROL "Ascending events sort order",IDC_SORT_ASCENDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,289,14
+ GROUPBOX "Log window",IDC_STATIC,0,0,307,80
+ CONTROL "Group messages",IDC_GROUPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,9,289,12
+ CONTROL "Enable vertical scroll bar",IDC_VSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,22,289,12
+ CONTROL "Draw window edge",IDC_DRAWEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,35,289,12
+ CONTROL "Ascending events sort order",IDC_SORT_ASCENDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,48,289,12
+ CONTROL "History++ compatiblity mode",IDC_HPP_COMPAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,61,289,12
END
IDD_OPT_TEMPLATES DIALOGEX 0, 0, 307, 223
@@ -243,6 +245,7 @@ BEGIN
END
END
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 30c674c451..f09d215156 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -1042,25 +1042,35 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
switch (wParam) {
case VK_UP:
- data->EventUp();
+ if (g_plugin.bHppCompat)
+ data->EventUp();
+ else
+ data->LineUp();
break;
case VK_DOWN:
- data->EventDown();
+ if (g_plugin.bHppCompat)
+ data->EventDown();
+ else
+ data->LineDown();
break;
case VK_PRIOR:
if (isCtrl)
data->ScrollTop();
- else
+ else if (g_plugin.bHppCompat)
data->EventPageUp();
+ else
+ data->PageUp();
break;
case VK_NEXT:
if (isCtrl)
data->ScrollBottom();
- else
+ else if (g_plugin.bHppCompat)
data->EventPageDown();
+ else
+ data->PageDown();
break;
case VK_HOME:
diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp
index 75450a1c79..d744d8435e 100644
--- a/plugins/NewStory/src/main.cpp
+++ b/plugins/NewStory/src/main.cpp
@@ -22,6 +22,7 @@ CMPlugin g_plugin;
CMOption<bool> g_bOptGrouping(MODULENAME, "MessageGrouping", false);
CMOption<bool> g_bOptDrawEdge(MODULENAME, "DrawEdge", true);
+CMOption<bool> g_bOptHppCompat(MODULENAME, "HppCompat", false);
MWindowList g_hNewstoryWindows = 0, g_hNewstoryLogs = 0;
@@ -147,6 +148,7 @@ int CMPlugin::Load()
bDrawEdge = g_bOptDrawEdge;
bMsgGrouping = g_bOptGrouping;
+ bHppCompat = g_bOptHppCompat;
m_log = RegisterSrmmLog(this, MODULETITLE, _T(MODULENAME), NewStory_Stub);
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp
index 98cb365020..c32148f6a1 100644
--- a/plugins/NewStory/src/options.cpp
+++ b/plugins/NewStory/src/options.cpp
@@ -41,7 +41,7 @@ protected:
class CGeneralOptsDlg : public CBaseOptsDlg
{
- CCtrlCheck chkGrouping, chkVScroll, chkDrawEdge, chkSortOrder;
+ CCtrlCheck chkGrouping, chkVScroll, chkDrawEdge, chkSortOrder, chkHppCompat;
public:
CGeneralOptsDlg() :
@@ -49,11 +49,14 @@ public:
chkVScroll(this, IDC_VSCROLL),
chkDrawEdge(this, IDC_DRAWEDGE),
chkGrouping(this, IDC_GROUPING),
+ chkHppCompat(this, IDC_HPP_COMPAT),
chkSortOrder(this, IDC_SORT_ASCENDING)
{
CreateLink(chkVScroll, g_plugin.bOptVScroll);
CreateLink(chkGrouping, g_bOptGrouping);
CreateLink(chkDrawEdge, g_bOptDrawEdge);
+ CreateLink(chkHppCompat, g_bOptHppCompat);
+
CreateLink(chkSortOrder, g_plugin.bSortAscending);
}
@@ -61,6 +64,7 @@ public:
{
g_plugin.bDrawEdge = g_bOptDrawEdge;
g_plugin.bMsgGrouping = g_bOptGrouping;
+ g_plugin.bHppCompat = g_bOptHppCompat;
return true;
}
};
diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h
index 63edcc0340..5c821737b2 100644
--- a/plugins/NewStory/src/resource.h
+++ b/plugins/NewStory/src/resource.h
@@ -87,6 +87,8 @@
#define IDC_VSCROLL 1056
#define IDC_DRAWEDGE 1057
#define IDC_SORT_ASCENDING 1058
+#define IDC_HPP_COMPAT 1059
+#define IDC_SORT_ASCENDING2 1059
#define ID_FILTER_SHOWALLEVENTS 40001
#define ID_FILTER_SHOWINCOMINGEVENTSONLY 40002
#define ID_FILTER_SHOWOUTGOINGEVENTSONLY 40003
diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h
index fc0c78dd22..788d00b3f3 100644
--- a/plugins/NewStory/src/stdafx.h
+++ b/plugins/NewStory/src/stdafx.h
@@ -96,7 +96,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
HBRUSH hBackBrush;
CMOption<bool> bOptVScroll, bSortAscending;
- bool bMsgGrouping, bDrawEdge; // thesw options are a copy of static CMOption to keep performance high
+ bool bMsgGrouping, bDrawEdge, bHppCompat; // thesw options are a copy of static CMOption to keep performance high
CMPlugin();
@@ -104,5 +104,5 @@ struct CMPlugin : public PLUGIN<CMPlugin>
int Unload() override;
};
-extern CMOption<bool> g_bOptGrouping, g_bOptDrawEdge;
+extern CMOption<bool> g_bOptGrouping, g_bOptDrawEdge, g_bOptHppCompat;
extern wchar_t* months[12];