--- nono/wx/wxsoftkey.h 2026/04/29 17:05:08 1.1.1.11 +++ nono/wx/wxsoftkey.h 2026/04/29 17:05:48 1.1.1.16 @@ -13,11 +13,13 @@ #include "wxsubwindow.h" #include "wxtextpanel.h" #include "keyboard.h" -#include "vm.h" +#include "mainapp.h" #include #include #include +class Keyboard; + // キー描画用のデータ構造体 struct keydata_t { @@ -72,7 +74,7 @@ class WXSoftKeyPanel : public WXTextPane WXSoftKeyPanel(wxWindow *parent, const std::vector& keydata_, int u_width_, int u_height_); public: - virtual ~WXSoftKeyPanel() override; + ~WXSoftKeyPanel() override; // フォントサイズ変更 void FontChanged() override; @@ -81,13 +83,19 @@ class WXSoftKeyPanel : public WXTextPane void UpdateTitle(); void InitColorKeytop(int num); + void InitIcon(); + + // LUNA-I、LUNA-88K の共通初期化 + void InitLunaCommon(); + void OnKeyChanged(wxCommandEvent& event); void OnTimer(wxTimerEvent& event); void Draw() override; void DrawKey(const keydata_t& key); + void DrawKeyBox(const keydata_t&, Color bg, Color bd); void DrawEnterKey(); - void DrawEnterMark(int x, int y); + void DrawBuzzer(const keydata_t& key); virtual int DrawLED(const keydata_t& key) = 0; const keydata_t& FindKeydata(uint) const; @@ -129,6 +137,9 @@ class WXSoftKeyPanel : public WXTextPane Rect enter_top {}; Rect enter_btm {}; + // アイコン + std::unique_ptr enter_icon /*{}*/; + // 色 ColorPalette color {}; @@ -152,17 +163,34 @@ class WXSoftKeyPanel : public WXTextPane // キー描画データ (派生クラス側から渡される) const std::vector& keydata; + Keyboard *keyboard {}; + // イベントテーブル wxDECLARE_EVENT_TABLE(); }; -// LUNA ソフトウェアキーボード (パネル) -class WXLunaSoftKeyPanel : public WXSoftKeyPanel +// LUNA-I ソフトウェアキーボード (パネル) +class WXLuna1SoftKeyPanel : public WXSoftKeyPanel +{ + using inherited = WXSoftKeyPanel; + public: + explicit WXLuna1SoftKeyPanel(wxWindow *parent); + ~WXLuna1SoftKeyPanel() override; + + private: + int DrawLED(const keydata_t& key) override; + + // キー描画データ + static std::vector keydata; +}; + +// LUNA-88K ソフトウェアキーボード (パネル) +class WXLuna88kSoftKeyPanel : public WXSoftKeyPanel { using inherited = WXSoftKeyPanel; public: - WXLunaSoftKeyPanel(wxWindow *parent); - virtual ~WXLunaSoftKeyPanel() override; + explicit WXLuna88kSoftKeyPanel(wxWindow *parent); + ~WXLuna88kSoftKeyPanel() override; private: int DrawLED(const keydata_t& key) override; @@ -176,8 +204,8 @@ class WXX68kSoftKeyPanel : public WXSoft { using inherited = WXSoftKeyPanel; public: - WXX68kSoftKeyPanel(wxWindow *parent); - virtual ~WXX68kSoftKeyPanel() override; + explicit WXX68kSoftKeyPanel(wxWindow *parent); + ~WXX68kSoftKeyPanel() override; private: int DrawLED(const keydata_t& key) override; @@ -191,10 +219,6 @@ class WXSoftKeyWindow : public WXSubWind { using inherited = WXSubWindow; public: - WXSoftKeyWindow(wxWindow *parent, vmtype_t vmtype); - virtual ~WXSoftKeyWindow() override; - - private: - // キーボードパネル - WXSoftKeyPanel *panel {}; + WXSoftKeyWindow(wxWindow *parent, VMType vmtype); + ~WXSoftKeyWindow() override; };