diff --git a/lib/shell.ppu b/lib/shell.ppu new file mode 100644 index 00000000..4a4294b6 Binary files /dev/null and b/lib/shell.ppu differ diff --git a/src/prog/shell.pas b/src/prog/shell.pas new file mode 100644 index 00000000..de2d0578 --- /dev/null +++ b/src/prog/shell.pas @@ -0,0 +1,63 @@ +unit shell; + +interface + +uses + Console, RTC; + +procedure init(); + +implementation + +var + Handle : HWND = 0; + Colors : uint32; + Explore_Colors : uint32; + +procedure Draw(); +var + DateTime : TDateTime; + i : uint32; + s : pchar; + +begin + DateTime:= getDateTime; + + console.clearWNDEx(Handle, colors); + + console.setCursorPosWND(0, 0, Handle); + console.writeStringExWND(' TERMINAL ', Explore_Colors, Handle); + console.writeCharExWND(#6, Colors, Handle); + + for i:=0 to 9 do begin + s:= getWindowName(i); + if s <> nil then begin + console.writeStringExWND(s, Colors, Handle); + console.writeCharExWND(' ', Colors, Handle); + console.writeCharExWND(#6, Colors, Handle); + end; + end; + + console.setCursorPosWND(150, 0, Handle); + if DateTime.Hours < 10 then writeIntExWND(0, Colors, Handle); + writeIntExWND(DateTime.Hours, Colors, Handle); + writeStringExWND(':', Colors, Handle); + if DateTime.Minutes < 10 then writeIntExWND(0, Colors, Handle); + writeIntExWND(DateTime.Minutes, Colors, Handle); + writeStringExWND(':', Colors, Handle); + if DateTime.Seconds < 10 then writeIntExWND(0, Colors, Handle); + writeIntExWND(DateTime.Seconds, Colors, Handle); +end; + +procedure init(); +begin + colors:= console.combinecolors($0000, $FFFF); + Explore_Colors:= console.combinecolors($01C3, $07EE); + Handle:= Console.newWindow(0, 63, 159, 1, 'SHELL'); + console.bordersEnabled(Handle, false); + //console.clearWNDEx(Handle, colors); + console.setShellWindow(Handle, false); + console.registerEventHandler(Handle, EVENT_DRAW, void(@Draw)); +end; + +end. \ No newline at end of file