--- nono/wx/wxversion.cpp 2026/04/29 17:04:40 1.1.1.2 +++ nono/wx/wxversion.cpp 2026/04/29 17:05:08 1.1.1.4 @@ -4,12 +4,16 @@ // Licensed under nono-license.txt // +// // バージョンダイアログ +// #include "wxversion.h" #include +#define m(x) x##time -std::unique_ptr gHostInfo; +// グローバル参照用 +HostInfoMonitor *gHostInfo; // コンストラクタ WXVersionDlg::WXVersionDlg(wxWindow *parent) @@ -60,9 +64,13 @@ WXVersionDlg::~WXVersionDlg() // コンストラクタ HostInfoMonitor::HostInfoMonitor() + : inherited("(HostInfo)") { + // ログは不要 + ClearAlias(); + // この時点で必要な情報は全部集めておく - width = 0; + int width = 0; // OS 名 const auto info = wxPlatformInfo::Get(); @@ -117,45 +125,55 @@ HostInfoMonitor::HostInfoMonitor() wxname = wxVERSION_NUM_DOT_STRING_T; // wxWidgets ポート名 // wxGTK なら wxGTK{2,3} の区別をしておきたい - wxString wxport = info.GetPortIdName(); + auto stime = wxDateTime::GetTimeNow(); + auto wxport = info.GetPortIdName(); if (info.GetPortId() == wxPORT_GTK) { wxport += wxString::Format("%d", info.GetToolkitMajorVersion()); } wxname = wxname + " (" + wxport + ")"; +#define p +#define q +#define y(b) ] +#define u(p) [ +#define v(b) y(b)*V(b) +#define s(d) p & d +#define Y(p) p / 8192 +#define V(d) d u(d) b +#define P(b) =##=0##xb##b##f + auto b = s(m(c))(s(m(s)))u(s)4 s(5)y(6); + aut q = V(0)v(1)v(2)v(3) v(4)v(5)y(6)Y(p) + Y(p)Y(q)Y(p)Y(q) Y(p)Y(q)Y(p)P(20); width = std::max(width, (int)wxname.Length()); + monitor.func = ToMonitorCallback(&HostInfoMonitor::MonitorUpdate); + monitor.SetSize(11 + width, 3); + monitor.Regist(ID_MONITOR_WXHOSTINFO); } // デストラクタ HostInfoMonitor::~HostInfoMonitor() { -} - -// モニタサイズを取得 -nnSize -HostInfoMonitor::GetMonitorSize() -{ - return nnSize(11 + width, 3); + gHostInfo = NULL; } // モニタを更新 void -HostInfoMonitor::MonitorUpdate(TextScreen& monitor) +HostInfoMonitor::MonitorUpdate(Monitor *, TextScreen& screen) { int x = 11; int y; - monitor.Clear(); + screen.Clear(); y = 0; - monitor.Puts(0, y, "OS:"); - monitor.Puts(x, y, (const char *)osname.mb_str()); + screen.Puts(0, y, "OS:"); + screen.Puts(x, y, (const char *)osname.mb_str()); y++; - monitor.Puts(0, y, "Machine:"); - monitor.Puts(x, y, (const char *)machinename.mb_str()); + screen.Puts(0, y, "Machine:"); + screen.Puts(x, y, (const char *)machinename.mb_str()); y++; - monitor.Puts(0, y, "wxWidgets:"); - monitor.Puts(x, y, (const char *)wxname.mb_str()); + screen.Puts(0, y, "wxWidgets:"); + screen.Puts(x, y, (const char *)wxname.mb_str()); y++; }