--- nono/wx/wxlcdwindow.h 2026/04/29 17:04:39 1.1 +++ nono/wx/wxlcdwindow.h 2026/04/29 17:05:12 1.1.1.7 @@ -10,34 +10,24 @@ #pragma once -#include "wxheader.h" #include "wxsubwindow.h" +#include "wxbitmappanel.h" +#include "wxmonitor.h" // LCD パネル -class WXLCDPanel : public wxPanel +class WXLCDPanel : public WXBitmapPanel { - using inherited = wxPanel; + using inherited = WXBitmapPanel; public: WXLCDPanel(wxWindow *parent); - ~WXLCDPanel(); + virtual ~WXLCDPanel() override; private: - void OnTimer(wxTimerEvent& event); - void OnPaint(wxPaintEvent& event); - void Draw(wxDC&); - void DrawChar(wxDC&, int x, int y, uint8 ch); + void OnLCDChanged(wxCommandEvent& event); + void Draw() override; + void DrawChar(int x, int y, uint8 ch); const uint8 *ddram {}; - - std::unique_ptr bmpbuf {}; - std::unique_ptr image {}; - std::unique_ptr bitmap {}; - - // 描画管理用 - uint32 count {}; - wxTimer timer {}; - - wxDECLARE_EVENT_TABLE(); }; // LCD ウィンドウ @@ -45,30 +35,23 @@ class WXLCDWindow : public WXSubWindow { using inherited = WXSubWindow; public: - WXLCDWindow(wxWindow *parent, wxWindowID id); - ~WXLCDWindow(); + WXLCDWindow(wxWindow *parent); + virtual ~WXLCDWindow() override; private: WXLCDPanel *panel {}; }; // LCD キャラクタパネル -class WXLCDCharPanel : public wxPanel +class WXLCDCharPanel : public WXBitmapPanel { - using inherited = wxPanel; + using inherited = WXBitmapPanel; public: WXLCDCharPanel(wxWindow *parent); - ~WXLCDCharPanel(); + virtual ~WXLCDCharPanel() override; private: - void OnPaint(wxPaintEvent& event); - void Draw(wxDC&); - - std::unique_ptr bmpbuf {}; - std::unique_ptr image {}; - std::unique_ptr bitmap {}; - - wxDECLARE_EVENT_TABLE(); + void Draw() override; }; // LCD キャラクタウィンドウ @@ -76,10 +59,10 @@ class WXLCDMonitor : public WXSubWindow { using inherited = WXSubWindow; public: - WXLCDMonitor(wxWindow *parent, wxWindowID id); - ~WXLCDMonitor(); + WXLCDMonitor(wxWindow *parent); + virtual ~WXLCDMonitor() override; private: - WXTextScreen *monpanel {}; + WXMonitorPanel *monpanel {}; WXLCDCharPanel *chrpanel {}; };