From 707b0beceea72a68a415ff74b821e519dfc905e6 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 1 Jun 2023 16:25:52 +0200 Subject: [PATCH] bitmap2component: fix incorrect min size of the main frame. It was due to the fact the sizers were set without menubar, created later. A dummy menubar is now added at frame creation, to allow sizers to be correctly initialized. Fixes #14859 https://gitlab.com/kicad/code/kicad/-/issues/14859 --- bitmap2component/bitmap2cmp_gui_base.cpp | 6 +++++ bitmap2component/bitmap2cmp_gui_base.fbp | 28 ++++++++++++++++++++++++ bitmap2component/bitmap2cmp_gui_base.h | 7 ++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/bitmap2component/bitmap2cmp_gui_base.cpp b/bitmap2component/bitmap2cmp_gui_base.cpp index 351fa5a8a0..19d66be8a1 100644 --- a/bitmap2component/bitmap2cmp_gui_base.cpp +++ b/bitmap2component/bitmap2cmp_gui_base.cpp @@ -13,6 +13,12 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + m_menubar = new wxMenuBar( 0 ); + m_menu1 = new wxMenu(); + m_menubar->Append( m_menu1, _("dummy") ); + + this->SetMenuBar( m_menubar ); + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxHORIZONTAL ); diff --git a/bitmap2component/bitmap2cmp_gui_base.fbp b/bitmap2component/bitmap2cmp_gui_base.fbp index 244d7ddfb3..fd9d93e6e0 100644 --- a/bitmap2component/bitmap2cmp_gui_base.fbp +++ b/bitmap2component/bitmap2cmp_gui_base.fbp @@ -58,6 +58,34 @@ wxTAB_TRAVERSAL 1 + + + + 1 + 0 + 1 + + + 0 + wxID_ANY + + + m_menubar + protected + + + + ; ; forward_declare + + + + + + dummy + m_menu1 + protected + + bMainSizer diff --git a/bitmap2component/bitmap2cmp_gui_base.h b/bitmap2component/bitmap2cmp_gui_base.h index 6baa4f89ac..fdfbc00979 100644 --- a/bitmap2component/bitmap2cmp_gui_base.h +++ b/bitmap2component/bitmap2cmp_gui_base.h @@ -11,12 +11,13 @@ #include #include #include "kiway_player.h" -#include +#include +#include #include #include #include #include -#include +#include #include #include #include @@ -45,6 +46,8 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER private: protected: + wxMenuBar* m_menubar; + wxMenu* m_menu1; wxNotebook* m_Notebook; wxScrolledWindow* m_InitialPicturePanel; wxScrolledWindow* m_GreyscalePicturePanel;