Skip to content

Commit

Permalink
Changing FLTK from Fl_Simple_Terminal to Fl_Terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Nov 23, 2023
1 parent 87d7c41 commit ac7f816
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
41 changes: 20 additions & 21 deletions Monitor/TFLMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
#include <FL/Fl_Button.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Simple_Terminal.H>
#include <FL/Fl_Preferences.H>
#include <FL/Fl_Terminal.H>

TFLMonitor::TFLMonitor(TBufferLog* inLog,
TEmulator* inEmulator,
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
// }
// }
6 changes: 3 additions & 3 deletions Monitor/TFLMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "Monitor/TMonitor.h"

class Fl_Window;
class Fl_Simple_Terminal;
class Fl_Terminal;
class Fl_Button;
class Fl_Input;

Expand Down Expand Up @@ -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:
///
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Monitor/TMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ac7f816

Please sign in to comment.