--- nono/wx/wxlogsetting.h 2026/04/29 17:05:08 1.1 +++ nono/wx/wxlogsetting.h 2026/04/29 17:05:27 1.1.1.3 @@ -13,6 +13,8 @@ #include "wxtextpanel.h" #include "wxsubwindow.h" +class WXButton; + class WXLogSettingPanel : public WXTextPanel { using inherited = WXTextPanel; @@ -20,30 +22,25 @@ class WXLogSettingPanel : public WXTextP static const int Padding = 3; public: - WXLogSettingPanel(wxWindow *parent); + explicit WXLogSettingPanel(wxWindow *parent); ~WXLogSettingPanel() override; - void FontChanged(); - void Draw(); + bool Layout() override; + void FontChanged() override; + void Draw() override; private: inline int Col2PX(int col) const; inline int Row2PY(int row) const; - inline int PX2Col(int px) const; - inline int PY2Row(int py) const; - void DrawButton(const Rect& rect, bool button_pressed); - void OnLeftDown(wxMouseEvent&); - void OnLeftUp(wxMouseEvent&); + void OnButton(wxCommandEvent&); std::vector objs {}; - int maxnamelen {}; - - // 押されているボタン - int pressed {}; + // ボタン + std::vector buttons {}; - wxDECLARE_EVENT_TABLE(); + int maxnamelen {}; }; class WXLogSettingWindow : public WXSubWindow @@ -51,7 +48,7 @@ class WXLogSettingWindow : public WXSubW using inherited = WXSubWindow; public: - WXLogSettingWindow(wxWindow *); + explicit WXLogSettingWindow(wxWindow *); ~WXLogSettingWindow() override; private: