mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-14 17:09:36 +00:00
Stop using wxDialog::EndModal() from inside dialogs.
Calling wxDialog::EndModal() directly from inside the dialog is a potential bug if the dialog is shown in the modeless or window modal (quasi-modal). Use the internal button events where possible and check for the appropriate mode before calling the correct end dialog function.
This commit is contained in:
parent
0fb864d596
commit
1a301d8eea
common
dialogs
dialog_display_info_HTML_base.cppdialog_display_info_HTML_base.fbpdialog_display_info_HTML_base.hdialog_locked_items_query.cppdialog_locked_items_query_base.cppdialog_locked_items_query_base.fbpdialog_locked_items_query_base.hdialog_print_generic.cppdialog_print_generic_base.cppdialog_print_generic_base.fbpdialog_print_generic_base.heda_list_dialog.cppeda_view_switcher.cpphtml_messagebox.cpp
widgets
demos/simulation/sallen_key
eeschema
dialogs
dialog_bus_manager.cppdialog_bus_manager.hdialog_choose_symbol.cppdialog_lib_edit_pin_table.cppdialog_netlist.cppdialog_netlist_base.cppdialog_netlist_base.fbpdialog_netlist_base.hdialog_update_symbol_fields.cpp
sim
gerbview/dialogs
dialog_layers_select_to_pcb.cppdialog_layers_select_to_pcb.hdialog_layers_select_to_pcb_base.cppdialog_layers_select_to_pcb_base.fbpdialog_layers_select_to_pcb_base.hdialog_select_one_pcb_layer.cpp
include/dialogs
pcb_calculator
dialogs
dialog_regulator_form.cppdialog_regulator_form.hdialog_regulator_form_base.cppdialog_regulator_form_base.fbpdialog_regulator_form_base.h
regulators_funct.cpppcbnew
dialogs
dialog_filter_selection.cppdialog_filter_selection.hdialog_filter_selection_base.cppdialog_filter_selection_base.fbpdialog_filter_selection_base.hdialog_find.cppdialog_find.hdialog_find_base.cppdialog_find_base.fbpdialog_find_base.hdialog_footprint_wizard_list.cppdialog_global_deletion.cppdialog_global_deletion.hdialog_global_deletion_base.cppdialog_global_deletion_base.fbpdialog_global_deletion_base.hdialog_push_pad_properties.cpp
microwave
sel_layer.cpp@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version v3.8.0)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -35,13 +35,11 @@ DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent,
|
||||
|
||||
// Connect Events
|
||||
m_htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
|
||||
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_htmlWindow->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_display_info_HTML_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_display_info_HTML</property>
|
||||
@ -25,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@ -133,7 +135,6 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer1</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnOKButtonClick">OnOKButtonClick</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version v3.8.0)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -37,7 +37,6 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -24,6 +24,7 @@
|
||||
#include <dialogs/dialog_locked_items_query.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
|
||||
DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLockedItemCount ) :
|
||||
DIALOG_LOCKED_ITEMS_QUERY_BASE( aParent )
|
||||
{
|
||||
@ -46,19 +47,8 @@ DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLo
|
||||
|
||||
void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_APPLY );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LOCKED_ITEMS_QUERY::onOkClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LOCKED_ITEMS_QUERY::onCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
// This will choose the correct way to end the dialog no matter how is was shown.
|
||||
EndDialog( wxID_APPLY );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -55,7 +55,7 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent
|
||||
m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_overrideBtn->SetToolTip( _("Override locks and apply the operation on all the items selected.\nAny locked items will remain locked after the operation is complete.") );
|
||||
|
||||
bButtonSizer->Add( m_overrideBtn, 0, wxALL, 10 );
|
||||
bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
@ -64,10 +64,10 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bButtonSizer->Add( m_sdbSizer, 1, wxALL, 5 );
|
||||
bButtonSizer->Add( m_sdbSizer, 1, wxBOTTOM|wxTOP, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bButtonSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
bSizerMain->Add( bButtonSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
@ -77,8 +77,6 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
|
||||
m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
|
||||
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE()
|
||||
@ -86,7 +84,5 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE()
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
|
||||
m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
|
||||
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_locked_items_query_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_locked_items_query</property>
|
||||
@ -25,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@ -344,7 +346,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
@ -353,7 +355,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -364,6 +366,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@ -426,7 +429,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxBOTTOM|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<property name="Apply">0</property>
|
||||
@ -440,8 +443,6 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnCancelButtonClick">onCancelClick</event>
|
||||
<event name="OnOKButtonClick">onOkClick</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -49,8 +49,6 @@ class DIALOG_LOCKED_ITEMS_QUERY_BASE : public DIALOG_SHIM
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
|
||||
virtual void onOverrideLocks( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2018 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
@ -127,6 +127,7 @@ double DIALOG_PRINT_GENERIC::getScaleValue()
|
||||
wxString::Format( _( "Warning: Scale option set to a very small value.\n"
|
||||
" Clamped to %f" ), scale ) );
|
||||
}
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
@ -268,17 +269,11 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PRINT_GENERIC::onCloseButton( wxCommandEvent& event )
|
||||
void DIALOG_PRINT_GENERIC::onCancelButtonClick( wxCommandEvent& event )
|
||||
{
|
||||
saveSettings();
|
||||
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
|
||||
if( IsModal() )
|
||||
EndModal( wxID_CANCEL );
|
||||
|
||||
Close();
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -118,6 +118,7 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
bMainSizer->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
@ -126,7 +127,7 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
||||
m_scaleCustomText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onSetCustomScale ), NULL, this );
|
||||
m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPageSetup ), NULL, this );
|
||||
m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintPreview ), NULL, this );
|
||||
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCloseButton ), NULL, this );
|
||||
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCancelButtonClick ), NULL, this );
|
||||
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintButtonClick ), NULL, this );
|
||||
}
|
||||
|
||||
@ -137,7 +138,7 @@ DIALOG_PRINT_GENERIC_BASE::~DIALOG_PRINT_GENERIC_BASE()
|
||||
m_scaleCustomText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onSetCustomScale ), NULL, this );
|
||||
m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPageSetup ), NULL, this );
|
||||
m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintPreview ), NULL, this );
|
||||
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCloseButton ), NULL, this );
|
||||
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCancelButtonClick ), NULL, this );
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintButtonClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_print_generic_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">DIALOG_PRINT_GENERIC</property>
|
||||
@ -25,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@ -45,7 +47,7 @@
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="name">DIALOG_PRINT_GENERIC_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">410,476</property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Print</property>
|
||||
@ -692,6 +694,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@ -769,7 +772,7 @@
|
||||
<property name="name">m_sdbSizer1</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick">onPrintPreview</event>
|
||||
<event name="OnCancelButtonClick">onCloseButton</event>
|
||||
<event name="OnCancelButtonClick">onCancelButtonClick</event>
|
||||
<event name="OnOKButtonClick">onPrintButtonClick</event>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -25,10 +25,10 @@
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -69,13 +69,13 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
|
||||
virtual void onSetCustomScale( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPageSetup( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPrintPreview( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onCloseButton( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPrintButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 410,476 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_PRINT_GENERIC_BASE();
|
||||
|
||||
};
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <macros.h>
|
||||
|
||||
|
||||
// wxWidgets spends *far* too long calcuating column widths (most of it, believe it or
|
||||
// wxWidgets spends *far* too long calculating column widths (most of it, believe it or
|
||||
// not, in repeatedly creating/destroying a wxDC to do the measurement in).
|
||||
// Use default column widths instead.
|
||||
static int DEFAULT_SINGLE_COL_WIDTH = 260;
|
||||
@ -215,11 +215,12 @@ void EDA_LIST_DIALOG::InsertItems( const std::vector< wxArrayString >& itemList,
|
||||
|
||||
void EDA_LIST_DIALOG::onListItemActivated( wxListEvent& event )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
|
||||
|
||||
/* Sort alphabetically, case insensitive.
|
||||
/*
|
||||
* Sort alphabetically, case insensitive.
|
||||
*/
|
||||
static int wxCALLBACK myCompareFunction( wxIntPtr aItem1, wxIntPtr aItem2,
|
||||
wxIntPtr WXUNUSED( aSortData ) )
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -131,7 +131,7 @@ bool EDA_VIEW_SWITCHER::TryBefore( wxEvent& aEvent )
|
||||
// Check for control key trailing edge
|
||||
if( !wxGetKeyState( WXK_RAW_CONTROL ) )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
|
||||
return DIALOG_SHIM::TryBefore( aEvent );
|
||||
|
@ -53,19 +53,6 @@ HTML_MESSAGE_BOX::~HTML_MESSAGE_BOX()
|
||||
}
|
||||
|
||||
|
||||
void HTML_MESSAGE_BOX::OnOKButtonClick( wxCommandEvent& event )
|
||||
{
|
||||
// the dialog can be shown quasi-model, modal, or not modeless.
|
||||
// therefore, use the right way to close it.
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_OK );
|
||||
else if( IsModal() )
|
||||
EndModal( wxID_OK );
|
||||
else
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
void HTML_MESSAGE_BOX::ListClear()
|
||||
{
|
||||
m_htmlWindow->SetPage( wxEmptyString );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Chris Pavlina <pavlina.chris@gmail.com>
|
||||
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -69,8 +69,6 @@ public:
|
||||
*/
|
||||
class HK_PROMPT_DIALOG : public DIALOG_SHIM
|
||||
{
|
||||
wxKeyEvent m_event;
|
||||
|
||||
public:
|
||||
HK_PROMPT_DIALOG( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
|
||||
const wxString& aName, const wxString& aCurrentKey ) :
|
||||
@ -136,17 +134,6 @@ public:
|
||||
SetInitialFocus( panel );
|
||||
}
|
||||
|
||||
/**
|
||||
* End the dialog whether modal or quasimodal
|
||||
*/
|
||||
void EndFlexible( int aRtnCode )
|
||||
{
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( aRtnCode );
|
||||
else
|
||||
EndModal( aRtnCode );
|
||||
}
|
||||
|
||||
static wxKeyEvent PromptForKey( wxWindow* aParent, const wxString& aName,
|
||||
const wxString& aCurrentKey )
|
||||
{
|
||||
@ -203,13 +190,16 @@ protected:
|
||||
void OnChar( wxKeyEvent& aEvent )
|
||||
{
|
||||
m_event = aEvent;
|
||||
EndFlexible( wxID_OK );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
|
||||
private:
|
||||
wxKeyEvent m_event;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage logic for filtering hotkeys based on user input
|
||||
* Manage logic for filtering hotkeys based on user input.
|
||||
*/
|
||||
class HOTKEY_FILTER
|
||||
{
|
||||
|
@ -355,7 +355,7 @@
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 0
|
||||
"version": 1
|
||||
},
|
||||
"net_colors": null
|
||||
},
|
||||
|
@ -33,22 +33,17 @@
|
||||
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_BUS_MANAGER, DIALOG_SHIM )
|
||||
EVT_BUTTON( wxID_OK, DIALOG_BUS_MANAGER::OnOkClick )
|
||||
EVT_BUTTON( wxID_CANCEL, DIALOG_BUS_MANAGER::OnCancelClick )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DIALOG_BUS_MANAGER::DIALOG_BUS_MANAGER( SCH_EDIT_FRAME* aParent )
|
||||
: DIALOG_SHIM( aParent, wxID_ANY, _( "Bus Definitions" ),
|
||||
wxDefaultPosition, wxSize( 640, 480 ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
|
||||
m_parent( aParent )
|
||||
{
|
||||
auto sizer = new wxBoxSizer( wxVERTICAL );
|
||||
auto buttons = new wxStdDialogButtonSizer();
|
||||
wxButton* okButton = new wxButton( this, wxID_OK );
|
||||
|
||||
buttons->AddButton( new wxButton( this, wxID_OK ) );
|
||||
buttons->AddButton( okButton );
|
||||
buttons->AddButton( new wxButton( this, wxID_CANCEL ) );
|
||||
buttons->Realize();
|
||||
|
||||
@ -186,6 +181,7 @@ DIALOG_BUS_MANAGER::DIALOG_BUS_MANAGER( SCH_EDIT_FRAME* aParent )
|
||||
m_signal_edit->SetHint( _( "Net or Bus Name" ) );
|
||||
|
||||
finishDialogSettings();
|
||||
okButton->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
@ -235,22 +231,6 @@ bool DIALOG_BUS_MANAGER::TransferDataToWindow()
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_BUS_MANAGER::OnOkClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( TransferDataFromWindow() )
|
||||
{
|
||||
( ( SCH_EDIT_FRAME* )GetParent() )->OnModify();
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_BUS_MANAGER::OnCancelClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_BUS_MANAGER::TransferDataFromWindow()
|
||||
{
|
||||
for( SCH_SCREEN* screen : m_screens )
|
||||
@ -259,6 +239,7 @@ bool DIALOG_BUS_MANAGER::TransferDataFromWindow()
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : m_aliases )
|
||||
alias->GetParent()->AddBusAlias( alias );
|
||||
|
||||
( ( SCH_EDIT_FRAME* )GetParent() )->OnModify();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,6 @@ protected:
|
||||
void OnSelectSignal( wxListEvent& event );
|
||||
|
||||
private:
|
||||
virtual void OnOkClick( wxCommandEvent& aEvent );
|
||||
virtual void OnCancelClick( wxCommandEvent& aEvent );
|
||||
wxString getAliasDisplayText( std::shared_ptr< BUS_ALIAS > aAlias );
|
||||
|
||||
protected:
|
||||
@ -78,8 +76,6 @@ private:
|
||||
std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases;
|
||||
std::unordered_set<SCH_SCREEN*> m_screens;
|
||||
std::shared_ptr< BUS_ALIAS > m_active_alias;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
|
@ -357,12 +357,7 @@ void DIALOG_CHOOSE_SYMBOL::OnUseBrowser( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_external_browser_requested = true;
|
||||
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_OK );
|
||||
else if( IsModal() )
|
||||
EndModal( wxID_OK );
|
||||
else
|
||||
wxFAIL_MSG( "Dialog called with neither Modal nor QuasiModal" );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
|
||||
|
||||
@ -382,12 +377,7 @@ void DIALOG_CHOOSE_SYMBOL::OnCloseTimer( wxTimerEvent& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_OK );
|
||||
else if( IsModal() )
|
||||
EndModal( wxID_OK );
|
||||
else
|
||||
wxFAIL_MSG( "Dialog called with neither Modal nor QuasiModal" );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -766,7 +766,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( retval );
|
||||
else
|
||||
EndModal( retval );
|
||||
EndDialog( retval );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -781,7 +781,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( retval );
|
||||
else
|
||||
EndModal( retval );
|
||||
EndDialog( retval );
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -181,12 +181,9 @@ public:
|
||||
const wxString GetGeneratorTitle() { return m_textCtrlName->GetValue(); }
|
||||
const wxString GetGeneratorTCommandLine() { return m_textCtrlCommand->GetValue(); }
|
||||
|
||||
private:
|
||||
/**
|
||||
* Validate info relative to a new netlist plugin
|
||||
*/
|
||||
void OnOKClick( wxCommandEvent& event ) override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
private:
|
||||
/*
|
||||
* Browse plugin files, and set m_CommandStringCtrl field
|
||||
*/
|
||||
@ -210,7 +207,6 @@ BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
||||
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
|
||||
NETLIST_TYPE_ID id_NetType ) :
|
||||
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
|
||||
@ -243,7 +239,6 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& ti
|
||||
}
|
||||
|
||||
|
||||
|
||||
NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
|
||||
NETLIST_DIALOG_BASE( parent )
|
||||
{
|
||||
@ -483,9 +478,9 @@ bool NETLIST_DIALOG::TransferDataFromWindow()
|
||||
fileExt = extRE.GetMatch( command, 1 );
|
||||
|
||||
title.Printf( _( "%s Export" ), currPage->m_TitleStringCtrl->GetValue().GetData() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fn.SetExt( fileExt );
|
||||
|
||||
@ -603,7 +598,11 @@ void NETLIST_DIALOG::OnDelGenerator( wxCommandEvent& event )
|
||||
m_DefaultNetFmtName = m_PanelNetType[PANELPCBNEW]->GetPageNetFmtName();
|
||||
|
||||
WriteCurrentNetlistSetup();
|
||||
EndModal( NET_PLUGIN_CHANGE );
|
||||
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( NET_PLUGIN_CHANGE );
|
||||
else
|
||||
EndDialog( NET_PLUGIN_CHANGE );
|
||||
}
|
||||
|
||||
|
||||
@ -641,8 +640,10 @@ void NETLIST_DIALOG::OnAddGenerator( wxCommandEvent& event )
|
||||
m_PanelNetType[netTypeId] = currPage;
|
||||
WriteCurrentNetlistSetup();
|
||||
|
||||
// Close and reopen dialog to rebuild the dialog after changes
|
||||
EndModal( NET_PLUGIN_CHANGE );
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( NET_PLUGIN_CHANGE );
|
||||
else
|
||||
EndDialog( NET_PLUGIN_CHANGE );
|
||||
}
|
||||
|
||||
|
||||
@ -655,21 +656,24 @@ NETLIST_DIALOG_ADD_GENERATOR::NETLIST_DIALOG_ADD_GENERATOR( NETLIST_DIALOG* pare
|
||||
}
|
||||
|
||||
|
||||
void NETLIST_DIALOG_ADD_GENERATOR::OnOKClick( wxCommandEvent& event )
|
||||
bool NETLIST_DIALOG_ADD_GENERATOR::TransferDataFromWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
if( m_textCtrlCommand->GetValue() == wxEmptyString )
|
||||
{
|
||||
wxMessageBox( _( "Error. You must provide a command String" ) );
|
||||
return;
|
||||
wxMessageBox( _( "You must provide a netlist generator command string" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_textCtrlName->GetValue() == wxEmptyString )
|
||||
{
|
||||
wxMessageBox( _( "Error. You must provide a Title" ) );
|
||||
return;
|
||||
wxMessageBox( _( "You must provide a netlist generator title" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
EndModal( wxID_OK );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -694,14 +698,14 @@ void NETLIST_DIALOG_ADD_GENERATOR::OnBrowseGenerators( wxCommandEvent& event )
|
||||
wxFileName fn( FullFileName );
|
||||
wxString ext = fn.GetExt();
|
||||
|
||||
if( ext == wxT("xsl" ) )
|
||||
cmdLine.Printf(wxT("xsltproc -o \"%%O\" \"%s\" \"%%I\""), FullFileName );
|
||||
else if( ext == wxT("exe" ) || ext.IsEmpty() )
|
||||
cmdLine.Printf(wxT("\"%s\" > \"%%O\" < \"%%I\""), FullFileName );
|
||||
else if( ext == wxT("py" ) || ext.IsEmpty() )
|
||||
cmdLine.Printf(wxT("python \"%s\" \"%%I\" \"%%O\""), FullFileName );
|
||||
if( ext == wxT( "xsl" ) )
|
||||
cmdLine.Printf( wxT( "xsltproc -o \"%%O\" \"%s\" \"%%I\"" ), FullFileName );
|
||||
else if( ext == wxT( "exe" ) || ext.IsEmpty() )
|
||||
cmdLine.Printf( wxT( "\"%s\" > \"%%O\" < \"%%I\"" ), FullFileName );
|
||||
else if( ext == wxT( "py" ) || ext.IsEmpty() )
|
||||
cmdLine.Printf( wxT( "python \"%s\" \"%%I\" \"%%O\"" ), FullFileName );
|
||||
else
|
||||
cmdLine.Printf(wxT("\"%s\""), FullFileName );
|
||||
cmdLine.Printf( wxT( "\"%s\"" ), FullFileName );
|
||||
|
||||
m_textCtrlCommand->SetValue( cmdLine );
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 18 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -18,47 +18,47 @@ END_EVENT_TABLE()
|
||||
NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bUpperSizer;
|
||||
bUpperSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_NoteBook = new wxNotebook( this, ID_CHANGE_NOTEBOOK_PAGE, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NoteBook->SetMinSize( wxSize( 540,-1 ) );
|
||||
|
||||
|
||||
|
||||
|
||||
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_buttonAddGenerator = new wxButton( this, ID_ADD_PLUGIN, _("Add Generator..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonSizer->Add( m_buttonAddGenerator, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_buttonDelGenerator = new wxButton( this, ID_DEL_PLUGIN, _("Remove Generator"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonSizer->Add( m_buttonDelGenerator, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_sdbSizer2 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer2OK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer2->AddButton( m_sdbSizer2OK );
|
||||
m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer2->AddButton( m_sdbSizer2Cancel );
|
||||
m_sdbSizer2->Realize();
|
||||
|
||||
|
||||
m_buttonSizer->Add( m_sdbSizer2, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bMainSizer->Add( m_buttonSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
bMainSizer->Fit( this );
|
||||
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
}
|
||||
|
||||
@ -68,62 +68,60 @@ NETLIST_DIALOG_BASE::~NETLIST_DIALOG_BASE()
|
||||
|
||||
BEGIN_EVENT_TABLE( NETLIST_DIALOG_ADD_GENERATOR_BASE, DIALOG_SHIM )
|
||||
EVT_BUTTON( wxID_BROWSE_PLUGINS, NETLIST_DIALOG_ADD_GENERATOR_BASE::_wxFB_OnBrowseGenerators )
|
||||
EVT_BUTTON( wxID_CANCEL, NETLIST_DIALOG_ADD_GENERATOR_BASE::_wxFB_OnCancelClick )
|
||||
EVT_BUTTON( wxID_OK, NETLIST_DIALOG_ADD_GENERATOR_BASE::_wxFB_OnOKClick )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
NETLIST_DIALOG_ADD_GENERATOR_BASE::NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerTop;
|
||||
bSizerTop = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_staticTextName = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextName->Wrap( -1 );
|
||||
bSizerTop->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerTop->Add( m_textCtrlName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_staticTextCmd = new wxStaticText( this, wxID_ANY, _("Command line to run the generator:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextCmd->Wrap( -1 );
|
||||
bSizerTop->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlCommand->SetMinSize( wxSize( 500,-1 ) );
|
||||
|
||||
|
||||
bSizerTop->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerTop, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerBottom;
|
||||
bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_buttonGenerator = new wxButton( this, wxID_BROWSE_PLUGINS, _("Browse Generators..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerBottom->Add( m_buttonGenerator, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
|
||||
bSizerBottom->Add( m_sdbSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Jun 18 2020)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_NETLIST_BASE_H__
|
||||
#define __DIALOG_NETLIST_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@ -20,6 +19,9 @@
|
||||
#include <wx/string.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
@ -33,13 +35,13 @@ class NETLIST_DIALOG_BASE : public DIALOG_SHIM
|
||||
{
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
|
||||
|
||||
// Private event handlers
|
||||
void _wxFB_OnNetlistTypeSelection( wxNotebookEvent& event ){ OnNetlistTypeSelection( event ); }
|
||||
void _wxFB_OnAddGenerator( wxCommandEvent& event ){ OnAddGenerator( event ); }
|
||||
void _wxFB_OnDelGenerator( wxCommandEvent& event ){ OnDelGenerator( event ); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
@ -47,7 +49,7 @@ class NETLIST_DIALOG_BASE : public DIALOG_SHIM
|
||||
ID_ADD_PLUGIN,
|
||||
ID_DEL_PLUGIN
|
||||
};
|
||||
|
||||
|
||||
wxNotebook* m_NoteBook;
|
||||
wxBoxSizer* m_buttonSizer;
|
||||
wxButton* m_buttonAddGenerator;
|
||||
@ -55,18 +57,18 @@ class NETLIST_DIALOG_BASE : public DIALOG_SHIM
|
||||
wxStdDialogButtonSizer* m_sdbSizer2;
|
||||
wxButton* m_sdbSizer2OK;
|
||||
wxButton* m_sdbSizer2Cancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnNetlistTypeSelection( wxNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddGenerator( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnDelGenerator( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export Netlist"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export Netlist"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~NETLIST_DIALOG_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -76,19 +78,17 @@ class NETLIST_DIALOG_ADD_GENERATOR_BASE : public DIALOG_SHIM
|
||||
{
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
|
||||
|
||||
// Private event handlers
|
||||
void _wxFB_OnBrowseGenerators( wxCommandEvent& event ){ OnBrowseGenerators( event ); }
|
||||
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
|
||||
void _wxFB_OnOKClick( wxCommandEvent& event ){ OnOKClick( event ); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
wxID_BROWSE_PLUGINS = 1000
|
||||
};
|
||||
|
||||
|
||||
wxStaticText* m_staticTextName;
|
||||
wxTextCtrl* m_textCtrlName;
|
||||
wxStaticText* m_staticTextCmd;
|
||||
@ -97,18 +97,15 @@ class NETLIST_DIALOG_ADD_GENERATOR_BASE : public DIALOG_SHIM
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnBrowseGenerators( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Script Generator Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Script Generator Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~NETLIST_DIALOG_ADD_GENERATOR_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_NETLIST_BASE_H__
|
||||
|
@ -217,7 +217,7 @@ void DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked( wxCommandEvent& aEvent )
|
||||
|
||||
m_editFrame->RebuildView();
|
||||
m_editFrame->OnModify();
|
||||
EndModal( wxID_OK );
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user