--- nono/wx/wxtextscreen.cpp 2026/04/29 17:04:53 1.1.1.5 +++ nono/wx/wxtextscreen.cpp 2026/04/29 17:05:00 1.1.1.7 @@ -7,7 +7,6 @@ #include "wxtextscreen.h" #include "wxcolor.h" #include "wxmainframe.h" -#include "bitrev.h" #include "cgrom.h" #include "sjis.h" @@ -23,12 +22,12 @@ wxBEGIN_EVENT_TABLE(WXTextScreen, inheri wxEND_EVENT_TABLE() // コンストラクタ -WXTextScreen::WXTextScreen(wxWindow *parent, IMonitor& monitor_) +WXTextScreen::WXTextScreen(wxWindow *parent, Monitor& monitor_) : inherited(parent) , monitor(monitor_) { // モニタサイズから初期サイズを決定 - nnSize ms = monitor.GetMonitorSize(); + nnSize ms = monitor.GetSize(); Init(ms.width, ms.height); wxSize size = wxSize(ms.width * font_width, ms.height * font_height); @@ -121,15 +120,19 @@ WXTextScreen::OnSize(wxSizeEvent& event) void WXTextScreen::OnTimer(wxTimerEvent& event) { - // モニタースクリーンを更新して再描画。 - monitor.MonitorUpdate(ts); - RefreshIfUpdated(); + DoRefresh(); } -// 必要なら画面を更新して再描画する +// 画面を更新して再描画する。 +// +// 通常はタイマーイベントにより更新間隔ごとに呼ばれるが、 +// ユーザ操作により画面の更新が必要ならその都度直接これを呼ぶ。 void -WXTextScreen::RefreshIfUpdated() +WXTextScreen::DoRefresh() { + // モニタースクリーンを更新して + MONITOR_UPDATE(monitor, ts); + // 必要なら再描画 if (ts.GetBuf() != prevbuf) { Refresh(); } @@ -177,6 +180,9 @@ WXTextScreen::Draw(wxDC& dc) case TA::On: SetTextColor(BGPANEL, *wxBLACK); break; + case TA::Off: + SetTextColor(*wxBLACK, UD_LIGHT_GREY); + break; case TA::Disable: SetTextColor(UD_GREY, BGPANEL); break; @@ -203,13 +209,13 @@ WXTextScreen::Draw(wxDC& dc) px += font_width * 1; } else { // 全角文字 - // XXX: 最右カラムだったら? + // XXX: 最右カラムだったら? if (*prev != data || prev[1] != text[1]) { uint code = (chr << 8) | (text[1] & 0xff); DrawChar2(dc, px, py, code, attr); if (SJIS::IsASCII(*prev) && SJIS::IsZenkaku(prev[1]) && x < col - 2) { - // 変更前が 'Aあ' だったら'あ'の2バイト目も消す + // 変更前が 'Aあ' だったら'あ'の2バイト目も消す prev[2] = 0; } prev[0] = data;