--- nono/wx/wxtextscreen.h 2026/04/29 17:04:40 1.1.1.3 +++ nono/wx/wxtextscreen.h 2026/04/29 17:04:56 1.1.1.6 @@ -7,6 +7,8 @@ #pragma once #include "wxtextpanel.h" +#include "wxbitmapbuf.h" +#include "monitor.h" // // テキストスクリーンを表示するパネル @@ -22,12 +24,11 @@ class WXTextScreen : public WXTextPanel using inherited = WXTextPanel; public: - WXTextScreen(wxWindow *parent, IMonitor& monitor); + WXTextScreen(wxWindow *parent, Monitor& monitor); virtual ~WXTextScreen() override; - // 必要なら画面を更新して再描画する。 - // TextScreen が前回描画時から更新されていたら、このパネルを再描画する。 - void RefreshIfUpdated(); + // 画面を更新して再描画する。 + void DoRefresh(); // フォントサイズ変更 void SetFontSize(FontId fontid) override; @@ -35,8 +36,9 @@ class WXTextScreen : public WXTextPanel // 更新頻度設定 void SetRate(int hz); - // サイズ (桁数×行数) を取得する - const wxSize GetSize() const { return wxSize(ts.GetCol(), ts.GetRow()); } + // 桁数、行数を取得する + int GetCol() const { return ts.GetCol(); } + int GetRow() const { return ts.GetRow(); } // TextScreen のユーザデータ取得、設定 uint64 GetUserData() const { return ts.userdata; } @@ -47,17 +49,16 @@ class WXTextScreen : public WXTextPanel void OnSize(wxSizeEvent&); void OnTimer(wxTimerEvent&); + void Init(int col, int row); void Draw(wxDC& dc); - std::unique_ptr prevbuf {}; - std::unique_ptr bmpbuf {}; - std::unique_ptr image {}; - std::unique_ptr bitmap {}; - - IMonitor& monitor; - TextScreen ts; - int view_width = 0; - int view_height = 0; + // コントロール全域のビットマップ + WXBitmapBuf bitmap {}; + + std::vector prevbuf {}; + + Monitor& monitor; + TextScreen ts {}; wxTimer timer {};