--- nono/wx/wxstatuspanel.h 2026/04/29 17:05:00 1.1.1.3 +++ nono/wx/wxstatuspanel.h 2026/04/29 17:05:08 1.1.1.4 @@ -4,14 +4,17 @@ // Licensed under nono-license.txt // +// +// ステータスパネル +// + #pragma once -#include "wxnono.h" -#include "wxbitmapbuf.h" #include "wxtextpanel.h" #include "scsibus.h" class Indicator; +class HostNetDevice; class WXStatusPanel; // インジケータ情報 (基本クラス) @@ -20,7 +23,7 @@ class WXStatusPanel; class Indicator { protected: - using dispfunc_t = void (WXStatusPanel::*)(wxDC&, const Indicator *); + using dispfunc_t = void (WXStatusPanel::*)(const Indicator *); using eventfunc_t = void (WXStatusPanel::*)(const Indicator *); public: Indicator() { } @@ -43,7 +46,7 @@ class Indicator eventfunc_t dclick {}; // 枠の位置と大きさは panel.GetRect() で取得できる (実行時に計算する) - wxRect rect {}; + Rect rect {}; }; // インジケータ情報 (SCSI) @@ -73,35 +76,29 @@ class WXStatusPanel : public WXTextPanel WXStatusPanel(wxWindow *parent); virtual ~WXStatusPanel() override; - void SetFontSize(FontId) override; + void FontChanged() override; private: void OnClose(wxCloseEvent&); void OnShow(wxShowEvent&); void OnSize(wxSizeEvent&); void OnTimer(wxTimerEvent&); - void OnPaint(wxPaintEvent&); void OnLeftDClick(wxMouseEvent&); void OnContextMenu(wxContextMenuEvent&); void OnSCSIMediaChanged(wxCommandEvent&); - void DoSize(); bool UpdateStat(); - void Draw(wxDC&); + void Draw() override; void InitIndicators(); void LayoutIndicators(); - void DrawPerf(wxDC&, const Indicator *); - void DrawSCSI(wxDC&, const Indicator *); - void DrawNet(wxDC&, const Indicator *); - void DrawPower(wxDC&, const Indicator *); - void DrawTextLED(wxDC&, const Indicator *, - const wxColour& fg, const wxColour& bg); + void DrawPerf(const Indicator *); + void DrawSCSI(const Indicator *); + void DrawNet(const Indicator *); + void DrawPower(const Indicator *); + void DrawTextLED(const Indicator *, Color fg, Color bg); void DClickPerf(const Indicator *); void ContextMenuCD(const Indicator *); - // コントロール全域のビットマップ - WXBitmapBuf bitmap {}; - // インジケータ情報 std::vector indicators {}; @@ -118,6 +115,7 @@ class WXStatusPanel : public WXTextPanel DISABLE = 0, // 存在してホスト側が無効 (driver = none) ENABLE = 1, // 存在してホスト側が有効 } net_ok {}; + HostNetDevice *hostnet {}; uint64 net_tx_pkts {}; uint64 net_rx_pkts {}; bool net_tx_active {};