--- nono/wx/wxmonitor.cpp 2026/04/29 17:05:48 1.1.1.11 +++ nono/wx/wxmonitor.cpp 2026/04/29 17:05:57 1.1.1.13 @@ -40,6 +40,10 @@ WXMonitorPanel::WXMonitorPanel(wxWindow auto mainframe = dynamic_cast(GetParent()->GetParent()); SetRate(mainframe->GetMonitorRate()); + // 今の所パディングは変わらない。 + monitor->SetPadding(WXTextScreen::DefaultPadding); + FontChanged(); + // 最初に一回描画を起こす wxTimerEvent dummy(timer); AddPendingEvent(dummy); @@ -50,6 +54,15 @@ WXMonitorPanel::~WXMonitorPanel() { } +// フォントサイズ変更 +void +WXMonitorPanel::FontChanged() +{ + inherited::FontChanged(); + + monitor->SetFontSize(font_width, font_height); +} + // タイマーイベント void WXMonitorPanel::OnTimer(wxTimerEvent& event) @@ -64,11 +77,21 @@ WXMonitorPanel::OnTimer(wxTimerEvent& ev void WXMonitorPanel::DoRefresh() { + bool updated = false; + // モニタースクリーンを更新して - MONITOR_UPDATE(monitor, screen); + monitor->UpdateScreen(screen); + if (screen.GetBuf() != prevbuf) { + updated = true; + } + + // あればビットマップ描画を足して + if (monitor->UpdateBitmap(bitmap)) { + updated = true; + } // 必要なら再描画 - if (screen.GetBuf() != prevbuf) { + if (updated) { Refresh(); } } @@ -133,12 +156,12 @@ WXScrollMonitorWindow::WXScrollMonitorWi // 処理しているので問題ないが、パネル領域でのマウスホイール操作はここ // (wxFrame)ではなくパネルに対して飛んでくる。 // ここで一緒に処理したほうが楽なので、こちらに回す。 - monpanel->Connect(wxEVT_MOUSEWHEEL, - wxMouseEventHandler(WXScrollMonitorWindow::OnMouseWheel), NULL, this); + monpanel->Bind(wxEVT_MOUSEWHEEL, + &WXScrollMonitorWindow::OnMouseWheel, this); // スクロールバーからの位置変更通知 - vscroll->Connect(NONO_EVT_SCROLL, - wxScrollEventHandler(WXScrollMonitorWindow::OnScroll), NULL, this); + vscroll->Bind(NONO_EVT_SCROLL, &WXScrollMonitorWindow::OnScroll, this); + DPRINTF("%s done\n", __method__); }