--- nono/wx/wxmpumonitor.cpp 2026/04/29 17:04:56 1.1.1.4 +++ nono/wx/wxmpumonitor.cpp 2026/04/29 17:05:12 1.1.1.6 @@ -4,8 +4,12 @@ // Licensed under nono-license.txt // +// +// MPU 関係のモニターウィンドウ +// + #include "wxmpumonitor.h" -#include "wxtextscreen.h" +#include "fontmanager.h" #include "m88200.h" // @@ -17,8 +21,8 @@ WXCacheWindow::WXCacheWindow(wxWindow *p Monitor& monitor_) : inherited(parent, name, monitor_) { - // テキストスクリーンパネルに送られるマウスイベントをこちらで処理する - screen->Connect(wxEVT_LEFT_DOWN, + // モニタパネルに送られるマウスイベントをこちらで処理する + monpanel->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(WXCacheWindow::OnLeftDown), NULL, this); } @@ -33,10 +37,10 @@ WXCacheWindow::OnLeftDown(wxMouseEvent& { const wxPoint& pos = event.GetPosition(); - // テキストの桁数、行数 - const wxSize& font = screen->GetFontSize(); - int x = pos.x / font.GetWidth(); - int y = pos.y / font.GetHeight(); + // テキストの桁数、行数にする + wxPoint tpos = monpanel->GetTextPosition(pos); + int x = tpos.x; + int y = tpos.y; // クリックされた場所のセット番号に更新 x -= 3; @@ -46,12 +50,12 @@ WXCacheWindow::OnLeftDown(wxMouseEvent& if (x % 5 < 4) { // このモニタは userdata を現在のセット番号として使っている int setidx = y * 16 + (x / 5); - screen->SetUserData(setidx); + monpanel->SetUserData(setidx); } } // 画面更新 - screen->DoRefresh(); + monpanel->DoRefresh(); event.Skip(); }