mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ upd: current (2020-07-21) grepWin dev
+ chg: grepWinNP3 About dialog (place for wrapped text)
This commit is contained in:
parent
1874e96cfc
commit
efa159e1cf
@ -1,4 +1,4 @@
|
||||
// sktoolslib - common files for SK tools
|
||||
// sktoolslib - common files for SK tools
|
||||
|
||||
// Copyright (C) 2018, 2020 - Stefan Kueng
|
||||
|
||||
@ -48,10 +48,10 @@ public:
|
||||
return m_dpi;
|
||||
}
|
||||
// Convert between raw pixels and relative pixels.
|
||||
int Scale(HWND hWnd, int x) { return MulDiv(x, GetDPI(hWnd), 96); }
|
||||
float ScaleFactor(HWND hWnd) { return GetDPI(hWnd) / 96.0f; }
|
||||
int Scale(HWND hWnd, int x) { return MulDiv(x, GetDPI(hWnd), USER_DEFAULT_SCREEN_DPI); }
|
||||
float ScaleFactor(HWND hWnd) { return (float)GetDPI(hWnd) / (float)USER_DEFAULT_SCREEN_DPI; }
|
||||
float ScaleFactorSystemToWindow(HWND hWnd) { return (float)GetDPI(hWnd) / (float)m_dpi; }
|
||||
int Unscale(HWND hWnd, int x) { return MulDiv(x, 96, GetDPI(hWnd)); }
|
||||
int Unscale(HWND hWnd, int x) { return MulDiv(x, USER_DEFAULT_SCREEN_DPI, GetDPI(hWnd)); }
|
||||
|
||||
// Determine the screen dimensions in relative pixels.
|
||||
int ScaledScreenWidth() { return _ScaledSystemMetric(SM_CXSCREEN); }
|
||||
|
||||
@ -21,8 +21,11 @@
|
||||
#include "AboutDlg.h"
|
||||
#include "version.h"
|
||||
#include "Theme.h"
|
||||
#include "DPIAware.h"
|
||||
#include <string>
|
||||
|
||||
extern HICON g_hDlgIcon128;
|
||||
|
||||
CAboutDlg::CAboutDlg(HWND hParent)
|
||||
: m_hParent(hParent)
|
||||
, m_themeCallbackId(0)
|
||||
@ -33,6 +36,29 @@ CAboutDlg::~CAboutDlg(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static LRESULT DrawGrepWinIcon(HWND hWnd)
|
||||
{
|
||||
if (g_hDlgIcon128)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC const hDC = GetWindowDC(hWnd);
|
||||
if (hDC)
|
||||
{
|
||||
BeginPaint(hWnd, &ps);
|
||||
int const dpiSized = CDPIAware::Instance().Scale(hWnd, 64);
|
||||
int const dpiLeft = CDPIAware::Instance().Scale(hWnd, 22);
|
||||
int const dpiTop = CDPIAware::Instance().Scale(hWnd, 44);
|
||||
HBRUSH const hBrush = (HBRUSH)GetSysColorBrush(COLOR_3DFACE);
|
||||
DrawIconEx(hDC, dpiLeft, dpiTop, g_hDlgIcon128, dpiSized, dpiSized, 0, hBrush, DI_NORMAL);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
@ -54,6 +80,7 @@ LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||
SetDlgItemText(*this, IDC_DATE, TEXT(GREPWIN_VERDATE));
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
return DoCommand(LOWORD(wParam), HIWORD(wParam));
|
||||
case WM_CLOSE:
|
||||
@ -61,6 +88,10 @@ LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
case WM_PAINT:
|
||||
return DrawGrepWinIcon(*this);
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -32,6 +32,16 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
// remains consistent on all systems.
|
||||
IDI_GREPWIN ICON "grepWinNP3.ico"
|
||||
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -146,17 +156,17 @@ BEGIN
|
||||
LTEXT "Double-Click to select a preset",IDC_INFOLABEL,7,7,226,8
|
||||
END
|
||||
|
||||
IDD_ABOUT DIALOGEX 0, 0, 263, 86
|
||||
IDD_ABOUT DIALOGEX 0, 0, 263, 98
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About grepWinNP3"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,206,65,50,14
|
||||
ICON IDI_GREPWIN,IDC_STATIC,17,18,20,20,SS_CENTERIMAGE
|
||||
DEFPUSHBUTTON "OK",IDOK,206,73,50,14
|
||||
//~ICON IDI_GREPWIN,IDC_STATIC,7,7,24,24,SS_CENTERIMAGE
|
||||
LTEXT "",IDC_VERSIONINFO,50,18,206,8
|
||||
LTEXT "",IDC_DATE,50,30,206,8
|
||||
LTEXT "Visit Stefan K\xFCng's website",IDC_WEBLINK,50,65,150,8
|
||||
CTEXT "Notepad3's grepWin(NP3)-mod of Stefan K\xFCng's great tool!",IDC_NP3_DISCLAIMER,7,47,249,8
|
||||
LTEXT "Visit Stefan K\xFCng's website",IDC_WEBLINK,50,73,150,8
|
||||
CTEXT "Notepad3's grepWin(NP3)-mod of \nStefan K\xFCng's great tool!",IDC_NP3_DISCLAIMER,7,47,249,18
|
||||
END
|
||||
|
||||
IDD_MULTILINEEDIT DIALOGEX 0, 0, 317, 135
|
||||
@ -259,7 +269,7 @@ BEGIN
|
||||
RIGHTMARGIN, 256
|
||||
VERTGUIDE, 50
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 79
|
||||
BOTTOMMARGIN, 91
|
||||
END
|
||||
|
||||
IDD_MULTILINEEDIT, DIALOG
|
||||
@ -317,36 +327,6 @@ END
|
||||
IDR_INFODLG HTML "infodlg.htm"
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"..\\resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#ifndef APSTUDIO_INVOKED\r\n"
|
||||
"#include ""grepWin.rc2""\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
@ -443,6 +423,45 @@ END
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"..\\resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#ifndef APSTUDIO_INVOKED\r\n"
|
||||
"#include ""grepWin.rc2""\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -259,14 +259,17 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
else
|
||||
m_searchpath = std::wstring(m_regSearchPath);
|
||||
}
|
||||
// expand a possible 'short' path
|
||||
DWORD ret = 0;
|
||||
ret = ::GetLongPathName(m_searchpath.c_str(), nullptr, 0);
|
||||
if (ret)
|
||||
else
|
||||
{
|
||||
std::unique_ptr<TCHAR[]> pathbuf(new TCHAR[ret+2]);
|
||||
ret = ::GetLongPathName(m_searchpath.c_str(), pathbuf.get(), ret+1);
|
||||
m_searchpath = std::wstring(pathbuf.get(), ret);
|
||||
// expand a possible 'short' path
|
||||
DWORD ret = 0;
|
||||
ret = ::GetLongPathName(m_searchpath.c_str(), NULL, 0);
|
||||
if (ret)
|
||||
{
|
||||
std::unique_ptr<TCHAR[]> pathbuf(new TCHAR[ret + 2]);
|
||||
ret = ::GetLongPathName(m_searchpath.c_str(), pathbuf.get(), ret + 1);
|
||||
m_searchpath = std::wstring(pathbuf.get(), ret);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_patternregex.empty())
|
||||
@ -633,10 +636,15 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
OnOutOfScope(DestroyMenu(hSplitMenu));
|
||||
if (pDropDown->hdr.hwndFrom == GetDlgItem(*this, IDOK))
|
||||
{
|
||||
auto buf = GetDlgItemText(IDC_SEARCHPATH);
|
||||
bool bIsDir = !!PathIsDirectory(buf.get());
|
||||
if ((!bIsDir) && _tcschr(buf.get(), '|'))
|
||||
bIsDir = true; // assume directories in case of multiple paths
|
||||
|
||||
auto sInverseSearch = TranslatedString(hResource, IDS_INVERSESEARCH);
|
||||
auto sSearchInFoundFiles = TranslatedString(hResource, IDS_SEARCHINFOUNDFILES);
|
||||
auto sCaptureSearch = TranslatedString(hResource, IDS_CAPTURESEARCH);
|
||||
AppendMenu(hSplitMenu, MF_STRING, IDC_INVERSESEARCH, sInverseSearch.c_str());
|
||||
AppendMenu(hSplitMenu, bIsDir ? MF_STRING : MF_STRING | MF_DISABLED, IDC_INVERSESEARCH, sInverseSearch.c_str());
|
||||
AppendMenu(hSplitMenu, m_items.empty() ? MF_STRING | MF_DISABLED : MF_STRING, IDC_SEARCHINFOUNDFILES, sSearchInFoundFiles.c_str());
|
||||
AppendMenu(hSplitMenu, GetDlgItemTextLength(IDC_REPLACETEXT) ? MF_STRING : MF_STRING | MF_DISABLED, IDC_CAPTURESEARCH, sCaptureSearch.c_str());
|
||||
}
|
||||
|
||||
@ -29,10 +29,13 @@
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4458) // declaration of 'xxx' hides class member
|
||||
#include <gdiplus.h>
|
||||
#include "WinUser.h"
|
||||
#pragma warning(pop)
|
||||
|
||||
// Global Variables:
|
||||
HINSTANCE g_hInst; // current instance
|
||||
HICON g_hDlgIcon128;
|
||||
|
||||
bool bPortable = false;
|
||||
CSimpleIni g_iniFile;
|
||||
HANDLE hInitProtection = nullptr;
|
||||
@ -161,12 +164,16 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
g_hInst = hInstance;
|
||||
::OleInitialize(nullptr);
|
||||
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
||||
|
||||
// we need some of the common controls
|
||||
INITCOMMONCONTROLSEX icex;
|
||||
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||
icex.dwICC = ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PAGESCROLLER_CLASS | ICC_PROGRESS_CLASS | ICC_STANDARD_CLASSES | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_USEREX_CLASSES | ICC_WIN95_CLASSES;
|
||||
InitCommonControlsEx(&icex);
|
||||
|
||||
g_hDlgIcon128 = NULL;
|
||||
LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDI_GREPWIN), 128, 128, &g_hDlgIcon128);
|
||||
|
||||
HMODULE hRichEdt = LoadLibrary(L"Riched20.dll");
|
||||
|
||||
CCmdLineParser parser(lpCmdLine);
|
||||
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
//#pragma message(__LOC__"Run the NAnt script to get proper version info")
|
||||
|
||||
#define FILEVER 2, 1, 3, 18
|
||||
#define PRODUCTVER 2, 1, 3, 18
|
||||
#define STRFILEVER "2.1.3.18\0"
|
||||
#define STRPRODUCTVER "2.1.3.18\0"
|
||||
#define FILEVER 2, 1, 3, 19
|
||||
#define PRODUCTVER 2, 1, 3, 19
|
||||
#define STRFILEVER "2.1.3.19\0"
|
||||
#define STRPRODUCTVER "2.1.3.19\0"
|
||||
|
||||
#define GREPWIN_VERMAJOR 2
|
||||
#define GREPWIN_VERMINOR 1
|
||||
#define GREPWIN_VERMICRO 3
|
||||
#define GREPWIN_VERBUILD 18
|
||||
#define GREPWIN_VERDATE "2020-07-14"
|
||||
#define GREPWIN_VERBUILD 19
|
||||
#define GREPWIN_VERDATE "2020-07-21"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user