Skip to content

Commit

Permalink
Source refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
dosworld committed Dec 13, 2020
1 parent 736d0cd commit e4fa4c3
Show file tree
Hide file tree
Showing 19 changed files with 194 additions and 221 deletions.
Binary file modified BIN/DWEDOVL.EXE
Binary file not shown.
Binary file modified BIN/DWEDOVLP.EXE
Binary file not shown.
2 changes: 1 addition & 1 deletion SRC/DWED.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ const exename : string = 'DWEDOVL.EXE';

begin
launcher(exename);
end.
end.
2 changes: 1 addition & 1 deletion SRC/DWED16.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ const exename : string = 'DWEDOVLP.EXE';

begin
launcher(exename);
end.
end.
13 changes: 6 additions & 7 deletions SRC/DWEDADDO.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ end;
const ascii_tbl_sel : byte = 0;

procedure ascii_table(var ctx : TEditorContext);
var x, y, i, j : integer;
b : boolean;
color : byte;
cb : byte;
ch : char;
e : TEvent;
var x, y, i, j : integer;
b : boolean;
color, cb : byte;
ch : char;
e : TEvent;
begin
x := (scr.getwidth - 50) shr 1; y := (scr.getheight - 22) shr 1;
scrui.box(x, y, 50, 22, $1b);
Expand Down Expand Up @@ -167,7 +166,7 @@ calc_op : char = ' ';
radix : RadixType = RADIX10;

procedure calculator(var ctx : TEditorContext);
var x, y, i : integer;
var x, y, i : integer;
key : word;
ch : char;
insertStr : string;
Expand Down
11 changes: 5 additions & 6 deletions SRC/DWEDHELP.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,11 @@ begin
end;

procedure init;
var t : PHelpTopicList;
maxlen : integer;
len : integer;
totallen : integer;
topicname : string;
i, pos : integer;
var t : PHelpTopicList;
len, maxlen : integer;
totallen : integer;
i, pos : integer;
topicname : string;
begin
topic_list := from_memory(Pointer(@helpbin));
maxlen := 0;
Expand Down
7 changes: 6 additions & 1 deletion SRC/DWEDHL.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ begin
end;

procedure add_keyword(st : SourceType; keyword : string);
var lng : PLangDesc;
var lng : PLangDesc;
entry : PVocabEntry;
begin
lng := langs;
Expand Down Expand Up @@ -282,6 +282,7 @@ begin
hl_menu[pos] := #$0;
end;

procedure init;
var i : integer; s : string;
begin
dwedhl.add_lang(SRC_DISABLE, '|%?%|', false, '', ' DISABLE (Use this, if too slow)');
Expand Down Expand Up @@ -698,4 +699,8 @@ begin
dwedhl.add_keyword(SRC_NONE, 'note');

create_menu;
end;

begin
init;
end.
105 changes: 43 additions & 62 deletions SRC/DWEDHNDL.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ implementation

uses scr, kbd, scrui, lfn, strs, strutil, dwedscru, dwedutil, dwedaddo, dwedhl, dwedlnch;

{$F+}

const handlers : PEventHandler = nil;

{$F+}
{$F+}const handlers : PEventHandler = nil;{$F+}

procedure reg_handler(scancode : byte; is_ctrl, is_shift, is_alt, reset_selection : boolean; proc : pointer);
var h : PEventHandler;
Expand Down Expand Up @@ -71,8 +67,8 @@ end;
{$F+}

function process_event(var ctx : TEditorContext; var e : TEvent) : integer;
var h : PEventHandler;
r : integer;
var h : PEventHandler;
r : integer;
xofs : integer;
proc : TEventProc;
begin
Expand Down Expand Up @@ -104,12 +100,9 @@ begin
end;

{$F+}

function goto_mouse(var ctx : TEditorContext; event : PEvent) : integer;
var r : integer;
step : integer;
line : EditorStr;
steps : integer;
var r, step, steps : integer;
line : EditorStr;
begin
commit(ctx);
dec(event^.mouse_y);
Expand Down Expand Up @@ -137,13 +130,11 @@ MM_T2 : string[24] = ' Cut '+#$0a+' Copy ' + #0;
MM_T3 : string[24] = ' Cut '+#$0a+' Copy '+#$0a+' Paste ' + #0;

function handle_mouse(var ctx : TEditorContext; event : PEvent) : integer;
var r : integer;
mt : integer;
menu : string;
have_cb : boolean;
key : word;
selItem : integer;
x, y : integer;
var r, mt, x, y : integer;
menu : string;
have_cb : boolean;
key : word;
selItem : integer;
begin
r := SCRU_NONE;
if event^.etype = MOUSE_PRESS_B1 then begin
Expand Down Expand Up @@ -380,9 +371,8 @@ begin
end;

function hk_enter(var ctx:TEditorContext; event:PEvent):integer;
var s : string;
i : integer;
r : integer;
var s : string;
i, r : integer;
begin
commit(ctx);
if ctx.current^.editor.selection then begin
Expand Down Expand Up @@ -412,10 +402,8 @@ begin
end;

function hk_esc(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
c : PFileContext;
srcctx : PFileContext;
errCode : integer;
var r, errCode : integer;
c, srcctx : PFileContext;
begin
r := SCRU_QUIT;
commit(ctx);
Expand Down Expand Up @@ -496,10 +484,9 @@ end;


function hk_save_as(var ctx:TEditorContext; event:PEvent):integer;
var errCode : integer;
newname : string;
start_save : boolean;
msg : string;
var errCode : integer;
newname, msg : string;
start_save : boolean;
begin
commit(ctx);

Expand Down Expand Up @@ -540,7 +527,7 @@ begin
end;

function hk_bs(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
var r : integer;
s : string;
begin
r := SCRU_NONE;
Expand Down Expand Up @@ -620,8 +607,8 @@ begin
end;

function hk_cb_cutline(var ctx:TEditorContext; event:PEvent):integer;
var clinenum : longint;
r, x : integer;
var clinenum : longint;
r, x : integer;
begin
if (not ctx.current^.editor.selection) and (not strs.is_last(ctx.current^.cline)) then begin
commit(ctx);
Expand All @@ -647,7 +634,7 @@ begin
end;

function hk_cb_paste(var ctx:TEditorContext; event:PEvent):integer;
var lnum: word;
var lnum : word;
isfist : boolean;
begin
commit(ctx);
Expand Down Expand Up @@ -732,7 +719,7 @@ begin
end;

function hk_tab(var ctx:TEditorContext; event:PEvent):integer;
var i, r : integer;
var i, r : integer;
sb_y, se_y, clinenum : longint;
sb_x, se_x : integer;
line : EditorStr;
Expand Down Expand Up @@ -778,7 +765,7 @@ begin
end;

function hk_shift_tab(var ctx:TEditorContext; event:PEvent):integer;
var i, r : integer;
var i, r : integer;
sb_y, se_y, clinenum : longint;
sb_x, se_x : integer;
line : EditorStr;
Expand Down Expand Up @@ -827,7 +814,7 @@ begin
end;

function hk_default(var ctx:TEditorContext; event:PEvent):integer;
var r, len : integer;
var r, len : integer;
c : char;
changed : boolean;
begin
Expand Down Expand Up @@ -865,8 +852,7 @@ begin
end;

function search(var ctx:TEditorContext; is_replace : boolean):EditorStr;
var
line : EditorStr;
var line : EditorStr;
searchText : string;
lineStr : string;
start_col : integer;
Expand Down Expand Up @@ -905,7 +891,7 @@ begin
end;

function hk_find_again(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
var r : integer;
line : EditorStr;
lineStr : string;
searchText : string;
Expand Down Expand Up @@ -982,7 +968,7 @@ begin
end;

function hk_start_find(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
var r : integer;
sb_y, se_y, clinenum : longint;
sb_x, se_x : integer;
msg : string;
Expand Down Expand Up @@ -1066,7 +1052,7 @@ begin
end;

function hk_cb_save(var ctx:TEditorContext; event:PEvent):integer;
var fname : string;
var fname : string;
msg : string;
start_save : boolean;
errCode : integer;
Expand All @@ -1092,7 +1078,7 @@ begin
end;

function hk_cb_load(var ctx:TEditorContext; event:PEvent):integer;
var fname : string;
var fname : string;
msg : string;
start_load : boolean;
errCode : integer;
Expand Down Expand Up @@ -1131,11 +1117,11 @@ end;


function hk_close(var ctx:TEditorContext; event:PEvent):integer;
var canclose:boolean;
var canclose : boolean;
r, next, prev : PFileContext;
msg : string;
res : integer;
errCode : integer;
msg : string;
res : integer;
errCode : integer;
begin
res := SCRU_FULL;
commit(ctx);
Expand Down Expand Up @@ -1188,11 +1174,10 @@ begin
end;

function hk_load(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
var r, errCode : integer;
msg : string;
fname : string;
start_load : boolean;
errCode : integer;
begin
commit(ctx);
r := SCRU_CLINE;
Expand Down Expand Up @@ -1243,13 +1228,11 @@ begin
end;

function hk_userdef(var ctx:TEditorContext; event:PEvent):integer;
var cmd : string;
r : integer;
t : word;
writed : word;
can_run : boolean;
srcctx : PFileContext;
errCode : integer;
var cmd : string;
r, errCode : integer;
t, writed : word;
can_run : boolean;
srcctx : PFileContext;
begin
cmd := '';
r := SCRU_NONE;
Expand Down Expand Up @@ -1315,9 +1298,8 @@ begin
end;

function hk_move_line_up(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
s1 : string;
s2 : string;
var r : integer;
s1, s2 : string;
begin
r := SCRU_NONE;
if not strs.is_first(ctx.current^.cline) then begin
Expand All @@ -1337,9 +1319,8 @@ begin
end;

function hk_move_line_down(var ctx:TEditorContext; event:PEvent):integer;
var r : integer;
s1 : string;
s2 : string;
var r : integer;
s1, s2 : string;
begin
r := SCRU_NONE;
if not strs.is_last(ctx.current^.cline) then begin
Expand Down
9 changes: 4 additions & 5 deletions SRC/DWEDLNCH.PAS
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface

const DEVFILE : string = 'DWED:';

procedure launcher(var exename:string);
procedure launcher(var exename : string);
function is_installed : boolean;

implementation
Expand Down Expand Up @@ -259,11 +259,10 @@ begin
rfname := r;
end;

var
cur_drive : byte;
var cur_drive : byte;
cur_dir : string;

procedure launcher(var exename:string);
procedure launcher(var exename : string);
var params : string;
i : integer;
begin
Expand Down Expand Up @@ -297,4 +296,4 @@ begin
halt(code);
end;

end.
end.
Loading

0 comments on commit e4fa4c3

Please sign in to comment.