--- nono/wx/wxlcdwindow.h 2026/04/29 17:04:39 1.1 +++ nono/wx/wxlcdwindow.h 2026/04/29 17:04:59 1.1.1.5 @@ -10,7 +10,8 @@ #pragma once -#include "wxheader.h" +#include "wxnono.h" +#include "wxbitmapbuf.h" #include "wxsubwindow.h" // LCD パネル @@ -19,23 +20,17 @@ class WXLCDPanel : public wxPanel using inherited = wxPanel; public: WXLCDPanel(wxWindow *parent); - ~WXLCDPanel(); + virtual ~WXLCDPanel() override; private: - void OnTimer(wxTimerEvent& event); + void OnLCDChanged(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); void Draw(wxDC&); void DrawChar(wxDC&, 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 {}; + WXBitmapBuf bitmap {}; wxDECLARE_EVENT_TABLE(); }; @@ -45,28 +40,26 @@ 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 WXPaddingPanel { - using inherited = wxPanel; + using inherited = WXPaddingPanel; 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 {}; + WXBitmapBuf bitmap {}; wxDECLARE_EVENT_TABLE(); }; @@ -76,8 +69,8 @@ class WXLCDMonitor : public WXSubWindow { using inherited = WXSubWindow; public: - WXLCDMonitor(wxWindow *parent, wxWindowID id); - ~WXLCDMonitor(); + WXLCDMonitor(wxWindow *parent); + virtual ~WXLCDMonitor() override; private: WXTextScreen *monpanel {};