Ereigniszustellung und Hostgrenzen korrigieren und Change archivieren
This commit is contained in:
32
tests/compat/eingabe-maus-taste.frm
Normal file
32
tests/compat/eingabe-maus-taste.frm
Normal file
@@ -0,0 +1,32 @@
|
||||
VERSION 1.00
|
||||
Begin Form Form1
|
||||
Width = 40
|
||||
Height = 12
|
||||
Begin TextBox Text1
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 10
|
||||
Height = 1
|
||||
End
|
||||
End
|
||||
|
||||
' tb-screen: 80x25
|
||||
' tb-events: time:0ms | mouse:down,1,0,2,2 | key:K
|
||||
' Erwartete Handlerwirkungen in Hostreihenfolge; keine Snapshot-Neuaufnahme.
|
||||
Text1.SetFocus
|
||||
DIM SHARED s$
|
||||
DOEVENTS
|
||||
DOEVENTS
|
||||
DOEVENTS
|
||||
Form1.Hide
|
||||
CLS
|
||||
PRINT s$
|
||||
END
|
||||
SUB Text1_KeyPress(KeyAscii AS INTEGER)
|
||||
SHARED s$
|
||||
s$ = s$ + CHR$(KeyAscii)
|
||||
END SUB
|
||||
SUB Form_MouseDown(Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
|
||||
SHARED s$
|
||||
s$ = s$ + "M"
|
||||
END SUB
|
||||
1
tests/compat/eingabe-maus-taste.out
Normal file
1
tests/compat/eingabe-maus-taste.out
Normal file
@@ -0,0 +1 @@
|
||||
MK
|
||||
32
tests/compat/eingabe-taste-maus.frm
Normal file
32
tests/compat/eingabe-taste-maus.frm
Normal file
@@ -0,0 +1,32 @@
|
||||
VERSION 1.00
|
||||
Begin Form Form1
|
||||
Width = 40
|
||||
Height = 12
|
||||
Begin TextBox Text1
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 10
|
||||
Height = 1
|
||||
End
|
||||
End
|
||||
|
||||
' tb-screen: 80x25
|
||||
' tb-events: time:0ms | key:K | mouse:down,1,0,2,2
|
||||
' Erwartete Handlerwirkungen in Hostreihenfolge; keine Snapshot-Neuaufnahme.
|
||||
Text1.SetFocus
|
||||
DIM SHARED s$
|
||||
DOEVENTS
|
||||
DOEVENTS
|
||||
DOEVENTS
|
||||
Form1.Hide
|
||||
CLS
|
||||
PRINT s$
|
||||
END
|
||||
SUB Text1_KeyPress(KeyAscii AS INTEGER)
|
||||
SHARED s$
|
||||
s$ = s$ + CHR$(KeyAscii)
|
||||
END SUB
|
||||
SUB Form_MouseDown(Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
|
||||
SHARED s$
|
||||
s$ = s$ + "M"
|
||||
END SUB
|
||||
1
tests/compat/eingabe-taste-maus.out
Normal file
1
tests/compat/eingabe-taste-maus.out
Normal file
@@ -0,0 +1 @@
|
||||
KM
|
||||
2
tests/terminalfrei/.gitignore
vendored
Normal file
2
tests/terminalfrei/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/target
|
||||
/Cargo.lock
|
||||
13
tests/terminalfrei/Cargo.toml
Normal file
13
tests/terminalfrei/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "tb-terminalfrei-check"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
# Eigener Resolver: keine Feature-Unifikation mit CLI/IDE im Hauptworkspace.
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
tb-vm = { path = "../../crates/tb-vm" }
|
||||
tb-runtime = { path = "../../crates/tb-runtime" }
|
||||
tb-ui = { path = "../../crates/tb-ui" }
|
||||
29
tests/terminalfrei/src/main.rs
Normal file
29
tests/terminalfrei/src/main.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use tb_runtime::host::{CaptureHost, Ereignis, MausArt, MausEreignis};
|
||||
use tb_vm::interp::{RunEvent, Vm};
|
||||
|
||||
fn main() {
|
||||
let form = tb_ui::frm::read_text(
|
||||
"eingabe-taste-maus.frm",
|
||||
include_str!("../../compat/eingabe-taste-maus.frm"),
|
||||
)
|
||||
.unwrap();
|
||||
let module = tb_vm::compile_source_with_forms("FORM1", &form.code, &form.catalog()).unwrap();
|
||||
let mut vm = Vm::new(module);
|
||||
form.apply(&mut vm.forms).unwrap();
|
||||
vm.forms.show(0, false).unwrap();
|
||||
let mut host = CaptureHost::default();
|
||||
host.ereignis_nach(2, Ereignis::Taste("K".into(), 0));
|
||||
host.ereignis_nach(
|
||||
2,
|
||||
Ereignis::Maus(MausEreignis {
|
||||
art: MausArt::Druck,
|
||||
taste: 1,
|
||||
shift: 0,
|
||||
zeile: 2,
|
||||
spalte: 2,
|
||||
}),
|
||||
);
|
||||
assert_eq!(vm.run(&mut host), RunEvent::Ended);
|
||||
assert_eq!(tb_runtime::snapshot::text(&vm.rt.screen), "KM\n");
|
||||
println!("Terminalfreier FRM-/VM-Lauf: KM");
|
||||
}
|
||||
Reference in New Issue
Block a user