mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-31 19:30:44 +00:00
Add a virtual function to the Console class so that it does not need to keep track of the window.
This commit is contained in:
parent
d40eacf12e
commit
9cf5c41ad7
@ -286,13 +286,12 @@ void Console::ProcessOSCseq(char c)
|
||||
return;
|
||||
}
|
||||
++sequenceStep;
|
||||
windowName=" ";
|
||||
windowName="";
|
||||
break;
|
||||
default:
|
||||
if(c==BEL) // The BEL character ends the sequence.
|
||||
{
|
||||
windowName[0]=windowName.length();
|
||||
SetWTitle(win, (ConstStringPtr)windowName.c_str());
|
||||
setWindowName(windowName);
|
||||
OSCseq=false;
|
||||
isProcessingEscSequence=false;
|
||||
sequenceStep=0;
|
||||
|
@ -86,14 +86,15 @@ namespace retro
|
||||
short GetRows() const { return rows; }
|
||||
short GetCols() const { return cols; }
|
||||
|
||||
virtual void setWindowName(std::string newName) {};
|
||||
|
||||
|
||||
void Idle();
|
||||
|
||||
bool IsEOF() const { return eof; }
|
||||
protected:
|
||||
std::string windowName;
|
||||
WindowPtr win;
|
||||
|
||||
private:
|
||||
std::string windowName;
|
||||
GrafPtr consolePort = nullptr;
|
||||
Rect bounds;
|
||||
Attributes currentAttr;
|
||||
|
@ -36,8 +36,9 @@ ConsoleWindow::ConsoleWindow(Rect r, ConstStr255Param title)
|
||||
{
|
||||
GrafPtr port;
|
||||
//Retro68 Improved Console
|
||||
windowName="Retro68 Console";
|
||||
win = NewWindow(NULL, &r, "\pRetro68 Console", true, 0, (WindowPtr)-1, true, 0);
|
||||
win = NewWindow(NULL, &r, "\p", true, 0, (WindowPtr)-1, true, 0);
|
||||
setWindowName("Retro68 Console");
|
||||
|
||||
|
||||
#if !TARGET_API_MAC_CARBON
|
||||
port = win;
|
||||
@ -64,6 +65,14 @@ ConsoleWindow::~ConsoleWindow()
|
||||
DisposeWindow(win);
|
||||
}
|
||||
|
||||
void ConsoleWindow::setWindowName(std::string newName)
|
||||
{
|
||||
newName=" "+newName; // Convert into Pascal string
|
||||
newName[0]=newName.length();
|
||||
SetWTitle(win, (ConstStringPtr)newName.c_str());
|
||||
}
|
||||
|
||||
|
||||
char ConsoleWindow::WaitNextChar()
|
||||
{
|
||||
EventRecord event;
|
||||
|
@ -34,8 +34,10 @@ namespace retro
|
||||
public:
|
||||
ConsoleWindow(Rect r, ConstStr255Param title);
|
||||
~ConsoleWindow();
|
||||
void setWindowName(std::string newName);
|
||||
|
||||
private:
|
||||
//WindowPtr win;
|
||||
WindowPtr win;
|
||||
|
||||
virtual char WaitNextChar();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user