mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #647 from RaiKoHoff/Dev_0906
Zoomlevel changed to percent instead of point-sizes
This commit is contained in:
commit
0d28ef0996
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -688,6 +688,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SC_POPUP_TEXT 2
|
||||
#define SCI_USEPOPUP 2371
|
||||
#define SCI_SELECTIONISRECTANGLE 2372
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
#define SC_MIN_ZOOM_LEVEL 10
|
||||
#define SC_MAX_ZOOM_LEVEL 500
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
#define SCI_SETZOOM 2373
|
||||
#define SCI_GETZOOM 2374
|
||||
#define SC_DOCUMENTOPTION_DEFAULT 0
|
||||
|
||||
@ -1774,6 +1774,12 @@ fun void UsePopUp=2371(int popUpMode,)
|
||||
# Is the selection rectangular? The alternative is the more common stream selection.
|
||||
get bool SelectionIsRectangle=2372(,)
|
||||
|
||||
# >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
# 2018-09-06 change zoom level and print magnification to percent value
|
||||
val SC_MIN_ZOOM_LEVEL=10
|
||||
val SC_MAX_ZOOM_LEVEL=500
|
||||
# <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
|
||||
# Set the zoom level. This number of points is added to the size of all fonts.
|
||||
# It may be positive to magnify or negative to reduce.
|
||||
set void SetZoom=2373(int zoomInPoints,)
|
||||
|
||||
5
scintilla/patch_text.txt
Normal file
5
scintilla/patch_text.txt
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
@ -65,7 +65,9 @@ static constexpr bool IsControlCharacter(int ch) noexcept {
|
||||
}
|
||||
|
||||
PrintParameters::PrintParameters() {
|
||||
magnification = 0;
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
magnification = 100;
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
colourMode = SC_PRINT_NORMAL;
|
||||
wrapState = eWrapWord;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
namespace Scintilla {
|
||||
|
||||
struct PrintParameters {
|
||||
int magnification;
|
||||
int magnification; /// @ 2018-09-06 Changed to a percent value
|
||||
int colourMode;
|
||||
WrapMode wrapState;
|
||||
PrintParameters();
|
||||
|
||||
@ -3826,15 +3826,17 @@ int Editor::KeyCommand(unsigned int iMessage) {
|
||||
AddChar('\f');
|
||||
break;
|
||||
case SCI_ZOOMIN:
|
||||
if (vs.zoomLevel < 20) {
|
||||
vs.zoomLevel++;
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
if (vs.ZoomIn()) {
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
InvalidateStyleRedraw();
|
||||
NotifyZoom();
|
||||
}
|
||||
break;
|
||||
case SCI_ZOOMOUT:
|
||||
if (vs.zoomLevel > -10) {
|
||||
vs.zoomLevel--;
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
if (vs.ZoomOut()) {
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
InvalidateStyleRedraw();
|
||||
NotifyZoom();
|
||||
}
|
||||
@ -6283,7 +6285,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
break;
|
||||
|
||||
case SCI_SETPRINTMAGNIFICATION:
|
||||
view.printParameters.magnification = static_cast<int>(wParam);
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
view.printParameters.magnification = std::clamp(static_cast<int>(wParam), SC_MIN_ZOOM_LEVEL, SC_MAX_ZOOM_LEVEL);
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
break;
|
||||
|
||||
case SCI_GETPRINTMAGNIFICATION:
|
||||
@ -7557,7 +7561,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
break;
|
||||
|
||||
case SCI_SETZOOM:
|
||||
vs.zoomLevel = static_cast<int>(wParam);
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
vs.zoomLevel = std::clamp(static_cast<int>(wParam), SC_MIN_ZOOM_LEVEL, SC_MAX_ZOOM_LEVEL);
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
InvalidateStyleRedraw();
|
||||
NotifyZoom();
|
||||
break;
|
||||
|
||||
@ -68,10 +68,12 @@ FontRealised::~FontRealised() {
|
||||
|
||||
void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs) {
|
||||
PLATFORM_ASSERT(fs.fontName);
|
||||
sizeZoomed = fs.size + zoomLevel * SC_FONT_SIZE_MULTIPLIER;
|
||||
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
|
||||
sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
|
||||
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
//sizeZoomed = fs.size + zoomLevel * SC_FONT_SIZE_MULTIPLIER;
|
||||
//if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
|
||||
// sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
|
||||
sizeZoomed = GetFontSizeZoomed(fs.size, zoomLevel);
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
const float deviceHeight = static_cast<float>(surface.DeviceHeightFont(sizeZoomed));
|
||||
const FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight, fs.italic, fs.extraFontFlag, technology, fs.characterSet);
|
||||
font.Create(fp);
|
||||
@ -277,7 +279,7 @@ void ViewStyle::Init(size_t stylesSize_) {
|
||||
marginInside = true;
|
||||
CalculateMarginWidthAndMask();
|
||||
textStart = marginInside ? fixedColumnWidth : leftMarginWidth;
|
||||
zoomLevel = 0;
|
||||
zoomLevel = 100; /// @ 20018-09-06 Changed to percent
|
||||
viewWhitespace = wsInvisible;
|
||||
tabDrawMode = tdLongArrow;
|
||||
whitespaceSize = 1;
|
||||
@ -572,6 +574,46 @@ bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) {
|
||||
return changed;
|
||||
}
|
||||
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
|
||||
bool ViewStyle::ZoomIn() noexcept {
|
||||
if (zoomLevel < SC_MAX_ZOOM_LEVEL) {
|
||||
int level = zoomLevel;
|
||||
if (level < 200) {
|
||||
level += 10;
|
||||
} else {
|
||||
level += 25;
|
||||
}
|
||||
|
||||
level = std::min(level, SC_MAX_ZOOM_LEVEL);
|
||||
if (level != zoomLevel) {
|
||||
zoomLevel = level;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ViewStyle::ZoomOut() noexcept {
|
||||
if (zoomLevel > SC_MIN_ZOOM_LEVEL) {
|
||||
int level = zoomLevel;
|
||||
if (level <= 200) {
|
||||
level -= 10;
|
||||
} else {
|
||||
level -= 25;
|
||||
}
|
||||
|
||||
level = std::max(level, SC_MIN_ZOOM_LEVEL);
|
||||
if (level != zoomLevel) {
|
||||
zoomLevel = level;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
|
||||
void ViewStyle::AllocStyles(size_t sizeNew) {
|
||||
size_t i=styles.size();
|
||||
styles.resize(sizeNew);
|
||||
|
||||
@ -63,6 +63,14 @@ typedef std::map<FontSpecification, std::unique_ptr<FontRealised>> FontMap;
|
||||
|
||||
enum WrapMode { eWrapNone, eWrapWord, eWrapChar, eWrapWhitespace };
|
||||
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
constexpr int GetFontSizeZoomed(int size, int zoomLevel) noexcept {
|
||||
size = (size * zoomLevel + 50) / 100;
|
||||
// Hangs if sizeZoomed (in point) <= 1
|
||||
return std::max(size, 2 * SC_FONT_SIZE_MULTIPLIER);
|
||||
}
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
|
||||
class ColourOptional : public ColourDesired {
|
||||
public:
|
||||
bool isSet;
|
||||
@ -135,7 +143,7 @@ public:
|
||||
int fixedColumnWidth; ///< Total width of margins
|
||||
bool marginInside; ///< true: margin included in text view, false: separate views
|
||||
int textStart; ///< Starting x position of text within the view
|
||||
int zoomLevel;
|
||||
int zoomLevel; /// @ 2018-09-06 Changed to a percent value
|
||||
WhiteSpaceVisibility viewWhitespace;
|
||||
TabDrawMode tabDrawMode;
|
||||
int whitespaceSize;
|
||||
@ -212,6 +220,11 @@ public:
|
||||
|
||||
bool WhiteSpaceVisible(bool inIndent) const;
|
||||
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
bool ViewStyle::ZoomIn() noexcept;
|
||||
bool ViewStyle::ZoomOut() noexcept;
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
|
||||
private:
|
||||
void AllocStyles(size_t sizeNew);
|
||||
void CreateAndAddFont(const FontSpecification &fs);
|
||||
|
||||
@ -24,6 +24,13 @@
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
|
||||
#if !defined(NOMINMAX)
|
||||
// Want to use std::min and std::max so don't want Windows.h version of min and max
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#define VC_EXTRALEAN 1
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <richedit.h>
|
||||
@ -2729,9 +2736,7 @@ void ScintillaWin::ImeStartComposition() {
|
||||
// The logfont for the IME is recreated here.
|
||||
const int styleHere = pdoc->StyleIndexAt(sel.MainCaret());
|
||||
LOGFONTW lf = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L"" };
|
||||
int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER;
|
||||
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
|
||||
sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
|
||||
int sizeZoomed = GetFontSizeZoomed(vs.styles[styleHere].size, vs.zoomLevel);
|
||||
AutoSurface surface(this);
|
||||
int deviceHeight = sizeZoomed;
|
||||
if (surface) {
|
||||
@ -3614,14 +3619,12 @@ sptr_t ScintillaWin::DirectFunction(
|
||||
return reinterpret_cast<ScintillaWin *>(ptr)->WndProc(iMessage, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
sptr_t __stdcall Scintilla_DirectFunction(
|
||||
ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
return sci->WndProc(iMessage, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
LRESULT PASCAL ScintillaWin::SWndProc(
|
||||
HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
|
||||
//Platform::DebugPrintf("S W:%x M:%x WP:%x L:%x\n", hWnd, iMessage, wParam, lParam);
|
||||
@ -3668,7 +3671,7 @@ int Scintilla_RegisterClasses(void *hInstance) {
|
||||
|
||||
namespace Scintilla {
|
||||
|
||||
int ResourcesRelease(bool fromDllMain) {
|
||||
int ResourcesRelease(bool fromDllMain) noexcept {
|
||||
const bool result = ScintillaWin::Unregister();
|
||||
Platform_Finalise(fromDllMain);
|
||||
return result;
|
||||
|
||||
@ -8314,12 +8314,10 @@ void EditShowZoomCallTip(HWND hwnd)
|
||||
{
|
||||
UNUSED(hwnd);
|
||||
|
||||
int const iZoomLevel = SciCall_GetZoom();
|
||||
float const fSize = Style_GetCurrentFontSize();
|
||||
int const iZoomPercent = float2int((100.0f * ((float)iZoomLevel + fSize)) / fSize);
|
||||
int const iZoomLevelPercent = SciCall_GetZoom();
|
||||
|
||||
char chToolTip[32] = { '\0' };
|
||||
StringCchPrintfA(chToolTip, COUNTOF(chToolTip), "Zoom: %i%%", iZoomPercent);
|
||||
StringCchPrintfA(chToolTip, COUNTOF(chToolTip), "Zoom: %i%%", iZoomLevelPercent);
|
||||
|
||||
DocPos const iPos = SciCall_PositionFromLine(SciCall_GetFirstVisibleLine());
|
||||
|
||||
|
||||
@ -125,6 +125,7 @@ WCHAR g_wchIniFile[MAX_PATH] = { L'\0' };
|
||||
WCHAR g_wchIniFile2[MAX_PATH] = { L'\0' };
|
||||
static WCHAR g_szTmpFilePath[MAX_PATH] = { L'\0' };
|
||||
|
||||
static int g_iSettingsVersion = CFG_VER_NONE;
|
||||
static bool g_bSaveSettings;
|
||||
static bool g_bEnableSaveSettings;
|
||||
bool g_bIniFileFromScratch = false;
|
||||
@ -1009,7 +1010,7 @@ static void __fastcall _InitWindowPosition()
|
||||
{
|
||||
g_WinInfo.x = g_WinInfo.y = g_WinInfo.cx = g_WinInfo.cy = CW_USEDEFAULT;
|
||||
g_WinInfo.max = 0;
|
||||
g_WinInfo.zoom = 0;
|
||||
g_WinInfo.zoom = 100;
|
||||
}
|
||||
else if (g_flagDefaultPos >= 4)
|
||||
{
|
||||
@ -1046,7 +1047,7 @@ static void __fastcall _InitWindowPosition()
|
||||
g_WinInfo.y += (g_flagDefaultPos & 32) ? 4 : 8;
|
||||
g_WinInfo.cy -= (g_flagDefaultPos & (16 | 32)) ? 12 : 16;
|
||||
g_WinInfo.max = 1;
|
||||
g_WinInfo.zoom = 0;
|
||||
g_WinInfo.zoom = 100;
|
||||
}
|
||||
}
|
||||
else if (g_flagDefaultPos == 2 || g_flagDefaultPos == 3) // NP3 default window position
|
||||
@ -4861,7 +4862,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_VIEW_RESETZOOM:
|
||||
{
|
||||
SciCall_SetZoom(0);
|
||||
SciCall_SetZoom(100);
|
||||
UpdateLineNumberWidth();
|
||||
EditShowZoomCallTip(g_hwndEdit);
|
||||
}
|
||||
@ -6610,12 +6611,16 @@ void GetFindPatternMB(LPSTR chFindPattern, size_t bufferSize)
|
||||
void LoadSettings()
|
||||
{
|
||||
WCHAR *pIniSection = LocalAlloc(LPTR, sizeof(WCHAR) * INISECTIONBUFCNT * HUGE_BUFFER);
|
||||
if (pIniSection) {
|
||||
int cchIniSection = (int)LocalSize(pIniSection) / sizeof(WCHAR);
|
||||
if (pIniSection)
|
||||
{
|
||||
int const cchIniSection = (int)LocalSize(pIniSection) / sizeof(WCHAR);
|
||||
|
||||
g_iSettingsVersion = IniGetInt(L"Settings", L"SettingsVersion", CFG_VER_NONE);
|
||||
|
||||
g_bEnableSaveSettings = true; // false: if settings-file is loaded in editor
|
||||
g_bSaveSettings = IniGetBool(L"Settings", L"SaveSettings", true);
|
||||
|
||||
|
||||
// first load "hard coded" .ini-Settings
|
||||
// --------------------------------------------------------------------------
|
||||
LoadIniSection(L"Settings2", pIniSection, cchIniSection);
|
||||
@ -6831,8 +6836,9 @@ void LoadSettings()
|
||||
iPrintColor = IniSectionGetInt(pIniSection, L"PrintColorMode", 3);
|
||||
iPrintColor = clampi(iPrintColor, 0, 4);
|
||||
|
||||
iPrintZoom = IniSectionGetInt(pIniSection, L"PrintZoom", 10);
|
||||
iPrintZoom = clampi(iPrintZoom - 10, -10, 20);
|
||||
iPrintZoom = IniSectionGetInt(pIniSection, L"PrintZoom", (g_iSettingsVersion < CFG_VER_0001) ? 10 : 100);
|
||||
if (g_iSettingsVersion < CFG_VER_0001) { iPrintZoom = 100 + (iPrintZoom-10) * 10; }
|
||||
iPrintZoom = clampi(iPrintZoom, SC_MIN_ZOOM_LEVEL, SC_MAX_ZOOM_LEVEL);
|
||||
|
||||
pagesetupMargin.left = IniSectionGetInt(pIniSection, L"PrintMarginLeft", -1);
|
||||
pagesetupMargin.left = max(pagesetupMargin.left, -1);
|
||||
@ -6990,8 +6996,9 @@ void LoadSettings()
|
||||
g_WinInfo.cy = IniSectionGetInt(pIniSection, tchSizeY, (INT_MAX >> 1));
|
||||
g_WinInfo.max = IniSectionGetInt(pIniSection, tchMaximized, 0);
|
||||
g_WinInfo.max = clampi(g_WinInfo.max, 0, 1);
|
||||
g_WinInfo.zoom = IniSectionGetInt(pIniSection, tchZoom, 0);
|
||||
g_WinInfo.zoom = clampi(g_WinInfo.zoom, -10, 20);
|
||||
g_WinInfo.zoom = IniSectionGetInt(pIniSection, tchZoom, (g_iSettingsVersion < CFG_VER_0001) ? 0 : 100);
|
||||
if (g_iSettingsVersion < CFG_VER_0001) { g_WinInfo.zoom = (g_WinInfo.zoom + 10) * 10; }
|
||||
g_WinInfo.zoom = clampi(g_WinInfo.zoom, SC_MIN_ZOOM_LEVEL, SC_MAX_ZOOM_LEVEL);
|
||||
|
||||
if (((g_WinInfo.x & ~CW_USEDEFAULT) == (INT_MAX >> 1)) ||
|
||||
((g_WinInfo.y & ~CW_USEDEFAULT) == (INT_MAX >> 1)) ||
|
||||
@ -7060,7 +7067,7 @@ void SaveSettings(bool bSaveSettingsNow) {
|
||||
CreateIniFile();
|
||||
|
||||
if (!g_bSaveSettings && !bSaveSettingsNow) {
|
||||
IniSetInt(L"Settings", L"SaveSettings", g_bSaveSettings);
|
||||
IniSetBool(L"Settings", L"SaveSettings", g_bSaveSettings);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7071,6 +7078,7 @@ void SaveSettings(bool bSaveSettingsNow) {
|
||||
pIniSection = LocalAlloc(LPTR, sizeof(WCHAR) * INISECTIONBUFCNT * HUGE_BUFFER);
|
||||
//int cchIniSection = (int)LocalSize(pIniSection) / sizeof(WCHAR);
|
||||
|
||||
IniSectionSetInt(pIniSection, L"SettingsVersion", CFG_VER_CURRENT);
|
||||
IniSectionSetBool(pIniSection, L"SaveSettings", g_bSaveSettings);
|
||||
IniSectionSetBool(pIniSection, L"SaveRecentFiles", g_bSaveRecentFiles);
|
||||
IniSectionSetBool(pIniSection, L"PreserveCaretPos", g_bPreserveCaretPos);
|
||||
@ -7134,7 +7142,7 @@ void SaveSettings(bool bSaveSettingsNow) {
|
||||
IniSectionSetInt(pIniSection, L"PrintHeader", iPrintHeader);
|
||||
IniSectionSetInt(pIniSection, L"PrintFooter", iPrintFooter);
|
||||
IniSectionSetInt(pIniSection, L"PrintColorMode", iPrintColor);
|
||||
IniSectionSetInt(pIniSection, L"PrintZoom", iPrintZoom + 10);
|
||||
IniSectionSetInt(pIniSection, L"PrintZoom", iPrintZoom);
|
||||
IniSectionSetInt(pIniSection, L"PrintMarginLeft", pagesetupMargin.left);
|
||||
IniSectionSetInt(pIniSection, L"PrintMarginTop", pagesetupMargin.top);
|
||||
IniSectionSetInt(pIniSection, L"PrintMarginRight", pagesetupMargin.right);
|
||||
@ -8742,7 +8750,7 @@ void UpdateSettingsCmds()
|
||||
CheckCmd(hmenu, IDM_VIEW_SAVESETTINGS, g_bSaveSettings && g_bEnableSaveSettings);
|
||||
EnableCmd(hmenu, IDM_VIEW_SAVESETTINGS, hasIniFile && g_bEnableSaveSettings);
|
||||
EnableCmd(hmenu, IDM_VIEW_SAVESETTINGSNOW, hasIniFile && g_bEnableSaveSettings);
|
||||
if (SciCall_GetZoom() != 0) { EditShowZoomCallTip(g_hwndEdit); }
|
||||
if (SciCall_GetZoom() != 100) { EditShowZoomCallTip(g_hwndEdit); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -484,8 +484,10 @@ extern "C" UINT_PTR CALLBACK PageSetupHook(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
|
||||
SendDlgItemMessage(hwnd,30,EM_LIMITTEXT,32,0);
|
||||
|
||||
SendDlgItemMessage(hwnd,31,UDM_SETRANGE,0,MAKELONG((short)20,(short)-10));
|
||||
SendDlgItemMessage(hwnd,31,UDM_SETPOS,0,MAKELONG((short)iPrintZoom,0));
|
||||
UDACCEL const acc[1] = { { 0, 10 } };
|
||||
SendDlgItemMessage(hwnd,31,UDM_SETACCEL,1,(WPARAM)acc);
|
||||
SendDlgItemMessage(hwnd,31,UDM_SETRANGE32,SC_MIN_ZOOM_LEVEL,SC_MAX_ZOOM_LEVEL);
|
||||
SendDlgItemMessage(hwnd,31,UDM_SETPOS32,0,iPrintZoom);
|
||||
|
||||
// Set header options
|
||||
GetLngString(IDS_MUI_PRINT_HEADER,tch,COUNTOF(tch));
|
||||
@ -527,7 +529,7 @@ extern "C" UINT_PTR CALLBACK PageSetupHook(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
p1 = p2;
|
||||
p2 = StrChr(p1, L'|'); // next
|
||||
}
|
||||
SendDlgItemMessage(hwnd,34,CB_SETCURSEL,(WPARAM)iPrintColor,0);
|
||||
SendDlgItemMessage(hwnd,34,CB_SETCURSEL,(LPARAM)iPrintColor,0);
|
||||
|
||||
// Make combos handier
|
||||
SendDlgItemMessage(hwnd,32,CB_SETEXTENDEDUI,true,0);
|
||||
@ -541,11 +543,9 @@ extern "C" UINT_PTR CALLBACK PageSetupHook(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK)
|
||||
{
|
||||
int iPos = (int)SendDlgItemMessage(hwnd,31,UDM_GETPOS,0,0);
|
||||
if (HIWORD(iPos) == 0)
|
||||
iPrintZoom = (int)(short)LOWORD(iPos);
|
||||
else
|
||||
iPrintZoom = 0;
|
||||
BOOL bError = FALSE;
|
||||
int const iPos = (int)SendDlgItemMessage(hwnd,31,UDM_GETPOS32,0,(LPARAM)&bError);
|
||||
iPrintZoom = bError ? 100 : iPos;
|
||||
|
||||
iPrintHeader = (int)SendDlgItemMessage(hwnd, 32, CB_GETCURSEL, 0, 0);
|
||||
iPrintFooter = (int)SendDlgItemMessage(hwnd, 33, CB_GETCURSEL, 0, 0);
|
||||
|
||||
@ -4127,9 +4127,9 @@ void Style_SetFolding(HWND hwnd, bool bShowCodeFolding)
|
||||
float fSize = _GetBaseFontSize();
|
||||
Style_StrGetSize(GetCurrentStdLexer()->Styles[STY_MARGIN].szValue, &fSize); // relative to LineNumber
|
||||
Style_StrGetSize(GetCurrentStdLexer()->Styles[STY_BOOK_MARK].szValue, &fSize);
|
||||
float const zoomPoints = (float)SciCall_GetZoom();
|
||||
float const zoomPercent = (float)SciCall_GetZoom();
|
||||
|
||||
int const iSizeDPI = ScaleToCurrentDPI(fSize + zoomPoints);
|
||||
int const iSizeDPI = ScaleToCurrentDPI((fSize * zoomPercent) / 100.0f);
|
||||
SciCall_SetMarginWidthN(MARGIN_SCI_FOLDING, (bShowCodeFolding) ? iSizeDPI : 0);
|
||||
}
|
||||
|
||||
@ -4144,9 +4144,9 @@ void Style_SetBookmark(HWND hwnd, bool bShowSelMargin)
|
||||
float fSize = _GetBaseFontSize();
|
||||
Style_StrGetSize(GetCurrentStdLexer()->Styles[STY_MARGIN].szValue, &fSize); // relative to LineNumber
|
||||
Style_StrGetSize(GetCurrentStdLexer()->Styles[STY_BOOK_MARK].szValue, &fSize);
|
||||
float const zoomPoints = (float)SciCall_GetZoom();
|
||||
float const zoomPercent = (float)SciCall_GetZoom();
|
||||
|
||||
int const iSizeDPI = ScaleToCurrentDPI(fSize + zoomPoints);
|
||||
int const iSizeDPI = ScaleToCurrentDPI((fSize * zoomPercent) / 100.0f);
|
||||
SciCall_SetMarginWidthN(MARGIN_SCI_BOOKMRK, (bShowSelMargin) ? iSizeDPI : 0);
|
||||
|
||||
// Depending on if the margin is visible or not, choose different bookmark indication
|
||||
|
||||
@ -70,11 +70,18 @@ inline RECT RectFromWinInfo(const WININFO* const pWinInfo) {
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// keep backward compatible with older settings-file versions
|
||||
typedef enum
|
||||
{
|
||||
CFG_VER_NONE = 0, /// old version
|
||||
CFG_VER_0001 = 1, /// ZoomLevel and PrintZoom changed from relative font size in point to absolute percentage.
|
||||
|
||||
CFG_VER_CURRENT = CFG_VER_0001
|
||||
} CFG_VERSION;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
typedef enum BufferSizes
|
||||
typedef enum
|
||||
{
|
||||
MICRO_BUFFER = 32,
|
||||
MINI_BUFFER = 64,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user