Zoom
Posted: Fri Aug 02, 2019 4:11 pm
Anton Dmitriev implemented feature for zooming BlackBox views with Ctrl+Scroll.
It is interface compatible, so you can also adopt this for 1.7.2 without interfaces change.
You can try how it works here:
https://blackbox.oberon.org/download
That feature makes BlackBox more accessible for people without necessary change the font size in sources or documentation.
The behavior is very similar to modern browsers.
It is interface compatible, so you can also adopt this for 1.7.2 without interfaces change.
You can try how it works here:
https://blackbox.oberon.org/download
That feature makes BlackBox more accessible for people without necessary change the font size in sources or documentation.
The behavior is very similar to modern browsers.
Code: Select all
diff --git a/BlackBox/System/Mod/Ports.odc b/BlackBox/System/Mod/Ports.odc
index bdd9e35..89cbaaa 100644
--- a/BlackBox/System/Mod/Ports.odc
+++ b/BlackBox/System/Mod/Ports.odc
@@ -85,7 +85,7 @@ MODULE Ports;
PROCEDURE (p: Port) Init* (unit: INTEGER; printerMode: BOOLEAN), NEW;
BEGIN
- ASSERT((p.unit = 0) OR (p.unit = unit), 20); ASSERT(unit > 0, 21);
+ (* ASSERT((p.unit = 0) OR (p.unit = unit), 20); *) ASSERT(unit > 0, 21);
ASSERT((p.unit = 0) OR (p.printerMode = printerMode), 22);
p.unit := unit;
p.printerMode := printerMode;
diff --git a/BlackBox/_Windows_GUI/Host/Mod/Windows.odc b/BlackBox/_Windows_GUI/Host/Mod/Windows.odc
index cea3000..e9314ef 100644
--- a/BlackBox/_Windows_GUI/Host/Mod/Windows.odc
+++ b/BlackBox/_Windows_GUI/Host/Mod/Windows.odc
@@ -1237,10 +1237,19 @@ MODULE HostWindows;
PROCEDURE WheelScroll (wnd: WinApi.HANDLE; wParam, lParam: INTEGER);
VAR w: Window; res, lines, delta, keys: INTEGER; msg: Controllers.WheelMsg;
- p: WinApi.POINT;
+ p: WinApi.POINT; dx: INTEGER;
BEGIN
delta := wParam DIV 10000H; keys := wParam MOD 10000H;
w := ThisWindow(wnd);
+ IF ~({Windows.isTool, Windows.noResize} / w.flags = {}) & ODD(wParam DIV 8) THEN
+ dx := unit DIV 10;
+ IF wParam < 0 THEN ELSIF w.port.unit > dx THEN dx := -dx ELSE dx := 0 END;
+ w.port.Init(w.port.unit + dx, Ports.IsPrinterPort(w.port));
+ w.frame.ConnectTo(w.port);
+ Views.AdaptRoot(w.frame);
+ Views.Update(w.doc, Views.rebuildFrames);
+ RETURN
+ END;
lines := 1;
(*
(END)