--- nono/wx/wxtextscreen.h 2026/04/29 17:05:08 1.1.1.7 +++ nono/wx/wxtextscreen.h 2026/04/29 17:05:12 1.1.1.8 @@ -17,7 +17,7 @@ #pragma once #include "wxtextpanel.h" -#include "monitor.h" +#include "geometric.h" class WXTextScreen : public WXTextPanel { @@ -33,17 +33,14 @@ class WXTextScreen : public WXTextPanel static const int DefaultPadding = 3; public: - WXTextScreen(wxWindow *parent, Monitor& monitor); + WXTextScreen(wxWindow *parent, const nnSize& screensize); virtual ~WXTextScreen() override; - // 画面を更新して再描画する。 - void DoRefresh(); - // フォントサイズ変更 void FontChanged() override; - // 更新頻度設定 - void SetRate(int hz); + // テキストスクリーンを取得 (WXTextScreen を継承せずに更新する人のため) + TextScreen& GetScreen() { return screen; } // パディングサイズ変更 void SetPadding(int l, int t, int r, int b); @@ -54,24 +51,27 @@ class WXTextScreen : public WXTextPanel int GetPaddingBottom() const { return pad_bottom; } // 桁数、行数を取得する - int GetCol() const { return ts.GetCol(); } - int GetRow() const { return ts.GetRow(); } + int GetCol() const { return screen.GetCol(); } + int GetRow() const { return screen.GetRow(); } // クライアント座標 pos をテキスト座標(桁、行)に変換して返す // (パディング領域では戻り値が負数になることに注意) wxPoint GetTextPosition(const wxPoint& pos) const; // TextScreen のユーザデータ取得、設定 - uint64 GetUserData() const { return ts.userdata; } - void SetUserData(uint64 value) { ts.userdata = value; } + uint64 GetUserData() const { return screen.userdata; } + void SetUserData(uint64 value) { screen.userdata = value; } // コンテキストメニューイベントを解除 // (ここのコンテキストメニューを使いたくない人が呼ぶ) void DisconnectContextMenu(); + protected: + TextScreen screen {}; + std::vector prevbuf {}; + private: void OnSize(wxSizeEvent&); - void OnTimer(wxTimerEvent&); void OnContextMenu(wxContextMenuEvent&); void OnCopy(wxCommandEvent&); @@ -83,17 +83,10 @@ class WXTextScreen : public WXTextPanel // コンテキストメニューを接続 void ConnectContextMenu(); - std::vector prevbuf {}; - - Monitor& monitor; - TextScreen ts {}; - int pad_left {}; int pad_top {}; int pad_right {}; int pad_bottom {}; - wxTimer timer {}; - wxDECLARE_EVENT_TABLE(); };