--- nono/wx/wxstatuspanel.h 2026/04/29 17:05:23 1.1.1.8 +++ nono/wx/wxstatuspanel.h 2026/04/29 17:05:27 1.1.1.9 @@ -20,108 +20,14 @@ class Syncer; class Status; class WXStatusPanel; -// インジケータ情報 (ほぼ構造体) -class Indicator -{ - public: - // インジケータの識別子 - enum { - NONE = 0, - PERF, - POWER, - SCSI0, - SCSI1, - SCSI2, - SCSI3, - SCSI4, - SCSI5, - SCSI6, - SCSI7, - VBLK0, - VBLK1, - VBLK2, - VBLK3, - VBLK4, - VBLK5, - VBLK6, - VBLK7, - LAN0, - LAN1, - FDD0, - FDD1, - FDD2, - FDD3, - NEWSLED1, - NEWSLED2, - }; - protected: - using dispfunc_t = void (WXStatusPanel::*)(const Indicator *); - using eventfunc_t = void (WXStatusPanel::*)(const Indicator *); - public: - Indicator() { } - // 文字列の長さだけ指定する場合 - Indicator(int id_, dispfunc_t draw_, int minlen_, Status *stat_) { - id = id_; - draw = draw_; - stat = stat_; - minlen = minlen_; - } - // 文字列で指定する場合 - Indicator(int id_, dispfunc_t draw_, const std::string& text_, - Status *stat_) - : Indicator(id_, draw_, text_.length(), stat_) - { - text = text_; - } - virtual ~Indicator() = default; - - // インジケータ識別子 - int id {}; - - // 対応する状態 - Status *stat {}; - - // 枠内の最小文字列長。 - // 枠の大きさはこの文字列長と text.length() の長いほうで描画される。 - int minlen {}; - - // 表示する文字列。 - std::string text {}; - - // 描画関数 (必須) - dispfunc_t draw {}; - - // ダブルクリックの処理関数 (必要なら) - eventfunc_t dclick {}; - - // コンテキストメニューの処理関数 (必要なら) - eventfunc_t contextmenu {}; - - // 対応するデバイス (必要なら) - Device *dev {}; - - // ToolTip を表示するためのダミーパネル - wxPanel *panel {}; - - // 枠の位置と大きさは panel.GetRect() で取得できる (実行時に計算する) - Rect rect {}; - - public: - // SCSI なら SCSI ID を返す。そうでなければ -1 を返す。 - int GetSCSIID() const; - - // FDD ならユニット番号を返す。そうでなければ -1 を返す。 - int GetFDUnit() const; -}; - // ステータスパネル class WXStatusPanel : public WXTextPanel { using inherited = WXTextPanel; public: - WXStatusPanel(wxWindow *parent); - virtual ~WXStatusPanel() override; + explicit WXStatusPanel(wxWindow *parent); + ~WXStatusPanel() override; void FontChanged() override; @@ -162,8 +68,8 @@ class WXStatusPanel : public WXTextPanel // インジケータ表示用 bool ispower {}; bool powerled {}; - int perf_mode {}; - int perf_rate {}; + uint perf_mode {}; + uint perf_rate {}; std::array scsi_loaded {}; std::array fd_loaded {};