KiCad PCB EDA Suite
panel_hotkeys_editor.cpp File Reference
#include <advanced_config.h>
#include <gestfich.h>
#include <hotkeys_basic.h>
#include <kiway_player.h>
#include <locale_io.h>
#include <panel_hotkeys_editor.h>
#include <wildcards_and_files_ext.h>
#include <tool/tool_manager.h>
#include <widgets/button_row_panel.h>
#include <widgets/ui_common.h>
#include <wx/filedlg.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/srchctrl.h>
#include <wx/tokenzr.h>
#include <wx/txtstrm.h>
#include <wx/wfstream.h>

Go to the source code of this file.

Functions

static wxSearchCtrl * CreateTextFilterBox (wxWindow *aParent, const wxString &aDescriptiveText)
 Helper function to add a filter box to a panel, with some sensible defaults for that purpose. More...
 

Variables

static const wxSize default_dialog_size { 500, 350 }
 

Function Documentation

◆ CreateTextFilterBox()

static wxSearchCtrl* CreateTextFilterBox ( wxWindow *  aParent,
const wxString &  aDescriptiveText 
)
static

Helper function to add a filter box to a panel, with some sensible defaults for that purpose.

Parameters
aParentThe parent widget/panel
aDescriptiveTextThe text to show when the box is empty.
Returns
A newly constructed filter box - the caller owns it

Definition at line 52 of file panel_hotkeys_editor.cpp.

53 {
54  wxSearchCtrl* search_widget = new wxSearchCtrl( aParent, wxID_ANY );
55 
56  search_widget->ShowSearchButton( false );
57  search_widget->ShowCancelButton( true );
58 
59  search_widget->SetDescriptiveText( aDescriptiveText );
60 
61 #ifdef __WXGTK__
62  // wxSearchCtrl vertical height is not calculated correctly on some GTK setups
63  // See https://gitlab.com/kicad/code/kicad/-/issues/9019
64  search_widget->SetMinSize( wxSize( -1, aParent->GetTextExtent( wxT( "qb" ) ).y + 10 ) );
65 #endif
66 
67  return search_widget;
68 }

Referenced by PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR().

Variable Documentation

◆ default_dialog_size

const wxSize default_dialog_size { 500, 350 }
static

Definition at line 42 of file panel_hotkeys_editor.cpp.