--- nono/wx/wxsubwindow.h 2026/04/29 17:04:37 1.1.1.2 +++ nono/wx/wxsubwindow.h 2026/04/29 17:05:12 1.1.1.10 @@ -4,17 +4,21 @@ // Licensed under nono-license.txt // +// +// サブウィンドウ +// + #pragma once -#include "wxheader.h" +#include "wxnono.h" + +class WXTextScreen; -// // サブウィンドウ // // メインウィンドウのメニューから表示されて、表示されてる間チェック状態を // 維持するタイプのウィンドウ。クローズ処理が共通に必要なだけで、中身に // ついては関与していない。 - class WXSubWindow : public wxFrame { using inherited = wxFrame; @@ -24,20 +28,22 @@ class WXSubWindow : public wxFrame & ~wxMAXIMIZE_BOX & ~wxRESIZE_BORDER; - // テキスト系サブウィンドウの共通ボーダー。 - // テキスト系サブウィンドウは四辺に余白を少し入れる。 - // 余白がまったくないと、ボーダーを持たないウィンドウマネージャで - // 端の文字が読みにくくなってしまうため。 - static wxSizerFlags BorderFlags; - public: WXSubWindow(wxWindow *parent, wxWindowID id, const wxString& name, int style); - WXSubWindow(wxWindow *parent, wxWindowID id, const wxString& name); - virtual ~WXSubWindow(); - - // フォントサイズ変更 (継承クラスによる) - virtual void SetFontSize(fontsize_t fontsize) { } + WXSubWindow(wxWindow *parent, wxWindowID id, const wxString& name) + : WXSubWindow(parent, id, name, DEFAULT_STYLE) { } + virtual ~WXSubWindow() override; + + // フォントサイズ変更 + virtual void FontChanged(); + + // ウィンドウサイズ再計算 (継承先による) + virtual void DoSize(); + + protected: + // 縦リサイズ可能なテキストパネルの場合のレイアウト + bool LayoutTextVResize(const WXTextScreen *screen, int fixed_height = 0); private: void OnClose(wxCloseEvent& event);