--- nono/wx/wxpalettemonitor.cpp 2026/04/29 17:05:16 1.1 +++ nono/wx/wxpalettemonitor.cpp 2026/04/29 17:05:44 1.1.1.4 @@ -13,6 +13,7 @@ #include "wxtextscreen.h" #include "wxuimessage.h" #include "bt45x.h" +#include "mainapp.h" #include "videoctlr.h" // @@ -50,6 +51,8 @@ wxEND_EVENT_TABLE() WXPalettePanel::WXPalettePanel(wxWindow *parent) : inherited(parent) { + SetName("PalettePanel"); + // デバイスを取得 bt45x = gMainApp.FindObject(OBJ_BT45x); videoctlr = gMainApp.FindObject(OBJ_VIDEOCTLR); @@ -58,7 +61,7 @@ WXPalettePanel::WXPalettePanel(wxWindow // パレットは1行に16個で、行数 (1 or 16) が可変。 // ここではサイズだけ確定させる。 - const std::vector *hpal; + const std::vector *hpal; if (videoctlr) { hpal = &videoctlr->GetHostPalette(); } else { @@ -103,8 +106,11 @@ WXPalettePanel::FontChanged() size.y += rows * font_height; // パレット部 size.y += WXTextScreen::DefaultPadding; // 下余白 - SetClientSize(size); - SetMinClientSize(size); + // バックバッファのサイズを固定。 + SetMinBitmapSize(size); + + SetSize(size); + SetMinSize(size); } // VM からのパレット変更通知 @@ -196,7 +202,7 @@ WXPalettePanel::Draw() int cc = y * 16 + x; rect.x = pal0x + x * font_height; rect.y = pal0y + y * font_height; - bitmap.FillRect(pal[cc].ToColor(), rect); + bitmap.FillRect(pal[cc], rect); } } } @@ -245,7 +251,7 @@ WXPaletteWindow::WXPaletteWindow(wxWindo : inherited(parent, wxID_ANY, name) { new WXPalettePanel(this); - DoSize(); + Fit(); } // デストラクタ