mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 12:31:41 +00:00
Allow multi label input
This is a re-implementation of39c2745f55
that was removed bye5089d783d
This implementation works in the tool, containing side effects (hopefully) better than the initial implementation. The multiple labels are input as multiple lines instead of labels with spaces, allowing for copy/paste between spreadsheets of labels Fixes https://gitlab.com/kicad/code/kicad/-/issues/10950
This commit is contained in:
parent
afa4ebcc84
commit
6f6ca2a35f
@ -42,7 +42,8 @@
|
||||
|
||||
|
||||
DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
SCH_LABEL_BASE* aLabel ) :
|
||||
SCH_LABEL_BASE* aLabel,
|
||||
bool aNew ) :
|
||||
DIALOG_LABEL_PROPERTIES_BASE( aParent ),
|
||||
m_Parent( aParent ),
|
||||
m_currentLabel( aLabel ),
|
||||
@ -54,6 +55,12 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
{
|
||||
COLOR_SETTINGS* colorSettings = m_Parent->GetColorSettings();
|
||||
COLOR4D schematicBackground = colorSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
||||
bool multiLine = false;
|
||||
|
||||
if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() ) )
|
||||
multiLine = cfg->m_Appearance.edit_label_multiple;
|
||||
|
||||
m_cbMultiLine->SetValue( multiLine );
|
||||
|
||||
m_fields = new FIELDS_GRID_TABLE( this, aParent, m_grid, m_currentLabel );
|
||||
m_width = 100; // Will be later set to a better value
|
||||
@ -68,7 +75,19 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
m_labelSingleLine->Show( false );
|
||||
m_valueSingleLine->Show( false );
|
||||
|
||||
m_valueCombo->SetValidator( m_netNameValidator );
|
||||
if( multiLine && aNew )
|
||||
{
|
||||
m_activeTextEntry = m_valueMultiLine;
|
||||
SetInitialFocus( m_valueMultiLine );
|
||||
m_labelCombo->Show( false );
|
||||
m_valueCombo->Show( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_labelMultiLine->Show( false );
|
||||
m_valueMultiLine->Show( false );
|
||||
m_valueCombo->SetValidator( m_netNameValidator );
|
||||
}
|
||||
}
|
||||
else if( m_currentLabel->Type() == SCH_HIER_LABEL_T )
|
||||
{
|
||||
@ -78,7 +97,19 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
m_labelCombo->Show( false );
|
||||
m_valueCombo->Show( false );
|
||||
|
||||
m_valueSingleLine->SetValidator( m_netNameValidator );
|
||||
if( multiLine && aNew )
|
||||
{
|
||||
m_activeTextEntry = m_valueMultiLine;
|
||||
SetInitialFocus( m_valueMultiLine );
|
||||
m_labelSingleLine->Show( false );
|
||||
m_valueSingleLine->Show( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_labelMultiLine->Show( false );
|
||||
m_valueMultiLine->Show( false );
|
||||
m_valueSingleLine->SetValidator( m_netNameValidator );
|
||||
}
|
||||
}
|
||||
else if( m_currentLabel->Type() == SCH_DIRECTIVE_LABEL_T )
|
||||
{
|
||||
@ -91,10 +122,16 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
m_valueCombo->Show( false );
|
||||
m_syntaxHelp->Show( false );
|
||||
m_textEntrySizer->Show( false );
|
||||
m_labelCombo->Show( false );
|
||||
m_valueCombo->Show( false );
|
||||
m_cbMultiLine->Show( false );
|
||||
|
||||
m_textSizeLabel->SetLabel( _( "Pin length:" ) );
|
||||
}
|
||||
|
||||
if( !aNew )
|
||||
m_cbMultiLine->Show( false );
|
||||
|
||||
switch( m_currentLabel->Type() )
|
||||
{
|
||||
case SCH_GLOBAL_LABEL_T: SetTitle( _( "Global Label Properties" ) ); break;
|
||||
@ -237,6 +274,7 @@ DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES()
|
||||
cfg->m_Appearance.edit_label_visible_columns = m_grid->GetShownColumnsAsString();
|
||||
cfg->m_Appearance.edit_label_width = GetSize().x;
|
||||
cfg->m_Appearance.edit_label_height = GetSize().y;
|
||||
cfg->m_Appearance.edit_label_multiple = m_cbMultiLine->IsChecked();
|
||||
}
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
@ -612,6 +650,60 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
if( !commit.Empty() )
|
||||
commit.Push( _( "Edit Label Properties" ) );
|
||||
|
||||
else if( m_activeTextEntry && m_labelList )
|
||||
{
|
||||
text = m_activeTextEntry->GetValue();
|
||||
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
|
||||
text.Replace( wxS( "\r" ), wxS( "\n" ) );
|
||||
wxArrayString lines = wxSplit( text, '\n' );
|
||||
|
||||
for( const wxString& line : lines )
|
||||
{
|
||||
text = EscapeString( line, CTX_NETNAME );
|
||||
text.Trim( false ).Trim( true );
|
||||
|
||||
if( text.empty() )
|
||||
continue;
|
||||
|
||||
// convert any text variable cross-references to their UUIDs
|
||||
text = m_currentLabel->Schematic()->ConvertRefsToKIIDs( text );
|
||||
|
||||
switch ( m_currentLabel->Type() )
|
||||
{
|
||||
case SCH_GLOBAL_LABEL_T:
|
||||
{
|
||||
SCH_GLOBALLABEL* label = new SCH_GLOBALLABEL( *static_cast<SCH_GLOBALLABEL*>( m_currentLabel ) );
|
||||
label->SetText( text );
|
||||
m_labelList->push_back( std::unique_ptr<SCH_LABEL_BASE>( label ) );
|
||||
break;
|
||||
}
|
||||
case SCH_HIER_LABEL_T:
|
||||
{
|
||||
SCH_HIERLABEL* label = new SCH_HIERLABEL( *static_cast<SCH_HIERLABEL*>( m_currentLabel ) );
|
||||
label->SetText( text );
|
||||
m_labelList->push_back( std::unique_ptr<SCH_LABEL_BASE>( label ) );
|
||||
break;
|
||||
}
|
||||
case SCH_LABEL_T:
|
||||
{
|
||||
SCH_LABEL* label = new SCH_LABEL( *static_cast<SCH_LABEL*>( m_currentLabel ) );
|
||||
label->SetText( text );
|
||||
m_labelList->push_back( std::unique_ptr<SCH_LABEL_BASE>( label ) );
|
||||
break;
|
||||
}
|
||||
case SCH_DIRECTIVE_LABEL_T:
|
||||
{
|
||||
SCH_DIRECTIVE_LABEL* label = new SCH_DIRECTIVE_LABEL( *static_cast<SCH_DIRECTIVE_LABEL*>( m_currentLabel ) );
|
||||
label->SetText( text );
|
||||
m_labelList->push_back( std::unique_ptr<SCH_LABEL_BASE>( label ) );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -830,20 +922,20 @@ void DIALOG_LABEL_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
|
||||
|
||||
/**
|
||||
* Handles the filtering of items in the wxComboBox based on user input.
|
||||
*
|
||||
* This function is triggered by the wxEVT_TEXT event whenever the user types
|
||||
* or modifies the text in the combo box. It filters the dropdown list
|
||||
*
|
||||
* This function is triggered by the wxEVT_TEXT event whenever the user types
|
||||
* or modifies the text in the combo box. It filters the dropdown list
|
||||
* to show only those items that match the user's input.
|
||||
*
|
||||
*
|
||||
* Key Steps:
|
||||
* - Prevents re-entry using a static flag `isFiltering` to avoid recursion
|
||||
* - Prevents re-entry using a static flag `isFiltering` to avoid recursion
|
||||
* caused by wxComboBox events triggered during item updates.
|
||||
* - Compares the current input with the previously entered text to avoid
|
||||
* unnecessary filtering if the text hasn't changed.
|
||||
* - Filters the items from `m_existingLabelArray` to match the user's input.
|
||||
* - Updates the combo box with the filtered items while preserving the user's
|
||||
* - Updates the combo box with the filtered items while preserving the user's
|
||||
* input and cursor position.
|
||||
*
|
||||
*
|
||||
* @param event The wxCommandEvent associated with the wxEVT_TEXT event.
|
||||
*/
|
||||
void DIALOG_LABEL_PROPERTIES::OnLabelFilter( wxCommandEvent& event )
|
||||
@ -900,21 +992,6 @@ void DIALOG_LABEL_PROPERTIES::OnLabelFilter( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handles the selection of an item from the wxComboBox dropdown.
|
||||
*
|
||||
* This function is triggered by the wxEVT_COMBOBOX event when the user selects
|
||||
* an item from the dropdown list. It ensures that the selected item's value
|
||||
* is preserved and that filtering logic does not interfere with the selection process.
|
||||
*
|
||||
* Key Steps:
|
||||
* - Updates the `m_previousText` to match the selected value to prevent
|
||||
* re-filtering based on the selection.
|
||||
* - Uses a static flag `isHandlingSelection` to ensure filtering is not
|
||||
* unnecessarily triggered by the selection.
|
||||
*
|
||||
* @param event The wxCommandEvent associated with the wxEVT_COMBOBOX event.
|
||||
*/
|
||||
void DIALOG_LABEL_PROPERTIES::OnLabelItemSelected( wxCommandEvent& event )
|
||||
{
|
||||
static bool isHandlingSelection = true; // Prevent OnFilter from firing
|
||||
@ -924,4 +1001,53 @@ void DIALOG_LABEL_PROPERTIES::OnLabelItemSelected( wxCommandEvent& event )
|
||||
m_previousLabelText = selectedValue; // Update the previous text to match the selected value
|
||||
|
||||
isHandlingSelection = false; // Reset the flag
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LABEL_PROPERTIES::onMultiLabelCheck( wxCommandEvent& event )
|
||||
{
|
||||
if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_LABEL_T )
|
||||
{
|
||||
m_labelCombo->Show( !m_cbMultiLine->IsChecked() );
|
||||
m_valueCombo->Show( !m_cbMultiLine->IsChecked() );
|
||||
m_labelMultiLine->Show( m_cbMultiLine->IsChecked() );
|
||||
m_valueMultiLine->Show( m_cbMultiLine->IsChecked() );
|
||||
|
||||
if( m_cbMultiLine->IsChecked() )
|
||||
{
|
||||
m_valueMultiLine->SetValue( m_valueCombo->GetValue() );
|
||||
m_activeTextEntry = m_valueMultiLine;
|
||||
SetInitialFocus( m_valueMultiLine );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString multiText = m_valueMultiLine->GetValue();
|
||||
m_valueCombo->SetValue( multiText.BeforeFirst( '\n' ) );
|
||||
m_activeTextEntry = m_valueCombo;
|
||||
SetInitialFocus( m_valueCombo );
|
||||
}
|
||||
}
|
||||
else if( m_currentLabel->Type() == SCH_HIER_LABEL_T )
|
||||
{
|
||||
m_labelSingleLine->Show( !m_cbMultiLine->IsChecked() );
|
||||
m_valueSingleLine->Show( !m_cbMultiLine->IsChecked() );
|
||||
m_labelMultiLine->Show( m_cbMultiLine->IsChecked() );
|
||||
m_valueMultiLine->Show( m_cbMultiLine->IsChecked() );
|
||||
|
||||
if( m_cbMultiLine->IsChecked() )
|
||||
{
|
||||
m_valueMultiLine->SetValue( m_valueSingleLine->GetValue() );
|
||||
m_activeTextEntry = m_valueMultiLine;
|
||||
SetInitialFocus( m_valueMultiLine );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString multiText = m_valueMultiLine->GetValue();
|
||||
m_valueSingleLine->SetValue( multiText.BeforeFirst( '\n' ) );
|
||||
m_activeTextEntry = m_valueSingleLine;
|
||||
SetInitialFocus( m_valueSingleLine );
|
||||
}
|
||||
}
|
||||
|
||||
Layout();
|
||||
}
|
@ -37,11 +37,16 @@ class HTML_MESSAGE_BOX;
|
||||
class DIALOG_LABEL_PROPERTIES : public DIALOG_LABEL_PROPERTIES_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_LABEL_BASE* aLabel );
|
||||
DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_LABEL_BASE* aLabel, bool aNew );
|
||||
~DIALOG_LABEL_PROPERTIES();
|
||||
|
||||
FIELDS_GRID_TABLE* GetFieldsGridTable() { return m_fields; }
|
||||
|
||||
void SetLabelList( std::list<std::unique_ptr<SCH_LABEL_BASE>>* aLabelList )
|
||||
{
|
||||
m_labelList = aLabelList;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* wxEVT_COMMAND_ENTER event handler for single-line control.
|
||||
@ -57,14 +62,15 @@ private:
|
||||
void OnDeleteField( wxCommandEvent& event ) override;
|
||||
void OnMoveUp( wxCommandEvent& event ) override;
|
||||
void OnMoveDown( wxCommandEvent& event ) override;
|
||||
void onMultiLabelCheck( wxCommandEvent& aEvent ) override;
|
||||
void OnSizeGrid( wxSizeEvent& event ) override;
|
||||
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
|
||||
/**
|
||||
* Handles the filtering of items in the wxComboBox based on user input.
|
||||
*
|
||||
* This function is triggered by the wxEVT_TEXT event when the user modifies
|
||||
* the text in the combo box. It filters the dropdown list to display only
|
||||
* This function is triggered by the wxEVT_TEXT event when the user modifies
|
||||
* the text in the combo box. It filters the dropdown list to display only
|
||||
* the items that match the input text.
|
||||
*
|
||||
* @param event The wxCommandEvent associated with the wxEVT_TEXT event.
|
||||
@ -74,14 +80,14 @@ private:
|
||||
/**
|
||||
* Handles the selection of an item from the wxComboBox dropdown.
|
||||
*
|
||||
* This function is triggered by the wxEVT_COMBOBOX event when the user selects
|
||||
* an item. It ensures that the selected value is correctly processed and
|
||||
* This function is triggered by the wxEVT_COMBOBOX event when the user selects
|
||||
* an item. It ensures that the selected value is correctly processed and
|
||||
* prevents unnecessary re-filtering based on the selection.
|
||||
*
|
||||
* @param event The wxCommandEvent associated with the wxEVT_COMBOBOX event.
|
||||
*/
|
||||
void OnLabelItemSelected( wxCommandEvent& event );
|
||||
|
||||
|
||||
void AdjustGridColumns( int aWidth );
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
@ -105,7 +111,9 @@ private:
|
||||
HTML_MESSAGE_BOX* m_helpWindow;
|
||||
wxArrayString m_existingLabelArray;
|
||||
// To store the previous value of the text typed in label combo
|
||||
wxString m_previousLabelText;
|
||||
wxString m_previousLabelText;
|
||||
|
||||
std::list<std::unique_ptr<SCH_LABEL_BASE>>* m_labelList;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -44,13 +44,34 @@ DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
m_valueCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
|
||||
m_textEntrySizer->Add( m_valueCombo, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_labelMultiLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_labelMultiLine->Wrap( -1 );
|
||||
m_labelMultiLine->SetToolTip( _("Enter the text to be used within the schematic") );
|
||||
|
||||
m_textEntrySizer->Add( m_labelMultiLine, 0, wxALIGN_CENTER_VERTICAL, 2 );
|
||||
|
||||
m_valueMultiLine = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
|
||||
m_textEntrySizer->Add( m_valueMultiLine, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 );
|
||||
|
||||
|
||||
m_textEntrySizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
wxBoxSizer* bSizer7;
|
||||
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_cbMultiLine = new wxCheckBox( this, wxID_ANY, _("Multiple label input"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer7->Add( m_cbMultiLine, 0, 0, 5 );
|
||||
|
||||
|
||||
bSizer7->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_ALIGN_RIGHT|wxHL_CONTEXTMENU );
|
||||
m_syntaxHelp->SetToolTip( _("Show syntax help window") );
|
||||
|
||||
m_textEntrySizer->Add( m_syntaxHelp, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
|
||||
bSizer7->Add( m_syntaxHelp, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_textEntrySizer->Add( bSizer7, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bMainSizer->Add( m_textEntrySizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
|
||||
@ -269,7 +290,7 @@ DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
bSizer22 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_textColorSwatch = new COLOR_SWATCH( m_panelBorderColor1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer22->Add( m_textColorSwatch, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
bSizer22->Add( m_textColorSwatch, 0, 0, 5 );
|
||||
|
||||
|
||||
m_panelBorderColor1->SetSizer( bSizer22 );
|
||||
@ -309,6 +330,8 @@ DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
|
||||
m_valueCombo->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnValueCharHook ), NULL, this );
|
||||
m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
|
||||
m_valueMultiLine->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnValueCharHook ), NULL, this );
|
||||
m_cbMultiLine->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::onMultiLabelCheck ), NULL, this );
|
||||
m_syntaxHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
|
||||
m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
|
||||
m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnAddField ), NULL, this );
|
||||
@ -325,6 +348,8 @@ DIALOG_LABEL_PROPERTIES_BASE::~DIALOG_LABEL_PROPERTIES_BASE()
|
||||
m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
|
||||
m_valueCombo->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnValueCharHook ), NULL, this );
|
||||
m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
|
||||
m_valueMultiLine->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnValueCharHook ), NULL, this );
|
||||
m_cbMultiLine->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::onMultiLabelCheck ), NULL, this );
|
||||
m_syntaxHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
|
||||
m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
|
||||
m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnAddField ), NULL, this );
|
||||
|
@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<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="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">1</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_label_properties_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="first_id">6000</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">dialog_label_properties_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</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_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@ -88,10 +90,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -150,10 +152,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -177,7 +179,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
@ -217,10 +219,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -279,10 +281,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -339,28 +341,18 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxHyperlinkCtrl" expanded="false">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -380,9 +372,9 @@
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover_color"></property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Syntax help</property>
|
||||
<property name="label">Label:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -390,8 +382,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_syntaxHelp</property>
|
||||
<property name="normal_color"></property>
|
||||
<property name="name">m_labelMultiLine</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
@ -399,18 +390,244 @@
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="show">0</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxHL_DEFAULT_STYLE</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Show syntax help window</property>
|
||||
<property name="url"></property>
|
||||
<property name="visited_color"></property>
|
||||
<property name="tooltip">Enter the text to be used within the schematic</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHyperlink">OnFormattingHelp</event>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_valueMultiLine</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">0</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_MULTILINE</property>
|
||||
<property name="subclass"></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="OnCharHook">OnValueCharHook</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer7</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag"></property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="checked">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="drag_accept_files">0</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">Multiple label input</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_cbMultiLine</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="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckBox">onMultiLabelCheck</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxHyperlinkCtrl" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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="hover_color"></property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Syntax help</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_syntaxHelp</property>
|
||||
<property name="normal_color"></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">wxHL_ALIGN_RIGHT|wxHL_CONTEXTMENU</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Show syntax help window</property>
|
||||
<property name="url"></property>
|
||||
<property name="visited_color"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHyperlink">OnFormattingHelp</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@ -436,10 +653,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@ -535,10 +752,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -610,10 +827,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -685,10 +902,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -770,10 +987,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -870,10 +1087,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -935,10 +1152,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1000,10 +1217,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1065,10 +1282,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1130,10 +1347,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1195,10 +1412,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1260,10 +1477,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1325,10 +1542,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1390,10 +1607,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1487,10 +1704,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1552,10 +1769,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1615,7 +1832,7 @@
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_iconBar</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
@ -1629,10 +1846,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1703,10 +1920,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1777,10 +1994,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1851,10 +2068,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1925,10 +2142,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1999,10 +2216,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2073,10 +2290,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2147,10 +2364,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2221,10 +2438,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2286,10 +2503,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2365,10 +2582,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2439,10 +2656,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2504,10 +2721,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2566,10 +2783,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2638,10 +2855,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2692,17 +2909,17 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="flag"></property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="CustomControl" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -25,6 +25,7 @@ class WX_GRID;
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/grid.h>
|
||||
@ -36,7 +37,6 @@ class WX_GRID;
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/dialog.h>
|
||||
@ -53,7 +53,7 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
wxID_VALUESINGLE = 1000
|
||||
wxID_VALUESINGLE = 6000,
|
||||
};
|
||||
|
||||
wxFlexGridSizer* m_textEntrySizer;
|
||||
@ -61,6 +61,9 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
wxTextCtrl* m_valueSingleLine;
|
||||
wxStaticText* m_labelCombo;
|
||||
wxComboBox* m_valueCombo;
|
||||
wxStaticText* m_labelMultiLine;
|
||||
wxTextCtrl* m_valueMultiLine;
|
||||
wxCheckBox* m_cbMultiLine;
|
||||
wxHyperlinkCtrl* m_syntaxHelp;
|
||||
WX_GRID* m_grid;
|
||||
STD_BITMAP_BUTTON* m_bpAdd;
|
||||
@ -105,6 +108,7 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnValueCharHook( wxKeyEvent& event ) { event.Skip(); }
|
||||
virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onMultiLabelCheck( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnFormattingHelp( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnSizeGrid( wxSizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddField( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
wxString edit_label_visible_columns;
|
||||
int edit_label_width;
|
||||
int edit_label_height;
|
||||
bool edit_label_multiple;
|
||||
int erc_severities;
|
||||
bool footprint_preview;
|
||||
bool print_sheet_reference;
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
|
||||
virtual wxObject* Clone() const override { return new SCH_NETNAME_VALIDATOR( *this ); }
|
||||
|
||||
protected:
|
||||
/// @return the error message if the contents of \a aVal are invalid.
|
||||
wxString IsValid( const wxString& aVal ) const override;
|
||||
|
||||
|
@ -1588,24 +1588,19 @@ wxString SCH_DRAWING_TOOLS::findWireLabelDriverName( SCH_LINE* aWire )
|
||||
}
|
||||
|
||||
|
||||
SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType )
|
||||
bool SCH_DRAWING_TOOLS::createNewLabel( const VECTOR2I& aPosition, int aType,
|
||||
std::list<std::unique_ptr<SCH_LABEL_BASE>>& aLabelList )
|
||||
{
|
||||
SCHEMATIC* schematic = getModel<SCHEMATIC>();
|
||||
SCHEMATIC_SETTINGS& settings = schematic->Settings();
|
||||
SCH_TEXT* textItem = nullptr;
|
||||
SCH_LABEL_BASE* labelItem = nullptr;
|
||||
SCH_GLOBALLABEL* globalLabel = nullptr;
|
||||
wxString netName;
|
||||
|
||||
switch( aType )
|
||||
{
|
||||
case LAYER_NOTES:
|
||||
textItem = new SCH_TEXT( aPosition );
|
||||
break;
|
||||
|
||||
case LAYER_LOCLABEL:
|
||||
labelItem = new SCH_LABEL( aPosition );
|
||||
textItem = labelItem;
|
||||
|
||||
if( SCH_LINE* wire = findWire( aPosition ) )
|
||||
netName = findWireLabelDriverName( wire );
|
||||
@ -1619,14 +1614,12 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
labelItem->GetFields().emplace_back( VECTOR2I(), FIELD_T::USER, labelItem, wxT( "Component Class" ) );
|
||||
labelItem->GetFields().back().SetItalic( true );
|
||||
labelItem->GetFields().back().SetVisible( true );
|
||||
textItem = labelItem;
|
||||
break;
|
||||
|
||||
case LAYER_HIERLABEL:
|
||||
labelItem = new SCH_HIERLABEL( aPosition );
|
||||
labelItem->SetShape( m_lastGlobalLabelShape );
|
||||
labelItem->SetAutoRotateOnPlacement( m_lastAutoLabelRotateOnPlacement );
|
||||
textItem = labelItem;
|
||||
break;
|
||||
|
||||
case LAYER_GLOBLABEL:
|
||||
@ -1635,7 +1628,6 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
globalLabel->GetField( FIELD_T::INTERSHEET_REFS )->SetVisible( settings.m_IntersheetRefsShow );
|
||||
globalLabel->SetAutoRotateOnPlacement( m_lastAutoLabelRotateOnPlacement );
|
||||
labelItem = globalLabel;
|
||||
textItem = globalLabel;
|
||||
|
||||
if( SCH_LINE* wire = findWire( aPosition ) )
|
||||
netName = findWireLabelDriverName( wire );
|
||||
@ -1644,86 +1636,50 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "SCH_EDIT_FRAME::CreateNewText() unknown layer type" );
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
textItem->SetParent( schematic );
|
||||
labelItem->SetParent( schematic );
|
||||
|
||||
textItem->SetTextSize( VECTOR2I( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
|
||||
labelItem->SetTextSize( VECTOR2I( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
|
||||
|
||||
if( aType != LAYER_NETCLASS_REFS )
|
||||
{
|
||||
// Must be after SetTextSize()
|
||||
textItem->SetBold( m_lastTextBold );
|
||||
textItem->SetItalic( m_lastTextItalic );
|
||||
labelItem->SetBold( m_lastTextBold );
|
||||
labelItem->SetItalic( m_lastTextItalic );
|
||||
}
|
||||
|
||||
if( labelItem )
|
||||
{
|
||||
labelItem->SetSpinStyle( m_lastTextOrientation );
|
||||
}
|
||||
else
|
||||
{
|
||||
textItem->SetHorizJustify( m_lastTextHJustify );
|
||||
textItem->SetVertJustify( m_lastTextVJustify );
|
||||
textItem->SetTextAngle( m_lastTextAngle );
|
||||
}
|
||||
labelItem->SetSpinStyle( m_lastTextOrientation );
|
||||
labelItem->SetFlags( IS_NEW | IS_MOVING );
|
||||
|
||||
textItem->SetFlags( IS_NEW | IS_MOVING );
|
||||
|
||||
if( !labelItem )
|
||||
{
|
||||
DIALOG_TEXT_PROPERTIES dlg( m_frame, textItem );
|
||||
|
||||
// QuasiModal required for syntax help and Scintilla auto-complete
|
||||
if( dlg.ShowQuasiModal() != wxID_OK )
|
||||
{
|
||||
delete textItem;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else if( !netName.IsEmpty() )
|
||||
if( !netName.IsEmpty() )
|
||||
{
|
||||
// Auto-create from attached wire
|
||||
textItem->SetText( netName );
|
||||
labelItem->SetText( netName );
|
||||
}
|
||||
else
|
||||
{
|
||||
DIALOG_LABEL_PROPERTIES dlg( m_frame, static_cast<SCH_LABEL_BASE*>( textItem ) );
|
||||
DIALOG_LABEL_PROPERTIES dlg( m_frame, labelItem, true );
|
||||
|
||||
dlg.SetLabelList( &aLabelList );
|
||||
|
||||
// QuasiModal required for syntax help and Scintilla auto-complete
|
||||
if( dlg.ShowQuasiModal() != wxID_OK )
|
||||
{
|
||||
dlg.GetFieldsGridTable()->DetachFields();
|
||||
delete labelItem;
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
wxString text = textItem->GetText();
|
||||
|
||||
if( textItem->Type() != SCH_DIRECTIVE_LABEL_T && NoPrintableChars( text ) )
|
||||
{
|
||||
delete textItem;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if( aType != LAYER_NETCLASS_REFS )
|
||||
{
|
||||
m_lastTextBold = textItem->IsBold();
|
||||
m_lastTextItalic = textItem->IsItalic();
|
||||
m_lastTextBold = labelItem->IsBold();
|
||||
m_lastTextItalic = labelItem->IsItalic();
|
||||
}
|
||||
|
||||
if( labelItem )
|
||||
{
|
||||
m_lastTextOrientation = labelItem->GetSpinStyle();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lastTextHJustify = textItem->GetHorizJustify();
|
||||
m_lastTextVJustify = textItem->GetVertJustify();
|
||||
m_lastTextAngle = textItem->GetTextAngle();
|
||||
}
|
||||
m_lastTextOrientation = labelItem->GetSpinStyle();
|
||||
|
||||
if( aType == LAYER_GLOBLABEL || aType == LAYER_HIERLABEL )
|
||||
{
|
||||
@ -1735,6 +1691,43 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
m_lastNetClassFlagShape = labelItem->GetShape();
|
||||
}
|
||||
|
||||
// Return elements are kept in aLabelList
|
||||
delete labelItem;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition )
|
||||
{
|
||||
SCHEMATIC* schematic = getModel<SCHEMATIC>();
|
||||
SCHEMATIC_SETTINGS& settings = schematic->Settings();
|
||||
SCH_TEXT* textItem = nullptr;
|
||||
|
||||
textItem = new SCH_TEXT( aPosition );
|
||||
textItem->SetParent( schematic );
|
||||
textItem->SetTextSize( VECTOR2I( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
|
||||
// Must be after SetTextSize()
|
||||
textItem->SetBold( m_lastTextBold );
|
||||
textItem->SetItalic( m_lastTextItalic );
|
||||
textItem->SetHorizJustify( m_lastTextHJustify );
|
||||
textItem->SetVertJustify( m_lastTextVJustify );
|
||||
textItem->SetTextAngle( m_lastTextAngle );
|
||||
textItem->SetFlags( IS_NEW | IS_MOVING );
|
||||
|
||||
DIALOG_TEXT_PROPERTIES dlg( m_frame, textItem );
|
||||
|
||||
// QuasiModal required for syntax help and Scintilla auto-complete
|
||||
if( dlg.ShowQuasiModal() != wxID_OK )
|
||||
{
|
||||
delete textItem;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
m_lastTextBold = textItem->IsBold();
|
||||
m_lastTextItalic = textItem->IsItalic();
|
||||
m_lastTextHJustify = textItem->GetHorizJustify();
|
||||
m_lastTextVJustify = textItem->GetVertJustify();
|
||||
m_lastTextAngle = textItem->GetTextAngle();
|
||||
return textItem;
|
||||
}
|
||||
|
||||
@ -1839,6 +1832,25 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
item = nullptr;
|
||||
};
|
||||
|
||||
auto prepItemForPlacement =
|
||||
[&]( SCH_ITEM* aItem, const VECTOR2I& cursorPos )
|
||||
{
|
||||
item->SetPosition( cursorPos );
|
||||
|
||||
item->SetFlags( IS_NEW | IS_MOVING );
|
||||
|
||||
// Not placed yet, so pass a nullptr screen reference
|
||||
item->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
|
||||
|
||||
updatePreview();
|
||||
m_selectionTool->AddItemToSel( item );
|
||||
m_toolMgr->PostAction( ACTIONS::refreshPreview );
|
||||
|
||||
// update the cursor so it looks correct before another event
|
||||
setCursor();
|
||||
};
|
||||
|
||||
|
||||
Activate();
|
||||
|
||||
// Must be done after Activate() so that it gets set into the correct context
|
||||
@ -1859,6 +1871,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
SCH_COMMIT commit( m_toolMgr );
|
||||
std::list<std::unique_ptr<SCH_LABEL_BASE>> itemsToPlace;
|
||||
|
||||
// Main loop: keep receiving events
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
@ -1930,7 +1943,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( isText )
|
||||
{
|
||||
item = createNewText( cursorPos, LAYER_NOTES );
|
||||
item = createNewText( cursorPos );
|
||||
description = _( "Add Text" );
|
||||
}
|
||||
else if( isHierLabel )
|
||||
@ -1951,28 +1964,28 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
label->SetTextSize( VECTOR2I( schematic->Settings().m_DefaultTextSize,
|
||||
schematic->Settings().m_DefaultTextSize ) );
|
||||
label->SetFlags( IS_NEW | IS_MOVING );
|
||||
item = label;
|
||||
itemsToPlace.push_back( std::unique_ptr<SCH_LABEL_BASE>( label ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
item = createNewText( cursorPos, LAYER_HIERLABEL );
|
||||
createNewLabel( cursorPos, LAYER_HIERLABEL, itemsToPlace );
|
||||
}
|
||||
|
||||
description = _( "Add Hierarchical Label" );
|
||||
}
|
||||
else if( isNetLabel )
|
||||
{
|
||||
item = createNewText( cursorPos, LAYER_LOCLABEL );
|
||||
createNewLabel( cursorPos, LAYER_LOCLABEL, itemsToPlace );
|
||||
description = _( "Add Label" );
|
||||
}
|
||||
else if( isGlobalLabel )
|
||||
{
|
||||
item = createNewText( cursorPos, LAYER_GLOBLABEL );
|
||||
createNewLabel( cursorPos, LAYER_GLOBLABEL, itemsToPlace );
|
||||
description = _( "Add Label" );
|
||||
}
|
||||
else if( isClassLabel )
|
||||
{
|
||||
item = createNewText( cursorPos, LAYER_NETCLASS_REFS );
|
||||
createNewLabel( cursorPos, LAYER_NETCLASS_REFS, itemsToPlace );
|
||||
description = _( "Add Label" );
|
||||
}
|
||||
else if( isSheetPin )
|
||||
@ -2042,23 +2055,15 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
cursorPos = grid.BestSnapAnchor( cursorPos, snapGrid, item );
|
||||
}
|
||||
|
||||
if( item )
|
||||
if( !itemsToPlace.empty() )
|
||||
{
|
||||
item->SetPosition( cursorPos );
|
||||
|
||||
item->SetFlags( IS_NEW | IS_MOVING );
|
||||
|
||||
// Not placed yet, so pass a nullptr screen reference
|
||||
item->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
|
||||
|
||||
updatePreview();
|
||||
m_selectionTool->AddItemToSel( item );
|
||||
m_toolMgr->PostAction( ACTIONS::refreshPreview );
|
||||
|
||||
// update the cursor so it looks correct before another event
|
||||
setCursor();
|
||||
item = itemsToPlace.front().release();
|
||||
itemsToPlace.pop_front();
|
||||
}
|
||||
|
||||
if( item )
|
||||
prepItemForPlacement( item, cursorPos );
|
||||
|
||||
controls->SetCursorPosition( cursorPos, false );
|
||||
}
|
||||
else // ... and second click places:
|
||||
@ -2123,6 +2128,13 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
item = createNewSheetPinFromLabel( sheet, cursorPos, label );
|
||||
}
|
||||
else if( !itemsToPlace.empty() )
|
||||
{
|
||||
|
||||
item = itemsToPlace.front().release();
|
||||
itemsToPlace.pop_front();
|
||||
prepItemForPlacement( item, cursorPos );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
|
@ -73,7 +73,10 @@ private:
|
||||
///< Gets the (global) label name driving this wire, if it is driven by a label
|
||||
wxString findWireLabelDriverName( SCH_LINE* aWire );
|
||||
|
||||
SCH_TEXT* createNewText( const VECTOR2I& aPosition, int aType );
|
||||
SCH_TEXT* createNewText( const VECTOR2I& aPosition );
|
||||
|
||||
bool createNewLabel( const VECTOR2I& aPosition, int aType,
|
||||
std::list<std::unique_ptr<SCH_LABEL_BASE>>& aLabelList );
|
||||
|
||||
SCH_SHEET_PIN* createNewSheetPin( SCH_SHEET* aSheet, const VECTOR2I& aPosition );
|
||||
|
||||
|
@ -2294,7 +2294,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||
case SCH_HIER_LABEL_T:
|
||||
case SCH_DIRECTIVE_LABEL_T:
|
||||
{
|
||||
DIALOG_LABEL_PROPERTIES dlg( m_frame, static_cast<SCH_LABEL_BASE*>( curr_item ) );
|
||||
DIALOG_LABEL_PROPERTIES dlg( m_frame, static_cast<SCH_LABEL_BASE*>( curr_item ), false );
|
||||
|
||||
// QuasiModal for syntax help and Scintilla auto-complete
|
||||
dlg.ShowQuasiModal();
|
||||
|
@ -103,7 +103,6 @@ public:
|
||||
|
||||
virtual bool Validate( wxWindow *aParent ) override;
|
||||
|
||||
protected:
|
||||
/// @return the error message if the contents of @a aVal are invalid.
|
||||
wxString IsValid( const wxString& aVal ) const override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user