Add WX_TEXT_ENTRY_DIALOG which inherits from DIALOG_SHIM.
Fixes: lp:1754977 * https://bugs.launchpad.net/kicad/+bug/1754977
This commit is contained in:
parent
43899bbe0e
commit
f32f14dc8f
|
@ -163,6 +163,8 @@ set( COMMON_DLG_SRCS
|
||||||
dialogs/dialog_image_editor_base.cpp
|
dialogs/dialog_image_editor_base.cpp
|
||||||
dialogs/dialog_list_selector_base.cpp
|
dialogs/dialog_list_selector_base.cpp
|
||||||
dialogs/dialog_page_settings_base.cpp
|
dialogs/dialog_page_settings_base.cpp
|
||||||
|
dialogs/dialog_text_entry_base.cpp
|
||||||
|
dialogs/dialog_text_entry.cpp
|
||||||
dialogs/wx_html_report_panel.cpp
|
dialogs/wx_html_report_panel.cpp
|
||||||
dialogs/wx_html_report_panel_base.cpp
|
dialogs/wx_html_report_panel_base.cpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 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
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fctsys.h>
|
||||||
|
#include <common.h>
|
||||||
|
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
|
|
||||||
|
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
|
||||||
|
const wxString& aFieldLabel,
|
||||||
|
const wxString& aCaption,
|
||||||
|
const wxString& aDefaultValue ) :
|
||||||
|
WX_TEXT_ENTRY_DIALOG_BASE( aParent, wxID_ANY, aCaption, wxDefaultPosition, wxDefaultSize )
|
||||||
|
{
|
||||||
|
m_label->SetLabel( aFieldLabel );
|
||||||
|
m_textCtrl->SetValue( aDefaultValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( wxTextValidatorStyle style )
|
||||||
|
{
|
||||||
|
SetTextValidator( wxTextValidator(style) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( const wxTextValidator& validator )
|
||||||
|
{
|
||||||
|
m_textCtrl->SetValidator( validator );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString WX_TEXT_ENTRY_DIALOG::GetValue()
|
||||||
|
{
|
||||||
|
return m_textCtrl->GetValue();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 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
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A KICAD version of wxTextEntryDialog which supports the various improvments/work-arounds
|
||||||
|
* from DIALOG_SHIM.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _DIALOG_TEXT_ENTRY_H_
|
||||||
|
#define _DIALOG_TEXT_ENTRY_H_
|
||||||
|
|
||||||
|
#include <dialog_text_entry_base.h>
|
||||||
|
|
||||||
|
|
||||||
|
class wxTextValidator;
|
||||||
|
|
||||||
|
|
||||||
|
class WX_TEXT_ENTRY_DIALOG : public WX_TEXT_ENTRY_DIALOG_BASE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WX_TEXT_ENTRY_DIALOG( wxWindow* aParent, const wxString& aLabel, const wxString& aCaption,
|
||||||
|
const wxString& aDefaultValue = wxEmptyString );
|
||||||
|
|
||||||
|
void SetTextValidator( wxTextValidatorStyle style );
|
||||||
|
void SetTextValidator( const wxTextValidator& validator );
|
||||||
|
|
||||||
|
wxString GetValue();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _DIALOG_TEXT_ENTRY_H_
|
|
@ -0,0 +1,53 @@
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "dialog_text_entry_base.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
WX_TEXT_ENTRY_DIALOG_BASE::WX_TEXT_ENTRY_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* bSizerMain;
|
||||||
|
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
wxBoxSizer* bSizerContent;
|
||||||
|
bSizerContent = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_label = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_label->Wrap( -1 );
|
||||||
|
bSizerContent->Add( m_label, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_textCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_textCtrl->SetMinSize( wxSize( 300,-1 ) );
|
||||||
|
|
||||||
|
bSizerContent->Add( m_textCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bSizerMain->Add( bSizerContent, 1, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||||
|
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||||
|
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
||||||
|
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
|
||||||
|
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
|
||||||
|
m_sdbSizer1->Realize();
|
||||||
|
|
||||||
|
bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
this->SetSizer( bSizerMain );
|
||||||
|
this->Layout();
|
||||||
|
bSizerMain->Fit( this );
|
||||||
|
|
||||||
|
this->Centre( wxBOTH );
|
||||||
|
}
|
||||||
|
|
||||||
|
WX_TEXT_ENTRY_DIALOG_BASE::~WX_TEXT_ENTRY_DIALOG_BASE()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,310 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<wxFormBuilder_Project>
|
||||||
|
<FileVersion major="1" minor="13" />
|
||||||
|
<object class="Project" expanded="1">
|
||||||
|
<property name="class_decoration"></property>
|
||||||
|
<property name="code_generation">C++</property>
|
||||||
|
<property name="disconnect_events">1</property>
|
||||||
|
<property name="disconnect_mode">source_name</property>
|
||||||
|
<property name="disconnect_php_events">0</property>
|
||||||
|
<property name="disconnect_python_events">0</property>
|
||||||
|
<property name="embedded_files_path">res</property>
|
||||||
|
<property name="encoding">UTF-8</property>
|
||||||
|
<property name="event_generation">connect</property>
|
||||||
|
<property name="file">dialog_text_entry_base</property>
|
||||||
|
<property name="first_id">1000</property>
|
||||||
|
<property name="help_provider">none</property>
|
||||||
|
<property name="internationalize">1</property>
|
||||||
|
<property name="name">dialog_text_entry_base</property>
|
||||||
|
<property name="namespace"></property>
|
||||||
|
<property name="path">.</property>
|
||||||
|
<property name="precompiled_header"></property>
|
||||||
|
<property name="relative_path">1</property>
|
||||||
|
<property name="skip_lua_events">1</property>
|
||||||
|
<property name="skip_php_events">1</property>
|
||||||
|
<property name="skip_python_events">1</property>
|
||||||
|
<property name="ui_table">UI</property>
|
||||||
|
<property name="use_enum">0</property>
|
||||||
|
<property name="use_microsoft_bom">0</property>
|
||||||
|
<object class="Dialog" expanded="1">
|
||||||
|
<property name="aui_managed">0</property>
|
||||||
|
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="center">wxBOTH</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="event_handler">impl_virtual</property>
|
||||||
|
<property name="extra_style"></property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">WX_TEXT_ENTRY_DIALOG_BASE</property>
|
||||||
|
<property name="pos"></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"></property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnActivate"></event>
|
||||||
|
<event name="OnActivateApp"></event>
|
||||||
|
<event name="OnAuiFindManager"></event>
|
||||||
|
<event name="OnAuiPaneButton"></event>
|
||||||
|
<event name="OnAuiPaneClose"></event>
|
||||||
|
<event name="OnAuiPaneMaximize"></event>
|
||||||
|
<event name="OnAuiPaneRestore"></event>
|
||||||
|
<event name="OnAuiRender"></event>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnClose"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnHibernate"></event>
|
||||||
|
<event name="OnIconize"></event>
|
||||||
|
<event name="OnIdle"></event>
|
||||||
|
<event name="OnInitDialog"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
<object class="wxBoxSizer" expanded="1">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerMain</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
|
<property name="proportion">1</property>
|
||||||
|
<object class="wxBoxSizer" expanded="1">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerContent</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">MyLabel</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_label</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass">; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxTextCtrl" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="maxlength"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size">300,-1</property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_textCtrl</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass">; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="validator_data_type"></property>
|
||||||
|
<property name="validator_style">wxFILTER_NONE</property>
|
||||||
|
<property name="validator_type">wxDefaultValidator</property>
|
||||||
|
<property name="validator_variable"></property>
|
||||||
|
<property name="value"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnText"></event>
|
||||||
|
<event name="OnTextEnter"></event>
|
||||||
|
<event name="OnTextMaxLen"></event>
|
||||||
|
<event name="OnTextURL"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||||
|
<property name="Apply">0</property>
|
||||||
|
<property name="Cancel">1</property>
|
||||||
|
<property name="ContextHelp">0</property>
|
||||||
|
<property name="Help">0</property>
|
||||||
|
<property name="No">0</property>
|
||||||
|
<property name="OK">1</property>
|
||||||
|
<property name="Save">0</property>
|
||||||
|
<property name="Yes">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">m_sdbSizer1</property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<event name="OnApplyButtonClick"></event>
|
||||||
|
<event name="OnCancelButtonClick"></event>
|
||||||
|
<event name="OnContextHelpButtonClick"></event>
|
||||||
|
<event name="OnHelpButtonClick"></event>
|
||||||
|
<event name="OnNoButtonClick"></event>
|
||||||
|
<event name="OnOKButtonClick"></event>
|
||||||
|
<event name="OnSaveButtonClick"></event>
|
||||||
|
<event name="OnYesButtonClick"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</wxFormBuilder_Project>
|
|
@ -0,0 +1,50 @@
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef __DIALOG_TEXT_ENTRY_BASE_H__
|
||||||
|
#define __DIALOG_TEXT_ENTRY_BASE_H__
|
||||||
|
|
||||||
|
#include <wx/artprov.h>
|
||||||
|
#include <wx/xrc/xmlres.h>
|
||||||
|
#include <wx/intl.h>
|
||||||
|
#include "dialog_shim.h"
|
||||||
|
#include <wx/string.h>
|
||||||
|
#include <wx/stattext.h>
|
||||||
|
#include <wx/gdicmn.h>
|
||||||
|
#include <wx/font.h>
|
||||||
|
#include <wx/colour.h>
|
||||||
|
#include <wx/settings.h>
|
||||||
|
#include <wx/textctrl.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/button.h>
|
||||||
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// Class WX_TEXT_ENTRY_DIALOG_BASE
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class WX_TEXT_ENTRY_DIALOG_BASE : public DIALOG_SHIM
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxStaticText* m_label;
|
||||||
|
wxTextCtrl* m_textCtrl;
|
||||||
|
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||||
|
wxButton* m_sdbSizer1OK;
|
||||||
|
wxButton* m_sdbSizer1Cancel;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
WX_TEXT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
|
~WX_TEXT_ENTRY_DIALOG_BASE();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__DIALOG_TEXT_ENTRY_BASE_H__
|
|
@ -31,6 +31,7 @@
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <lib_edit_frame.h>
|
#include <lib_edit_frame.h>
|
||||||
|
@ -326,7 +327,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::EditAliasOfPart( wxCommandEvent& aEvent )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextEntryDialog dlg( this, _( "New Alias:" ), _( "Symbol alias:" ), aliasname );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "New Alias:" ), _( "Symbol alias:" ), aliasname );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // cancelled by user
|
return; // cancelled by user
|
||||||
|
@ -343,7 +344,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxString aliasname;
|
wxString aliasname;
|
||||||
|
|
||||||
wxTextEntryDialog dlg( this, _( "New Alias:" ), _( "Symbol alias:" ), aliasname );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "New Alias:" ), _( "Symbol alias:" ), aliasname );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // cancelled by user
|
return; // cancelled by user
|
||||||
|
@ -522,7 +523,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddFootprintFilter( wxCommandEvent& event
|
||||||
if( component == NULL )
|
if( component == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTextEntryDialog dlg( this, _( "Add Footprint Filter" ), _( "Footprint Filter" ), Line );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "Add Footprint Filter" ), _( "Footprint Filter" ), Line );
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // cancelled by user
|
return; // cancelled by user
|
||||||
|
|
||||||
|
@ -575,7 +576,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::EditOneFootprintFilter( wxCommandEvent& e
|
||||||
|
|
||||||
wxString filter = m_FootprintFilterListBox->GetStringSelection();
|
wxString filter = m_FootprintFilterListBox->GetStringSelection();
|
||||||
|
|
||||||
wxTextEntryDialog dlg( this, wxEmptyString, _( "Edit footprint filter" ), filter );
|
WX_TEXT_ENTRY_DIALOG dlg( this, wxEmptyString, _( "Edit footprint filter" ), filter );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // Aborted by user
|
return; // Aborted by user
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include <class_track.h>
|
#include <class_track.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <html_messagebox.h>
|
#include <html_messagebox.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <dialog_design_rules.h>
|
#include <dialog_design_rules.h>
|
||||||
#include <wx/generic/gridctrl.h>
|
#include <wx/generic/gridctrl.h>
|
||||||
|
@ -731,7 +732,7 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
|
||||||
|
|
||||||
// @todo set validator to ensure net class name is valid rather than all of the checks
|
// @todo set validator to ensure net class name is valid rather than all of the checks
|
||||||
// after the OK button has been selected.
|
// after the OK button has been selected.
|
||||||
wxTextEntryDialog dlg( this, _( "New Net Class Name:" ), wxEmptyString, class_name );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "New Net Class Name:" ), wxEmptyString, class_name );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // canceled by user
|
return; // canceled by user
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include <project.h>
|
#include <project.h>
|
||||||
#include <board_commit.h>
|
#include <board_commit.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <class_module.h>
|
#include <class_module.h>
|
||||||
#include <class_text_mod.h>
|
#include <class_text_mod.h>
|
||||||
|
@ -488,7 +489,7 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::Edit3DShapeFileName()
|
||||||
|
|
||||||
// Edit filename
|
// Edit filename
|
||||||
wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
|
wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
|
||||||
wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
|
WX_TEXT_ENTRY_DIALOG dlg( this, wxEmptyString, wxEmptyString, filename );
|
||||||
|
|
||||||
bool hasAlias;
|
bool hasAlias;
|
||||||
S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
|
S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
#include <pcbnew.h>
|
#include <pcbnew.h>
|
||||||
#include <kiface_i.h>
|
#include <kiface_i.h>
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
|
@ -341,7 +342,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::Edit3DShapeFileName()
|
||||||
|
|
||||||
// Edit filename
|
// Edit filename
|
||||||
wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
|
wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
|
||||||
wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "Filepath:" ), _( "Edit 3D Shape Name" ), filename );
|
||||||
|
|
||||||
bool hasAlias;
|
bool hasAlias;
|
||||||
S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
|
S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <pcb_edit_frame.h>
|
#include <pcb_edit_frame.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <footprint_edit_frame.h>
|
#include <footprint_edit_frame.h>
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
|
@ -251,7 +252,7 @@ void FOOTPRINT_EDIT_FRAME::Enter_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
wxString buffer;
|
wxString buffer;
|
||||||
|
|
||||||
buffer = StringFromValue( g_UserUnit, GetDesignSettings().m_ModuleSegmentWidth );
|
buffer = StringFromValue( g_UserUnit, GetDesignSettings().m_ModuleSegmentWidth );
|
||||||
wxTextEntryDialog dlg( this, _( "New Width:" ), _( "Edge Width" ), buffer );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "New Width:" ), _( "Edge Width" ), buffer );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // canceled by user
|
return; // canceled by user
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <fp_lib_table.h>
|
#include <fp_lib_table.h>
|
||||||
#include <validators.h>
|
#include <validators.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
#include <class_module.h>
|
#include <class_module.h>
|
||||||
|
@ -810,7 +811,7 @@ MODULE* PCB_BASE_FRAME::CreateNewModule( const wxString& aModuleName )
|
||||||
// Ask for the new module name
|
// Ask for the new module name
|
||||||
if( moduleName.IsEmpty() )
|
if( moduleName.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxTextEntryDialog dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
|
WX_TEXT_ENTRY_DIALOG dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
|
||||||
dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
|
dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
|
|
|
@ -42,7 +42,8 @@
|
||||||
#include <gr_basic.h>
|
#include <gr_basic.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <validators.h> //
|
#include <validators.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
|
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
#include <class_module.h>
|
#include <class_module.h>
|
||||||
|
@ -265,7 +266,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString value = StringFromValue( g_UserUnit, gap_size );
|
wxString value = StringFromValue( g_UserUnit, gap_size );
|
||||||
wxTextEntryDialog dlg( this, msg, _( "Create microwave module" ), value );
|
WX_TEXT_ENTRY_DIALOG dlg( this, msg, _( "Create microwave module" ), value );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
{
|
{
|
||||||
|
@ -282,7 +283,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
|
||||||
{
|
{
|
||||||
double fcoeff = 10.0, fval;
|
double fcoeff = 10.0, fval;
|
||||||
msg.Printf( wxT( "%3.1f" ), angle / fcoeff );
|
msg.Printf( wxT( "%3.1f" ), angle / fcoeff );
|
||||||
wxTextEntryDialog angledlg( this, _( "Angle in degrees:" ),
|
WX_TEXT_ENTRY_DIALOG angledlg( this, _( "Angle in degrees:" ),
|
||||||
_( "Create microwave module" ), msg );
|
_( "Create microwave module" ), msg );
|
||||||
|
|
||||||
if( angledlg.ShowModal() != wxID_OK )
|
if( angledlg.ShowModal() != wxID_OK )
|
||||||
|
@ -720,7 +721,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
|
||||||
|
|
||||||
// Entrer the desired length of the gap.
|
// Entrer the desired length of the gap.
|
||||||
msg = StringFromValue( g_UserUnit, gap_size );
|
msg = StringFromValue( g_UserUnit, gap_size );
|
||||||
wxTextEntryDialog dlg( this, _( "Gap:" ), _( "Create Microwave Gap" ), msg );
|
WX_TEXT_ENTRY_DIALOG dlg( this, _( "Gap:" ), _( "Create Microwave Gap" ), msg );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // cancelled by user
|
return; // cancelled by user
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <validators.h>
|
#include <validators.h>
|
||||||
|
#include <dialog_text_entry.h>
|
||||||
#include <pcb_edit_frame.h>
|
#include <pcb_edit_frame.h>
|
||||||
|
|
||||||
#include <class_pad.h>
|
#include <class_pad.h>
|
||||||
|
@ -306,7 +307,7 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
|
||||||
|
|
||||||
// Enter the desired length.
|
// Enter the desired length.
|
||||||
msg = StringFromValue( g_UserUnit, inductorPattern.m_length );
|
msg = StringFromValue( g_UserUnit, inductorPattern.m_length );
|
||||||
wxTextEntryDialog dlg( nullptr, wxEmptyString, _( "Length of Trace:" ), msg );
|
WX_TEXT_ENTRY_DIALOG dlg( nullptr, _( "Length of Trace:" ), wxEmptyString, msg );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return nullptr; // canceled by user
|
return nullptr; // canceled by user
|
||||||
|
@ -335,7 +336,7 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
|
||||||
|
|
||||||
// Generate footprint. the value is also used as footprint name.
|
// Generate footprint. the value is also used as footprint name.
|
||||||
msg = "L";
|
msg = "L";
|
||||||
wxTextEntryDialog cmpdlg( nullptr, wxEmptyString, _( "Component Value:" ), msg );
|
WX_TEXT_ENTRY_DIALOG cmpdlg( nullptr, _( "Component Value:" ), wxEmptyString, msg );
|
||||||
cmpdlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &msg ) );
|
cmpdlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &msg ) );
|
||||||
|
|
||||||
if( ( cmpdlg.ShowModal() != wxID_OK ) || msg.IsEmpty() )
|
if( ( cmpdlg.ShowModal() != wxID_OK ) || msg.IsEmpty() )
|
||||||
|
|
Loading…
Reference in New Issue