FB2 Reader: fixed rolling up
git-svn-id: svn://kolibrios.org@9912 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7028e04565
commit
21c201190a
Binary file not shown.
@ -119,6 +119,7 @@ VAR
|
|||||||
sb: box_lib.scrollbar;
|
sb: box_lib.scrollbar;
|
||||||
urlstr* : S.STRING;
|
urlstr* : S.STRING;
|
||||||
DrawStatus, DrawToolbar: PROCEDURE;
|
DrawStatus, DrawToolbar: PROCEDURE;
|
||||||
|
win_size_x, win_size_y: INTEGER;
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE PushRef(ref: XML.TAG);
|
PROCEDURE PushRef(ref: XML.TAG);
|
||||||
@ -1543,7 +1544,7 @@ END CleanHistory;
|
|||||||
|
|
||||||
|
|
||||||
PROCEDURE Save;
|
PROCEDURE Save;
|
||||||
VAR history: File.FS; win_size_x, win_size_y, size, pos: INTEGER;
|
VAR history: File.FS; size, pos: INTEGER;
|
||||||
|
|
||||||
PROCEDURE WriteInt(history: File.FS; x: INTEGER);
|
PROCEDURE WriteInt(history: File.FS; x: INTEGER);
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -1578,7 +1579,6 @@ BEGIN
|
|||||||
IF File.WriteChar(history, 0X) THEN END;
|
IF File.WriteChar(history, 0X) THEN END;
|
||||||
WriteInt(history, fsize2);
|
WriteInt(history, fsize2);
|
||||||
WriteInt(history, chksum);
|
WriteInt(history, chksum);
|
||||||
SU.GetWindowSize(win_size_x, win_size_y);
|
|
||||||
WriteInt(history, win_size_x);
|
WriteInt(history, win_size_x);
|
||||||
WriteInt(history, win_size_y);
|
WriteInt(history, win_size_y);
|
||||||
WriteInt(history, Settings.PADDING.LRpc);
|
WriteInt(history, Settings.PADDING.LRpc);
|
||||||
@ -1792,6 +1792,13 @@ BEGIN
|
|||||||
END Set_b_pict;
|
END Set_b_pict;
|
||||||
|
|
||||||
|
|
||||||
|
PROCEDURE SetWinSize* (x, y: INTEGER);
|
||||||
|
BEGIN
|
||||||
|
win_size_x := x;
|
||||||
|
win_size_y := y
|
||||||
|
END SetWinSize;
|
||||||
|
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
clickRef := NIL;
|
clickRef := NIL;
|
||||||
hoverRef := NIL;
|
hoverRef := NIL;
|
||||||
|
@ -124,12 +124,16 @@ BEGIN
|
|||||||
SU.GetSystemColors;
|
SU.GetSystemColors;
|
||||||
SU.WindowRedrawStatus(1);
|
SU.WindowRedrawStatus(1);
|
||||||
IF Window.created THEN
|
IF Window.created THEN
|
||||||
Resize
|
IF ~SU.RolledUp() THEN
|
||||||
|
Resize;
|
||||||
|
DOM.SetWinSize(Window.width, Window.height)
|
||||||
|
END
|
||||||
ELSE
|
ELSE
|
||||||
Window.created := TRUE
|
Window.created := TRUE
|
||||||
END;
|
END;
|
||||||
SU.DefineAndDrawWindow(Window.left, Window.top, Window.width, Window.height,
|
SU.DefineAndDrawWindow(Window.left, Window.top, Window.width, Window.height,
|
||||||
SU.winColor, LSL(ORD({0, 1, 2}), 4) + 4 - ORD(DOM.loaded), Window.caption);
|
SU.winColor, LSL(ORD({0, 1, 2}), 4) + 4 - ORD(DOM.loaded), Window.caption);
|
||||||
|
IF ~SU.RolledUp() THEN
|
||||||
SU.DrawRect(0, 0, Window.width - 2 * WINDOW_BEVEL - 1, CANVAS_TOP, SU.winColor);
|
SU.DrawRect(0, 0, Window.width - 2 * WINDOW_BEVEL - 1, CANVAS_TOP, SU.winColor);
|
||||||
SU.DrawRect(0, Window.height - SkinHeight - WINDOW_BEVEL - STATUSBAR_HEIGHT + 1, Window.width - 2 * WINDOW_BEVEL - 1, STATUSBAR_HEIGHT, SU.winColor);
|
SU.DrawRect(0, Window.height - SkinHeight - WINDOW_BEVEL - STATUSBAR_HEIGHT + 1, Window.width - 2 * WINDOW_BEVEL - 1, STATUSBAR_HEIGHT, SU.winColor);
|
||||||
SU.DrawRect(0, 0, CANVAS_LEFT, Window.height - SkinHeight - WINDOW_BEVEL, SU.winColor);
|
SU.DrawRect(0, 0, CANVAS_LEFT, Window.height - SkinHeight - WINDOW_BEVEL, SU.winColor);
|
||||||
@ -138,6 +142,7 @@ BEGIN
|
|||||||
ToolBar;
|
ToolBar;
|
||||||
DOM.Draw;
|
DOM.Draw;
|
||||||
DrawStatus
|
DrawStatus
|
||||||
|
END
|
||||||
END;
|
END;
|
||||||
SU.WindowRedrawStatus(2)
|
SU.WindowRedrawStatus(2)
|
||||||
END DrawWindow;
|
END DrawWindow;
|
||||||
@ -270,7 +275,10 @@ END IsFB2;
|
|||||||
|
|
||||||
|
|
||||||
PROCEDURE main(title: ARRAY OF CHAR);
|
PROCEDURE main(title: ARRAY OF CHAR);
|
||||||
VAR WinW, X1, Y1, X2, Y2, scr_pos: INTEGER; Win2: W.tWindow; resize: BOOLEAN; FilePath: S.STRING; defpath: BOOLEAN;
|
VAR
|
||||||
|
WinW, X1, Y1, X2, Y2, scr_pos, ignore: INTEGER;
|
||||||
|
Win2: W.tWindow; resize: BOOLEAN;
|
||||||
|
FilePath: S.STRING; defpath: BOOLEAN;
|
||||||
BEGIN
|
BEGIN
|
||||||
SkinHeight := SU.SkinHeight();
|
SkinHeight := SU.SkinHeight();
|
||||||
sb := box_lib.kolibri_new_scrollbar(10 * 65536 + 200, 10 * 65536 + 30, 25, 15, 10, 0, 0, 0, 0, 0);
|
sb := box_lib.kolibri_new_scrollbar(10 * 65536 + 200, 10 * 65536 + 30, 25, 15, 10, 0, 0, 0, 0, 0);
|
||||||
@ -302,7 +310,8 @@ BEGIN
|
|||||||
SU.SetEventsMask({0, 1, 2, 5, 31});
|
SU.SetEventsMask({0, 1, 2, 5, 31});
|
||||||
SU.GetScreenArea(X1, Y1, X2, Y2);
|
SU.GetScreenArea(X1, Y1, X2, Y2);
|
||||||
WinW := (X2 - X1) DIV 2;
|
WinW := (X2 - X1) DIV 2;
|
||||||
W.init(Window, WinW DIV 2, Y1, WinW, Y2 - Y1, title);
|
SU.MinMax(WinW, 640, 65535);
|
||||||
|
W.init(Window, (X2 - X1 - WinW) DIV 2, Y1, WinW, Y2 - Y1, title);
|
||||||
Settings.Default;
|
Settings.Default;
|
||||||
DOM.GetWinSize(FileName, Window.width, Window.height);
|
DOM.GetWinSize(FileName, Window.width, Window.height);
|
||||||
|
|
||||||
@ -342,7 +351,8 @@ BEGIN
|
|||||||
|
|
||||||
DOM.Open(FileName, DrawWindow, DrawStatus, DrawToolbar);
|
DOM.Open(FileName, DrawWindow, DrawStatus, DrawToolbar);
|
||||||
IF resize THEN
|
IF resize THEN
|
||||||
DOM.Resize(Window.width - 2 * CANVAS_LEFT - 2 * WINDOW_BEVEL - 1 - SCROLLBAR_WIDTH, Window.height - SkinHeight - CANVAS_TOP - WINDOW_BEVEL + 1 - STATUSBAR_HEIGHT)
|
DOM.Resize(Window.width - 2 * CANVAS_LEFT - 2 * WINDOW_BEVEL - 1 - SCROLLBAR_WIDTH,
|
||||||
|
Window.height - SkinHeight - CANVAS_TOP - WINDOW_BEVEL + 1 - STATUSBAR_HEIGHT)
|
||||||
END;
|
END;
|
||||||
|
|
||||||
DrawWindow;
|
DrawWindow;
|
||||||
@ -350,20 +360,30 @@ BEGIN
|
|||||||
WHILE TRUE DO
|
WHILE TRUE DO
|
||||||
CASE SU.WaitForEvent() OF
|
CASE SU.WaitForEvent() OF
|
||||||
|1 : DrawWindow
|
|1 : DrawWindow
|
||||||
|2 : KeyDown
|
|2 :
|
||||||
|
IF ~SU.RolledUp() THEN
|
||||||
|
KeyDown
|
||||||
|
ELSE
|
||||||
|
ignore := SU.GetKey()
|
||||||
|
END
|
||||||
|3 : ButtonClick
|
|3 : ButtonClick
|
||||||
|6 : box_lib.scrollbar_v_mouse(sb);
|
|6 :
|
||||||
|
IF ~SU.RolledUp() THEN
|
||||||
|
box_lib.scrollbar_v_mouse(sb);
|
||||||
IF sb.position # scr_pos THEN
|
IF sb.position # scr_pos THEN
|
||||||
DOM.ScrollBar;
|
DOM.ScrollBar;
|
||||||
DOM.Draw;
|
DOM.Draw;
|
||||||
scr_pos := sb.position;
|
scr_pos := sb.position;
|
||||||
END;
|
END;
|
||||||
MouseEvent
|
MouseEvent
|
||||||
|
ELSE
|
||||||
|
ignore := SU.MouseVScroll()
|
||||||
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END main;
|
END main;
|
||||||
|
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
main("FB2 Reader v0.97a")
|
main("FB2 Reader v0.97c")
|
||||||
END FB2READ.
|
END FB2READ.
|
||||||
|
@ -377,4 +377,13 @@ BEGIN
|
|||||||
END GetSystemColors;
|
END GetSystemColors;
|
||||||
|
|
||||||
|
|
||||||
|
PROCEDURE RolledUp* (): BOOLEAN;
|
||||||
|
VAR
|
||||||
|
buffer: ARRAY 1024 OF BYTE;
|
||||||
|
BEGIN
|
||||||
|
K.sysfunc3(9, sys.ADR(buffer[0]), -1)
|
||||||
|
RETURN ODD(LSR(buffer[70], 2))
|
||||||
|
END RolledUp;
|
||||||
|
|
||||||
|
|
||||||
END SysUtils.
|
END SysUtils.
|
||||||
|
Loading…
Reference in New Issue
Block a user