--- nono/wx/wxlogmonitor.cpp 2026/04/29 17:05:08 1.1.1.9 +++ nono/wx/wxlogmonitor.cpp 2026/04/29 17:05:31 1.1.1.12 @@ -11,6 +11,7 @@ #include "wxlogmonitor.h" #include "logger.h" #include "mainapp.h" +#include "monitor.h" #include "sjis.h" // イベントテーブル @@ -20,15 +21,15 @@ wxEND_EVENT_TABLE() // コンストラクタ WXLogMonitor::WXLogMonitor(wxWindow *parent) - : inherited(parent, wxID_ANY, _("Log")) + : inherited(parent, wxID_ANY, _("Log"), DEFAULT_STYLE | wxRESIZE_BORDER) { col = 80; row = 40; - monitor.obj = &log; - monitor.func = ToMonitorCallback(&LogMonitor::MonitorUpdate); - monitor.SetSize(col, row); - // プライベート利用なので Regist() は不要 + // プライベート利用なので Regist() しない。 + monitor.reset(new Monitor(-1, &log)); + monitor->func = ToMonitorCallback(&LogMonitor::MonitorUpdate); + monitor->SetSize(col, row); log.Init(this); @@ -40,7 +41,7 @@ WXLogMonitor::WXLogMonitor(wxWindow *par wxBoxSizer *topsizer = new wxBoxSizer(wxHORIZONTAL); // テキストスクリーン - screen = new WXTextScreen(this, monitor); + screen = new WXMonitorPanel(this, monitor.get()); topsizer->Add(screen, 1, wxEXPAND); // スクロールバー @@ -72,6 +73,13 @@ WXLogMonitor::~WXLogMonitor() { } +bool +WXLogMonitor::Layout() +{ + // 縦リサイズ可能レイアウト + return LayoutTextVResize(screen); +} + // サイズ変更イベント void WXLogMonitor::OnSize(wxSizeEvent& event) @@ -168,7 +176,7 @@ WXLogMonitor::DoScroll(int pos) // コンストラクタ LogMonitor::LogMonitor() - : inherited("LogMonitor") + : inherited(OBJ_LOGMONITOR) { } @@ -232,7 +240,9 @@ LogMonitor::MonitorUpdate(Monitor *, Tex // 画面コピー logbuf.Locate(0, srcY); for (int i = 0; i < parent->col * parent->row; i++) { - screen.Putc(logbuf.Getc()); + uint16 ch = logbuf.Getc(); + logbuf.Ascend(); + screen.Putc(ch); } }