From ac7f81642103eb8fc2981cc51448ae842004d1a1 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 24 Nov 2023 00:29:15 +0100 Subject: [PATCH] Changing FLTK from Fl_Simple_Terminal to Fl_Terminal --- Monitor/TFLMonitor.cpp | 41 ++++++++++++++++++++--------------------- Monitor/TFLMonitor.h | 6 +++--- Monitor/TMonitor.cpp | 2 +- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Monitor/TFLMonitor.cpp b/Monitor/TFLMonitor.cpp index 0d9f455b..a0867742 100644 --- a/Monitor/TFLMonitor.cpp +++ b/Monitor/TFLMonitor.cpp @@ -33,7 +33,8 @@ #include #include #include -#include +#include +#include TFLMonitor::TFLMonitor(TBufferLog* inLog, TEmulator* inEmulator, @@ -92,8 +93,7 @@ TFLMonitor::DrawScreenHalted() KUInt32 realPC = GetProcessor()->GetRegister(15) - 4; // Go to the uppermost position. - mwTerminal->clear(); - mwTerminal->text(""); + mwTerminal->clear_screen_home(); int indexRegisters; for (indexRegisters = 0; indexRegisters < 16; indexRegisters++) { @@ -380,7 +380,6 @@ void TFLMonitor::DrawScreenRunning() { Fl::lock(); - mwTerminal->text(""); mwTerminal->printf("Machine is running. Use stop to halt it.\n"); mwTerminal->printf("-------------------------------------------------------------------------------\n"); int indexLog; @@ -440,14 +439,14 @@ TFLMonitor::Show() // ---- create the monitor window mwWindow = new TFLMonitorWindow(mx, my, mw, mh, "Einstein Monitor"); // ---- terminal window for all text output - mwTerminal = new Fl_Simple_Terminal(0, 0, mwWindow->w(), mwWindow->h() - 2 * ch); + mwTerminal = new Fl_Terminal(0, 0, mwWindow->w(), mwWindow->h() - 2 * ch); mwTerminal->box(FL_FLAT_BOX); - mwTerminal->hide_cursor(); + // mwTerminal->hide_cursor(); mwTerminal->color(FL_LIGHT3); mwTerminal->textcolor(FL_FOREGROUND_COLOR); - mwTerminal->cursor_color(FL_BACKGROUND_COLOR); - // mwTerminal->ansi(true); - mwTerminal->stay_at_bottom(true); + // mwTerminal->cursor_color(FL_BACKGROUND_COLOR); + mwTerminal->ansi(true); + // mwTerminal->stay_at_bottom(true); // --- group all this for perfect resizing Fl_Group* mwToolbar = new Fl_Group(0, mwWindow->h() - 2 * ch, mwWindow->w(), 2 * ch); // --- the stop button stops the emulation @@ -514,15 +513,15 @@ TFLMonitor::Hide() } } -void -TFLMonitor::PrintLine(const char* inLine, int type) -{ - (void) type; - if (mwTerminal) - { - Fl::lock(); - mwTerminal->append(inLine); - mwTerminal->append("\n"); - Fl::unlock(); - } -} +// void +// TFLMonitor::PrintLine(const char* inLine, int type) +//{ +// (void) type; +// if (mwTerminal) +// { +// Fl::lock(); +// mwTerminal->append(inLine); +// mwTerminal->append("\n"); +// Fl::unlock(); +// } +// } diff --git a/Monitor/TFLMonitor.h b/Monitor/TFLMonitor.h index 9fec2e6d..627e9cd1 100644 --- a/Monitor/TFLMonitor.h +++ b/Monitor/TFLMonitor.h @@ -28,7 +28,7 @@ #include "Monitor/TMonitor.h" class Fl_Window; -class Fl_Simple_Terminal; +class Fl_Terminal; class Fl_Button; class Fl_Input; @@ -61,7 +61,7 @@ class TFLMonitor : public TMonitor /// /// Output a line. /// - void PrintLine(const char* inLine, int type) override; + // void PrintLine(const char* inLine, int type) override; private: /// @@ -75,7 +75,7 @@ class TFLMonitor : public TMonitor void DrawScreenRunning(void); Fl_Window* mwWindow = nullptr; - Fl_Simple_Terminal* mwTerminal = nullptr; + Fl_Terminal* mwTerminal = nullptr; Fl_Button* mwPause = nullptr; Fl_Button* mwRun = nullptr; Fl_Button* mwStepOver = nullptr; diff --git a/Monitor/TMonitor.cpp b/Monitor/TMonitor.cpp index 368ccd1a..584a647c 100644 --- a/Monitor/TMonitor.cpp +++ b/Monitor/TMonitor.cpp @@ -982,7 +982,7 @@ TMonitor::ExecuteCommand(const char* inCommand) } theArgInt += 16; } - } else if (::sscanf(inCommand, "dis %X", &theArgInt) == 1) + } else if (::sscanf(inCommand, "dis%*[ ]%X", &theArgInt) == 1) { KUInt32 addr = theArgInt; KUInt32 data;