--- nono/wx/wxmonitor.cpp 2026/04/29 17:04:37 1.1.1.2 +++ nono/wx/wxmonitor.cpp 2026/04/29 17:04:39 1.1.1.3 @@ -11,61 +11,33 @@ // モニターウィンドウ // -// イベントテーブル -wxBEGIN_EVENT_TABLE(WXMonitorWindow, inherited) - EVT_TIMER(wxID_ANY, WXMonitorWindow::OnTimer) -wxEND_EVENT_TABLE() - // コンストラクタ WXMonitorWindow::WXMonitorWindow(wxWindow *parent, wxWindowID id, - const wxString& name, Object *obj) + const wxString& name, IMonitor& monitor_) : inherited(parent, id, name) { - object = obj; - assert(object); + // ↓+------------------+ + // | 上余白 | + // |左+------------+右| + // |余| TextScreen |余| + // |白+------------+白| + // | 下余白 | + // +------------------+ wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); // テキストスクリーン - TextScreen& monitor = object->monitor; - int col = monitor.GetCol(); - int row = monitor.GetRow(); - const uint16 *textbuf = monitor.GetBuf(); - screen = new WXTextScreen(this, col, row, textbuf); - topsizer->Add(screen, BorderFlags); + screen = new WXTextScreen(this, monitor_); + topsizer->Add(screen, 0, wxEXPAND | wxALL, DefaultPadding); SetSizer(topsizer); // 大きさをそれに固定 Layout(); Fit(); - - // 更新タイマーは適当な短さにしておく - timer.SetOwner(this); - timer.Start(10); } // デストラクタ WXMonitorWindow::~WXMonitorWindow() { } - -// タイマーイベント -void -WXMonitorWindow::OnTimer(wxTimerEvent& event) -{ - // モニタースクリーンを更新して再描画。 - bool avail = object->MonitorUpdate(); - assert(avail); - screen->Refresh(); -} - -// フォントサイズ変更 -void -WXMonitorWindow::SetFontSize(fontsize_t fontsize) -{ - screen->SetFontSize(fontsize); - // 大きさを変更 - Layout(); - Fit(); -}