diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt
index c4509e4ff8..7809e3fe65 100644
--- a/bitmaps_png/CMakeLists.txt
+++ b/bitmaps_png/CMakeLists.txt
@@ -77,6 +77,10 @@ set( BMAPS_SMALL
icon_pagelayout_editor_16
icon_pcbcalculator_16
icon_pcbnew_16
+ label_align_left
+ label_align_right
+ label_align_top
+ label_align_bottom
list_nets_16
options_generic_16
pinorient_right
@@ -113,6 +117,18 @@ set( BMAPS_SMALL
small_trash
small_up
small_warning
+ text_horizontal
+ text_vertical
+ text_align_left
+ text_align_center
+ text_align_right
+ text_align_bottom
+ text_align_top
+ text_valign_top
+ text_valign_center
+ text_valign_bottom
+ text_bold
+ text_italic
tree_nosel
tree_sel
visibility
@@ -130,6 +146,7 @@ set( BMAPS_MID
add_bus2bus
add_bus
add_center_dimension
+ add_class_flag
add_circle
add_component
add_corner
diff --git a/bitmaps_png/png/add_class_flag_24.png b/bitmaps_png/png/add_class_flag_24.png
new file mode 100644
index 0000000000..7d08770c97
Binary files /dev/null and b/bitmaps_png/png/add_class_flag_24.png differ
diff --git a/bitmaps_png/png/add_class_flag_dark_24.png b/bitmaps_png/png/add_class_flag_dark_24.png
new file mode 100644
index 0000000000..fceb1bcea3
Binary files /dev/null and b/bitmaps_png/png/add_class_flag_dark_24.png differ
diff --git a/bitmaps_png/png/label_align_bottom_16.png b/bitmaps_png/png/label_align_bottom_16.png
new file mode 100644
index 0000000000..a1e67ed2cb
Binary files /dev/null and b/bitmaps_png/png/label_align_bottom_16.png differ
diff --git a/bitmaps_png/png/label_align_left_16.png b/bitmaps_png/png/label_align_left_16.png
new file mode 100644
index 0000000000..399cfde7a9
Binary files /dev/null and b/bitmaps_png/png/label_align_left_16.png differ
diff --git a/bitmaps_png/png/label_align_right_16.png b/bitmaps_png/png/label_align_right_16.png
new file mode 100644
index 0000000000..f6cff98a02
Binary files /dev/null and b/bitmaps_png/png/label_align_right_16.png differ
diff --git a/bitmaps_png/png/label_align_top_16.png b/bitmaps_png/png/label_align_top_16.png
new file mode 100644
index 0000000000..b6b73b7a8b
Binary files /dev/null and b/bitmaps_png/png/label_align_top_16.png differ
diff --git a/bitmaps_png/png/text_align_bottom_16.png b/bitmaps_png/png/text_align_bottom_16.png
new file mode 100644
index 0000000000..8a2cb8c302
Binary files /dev/null and b/bitmaps_png/png/text_align_bottom_16.png differ
diff --git a/bitmaps_png/png/text_align_center_16.png b/bitmaps_png/png/text_align_center_16.png
new file mode 100644
index 0000000000..efc1a72271
Binary files /dev/null and b/bitmaps_png/png/text_align_center_16.png differ
diff --git a/bitmaps_png/png/text_align_left_16.png b/bitmaps_png/png/text_align_left_16.png
new file mode 100644
index 0000000000..260f66c0d0
Binary files /dev/null and b/bitmaps_png/png/text_align_left_16.png differ
diff --git a/bitmaps_png/png/text_align_right_16.png b/bitmaps_png/png/text_align_right_16.png
new file mode 100644
index 0000000000..b9db61941f
Binary files /dev/null and b/bitmaps_png/png/text_align_right_16.png differ
diff --git a/bitmaps_png/png/text_align_top_16.png b/bitmaps_png/png/text_align_top_16.png
new file mode 100644
index 0000000000..32ef10d46a
Binary files /dev/null and b/bitmaps_png/png/text_align_top_16.png differ
diff --git a/bitmaps_png/png/text_bold_16.png b/bitmaps_png/png/text_bold_16.png
new file mode 100644
index 0000000000..ffd362f536
Binary files /dev/null and b/bitmaps_png/png/text_bold_16.png differ
diff --git a/bitmaps_png/png/text_horizontal_16.png b/bitmaps_png/png/text_horizontal_16.png
new file mode 100644
index 0000000000..28510a3825
Binary files /dev/null and b/bitmaps_png/png/text_horizontal_16.png differ
diff --git a/bitmaps_png/png/text_italic_16.png b/bitmaps_png/png/text_italic_16.png
new file mode 100644
index 0000000000..ea3f7706a4
Binary files /dev/null and b/bitmaps_png/png/text_italic_16.png differ
diff --git a/bitmaps_png/png/text_valign_bottom_16.png b/bitmaps_png/png/text_valign_bottom_16.png
new file mode 100644
index 0000000000..6dfb33d70a
Binary files /dev/null and b/bitmaps_png/png/text_valign_bottom_16.png differ
diff --git a/bitmaps_png/png/text_valign_center_16.png b/bitmaps_png/png/text_valign_center_16.png
new file mode 100644
index 0000000000..a5ee719ba1
Binary files /dev/null and b/bitmaps_png/png/text_valign_center_16.png differ
diff --git a/bitmaps_png/png/text_valign_top_16.png b/bitmaps_png/png/text_valign_top_16.png
new file mode 100644
index 0000000000..ce91e275b5
Binary files /dev/null and b/bitmaps_png/png/text_valign_top_16.png differ
diff --git a/bitmaps_png/png/text_vertical_16.png b/bitmaps_png/png/text_vertical_16.png
new file mode 100644
index 0000000000..70974d2ded
Binary files /dev/null and b/bitmaps_png/png/text_vertical_16.png differ
diff --git a/bitmaps_png/sources/dark/add_class_flag.svg b/bitmaps_png/sources/dark/add_class_flag.svg
new file mode 100644
index 0000000000..d17e210c07
--- /dev/null
+++ b/bitmaps_png/sources/dark/add_class_flag.svg
@@ -0,0 +1,108 @@
+
+
diff --git a/bitmaps_png/sources/light/add_class_flag.svg b/bitmaps_png/sources/light/add_class_flag.svg
new file mode 100644
index 0000000000..207d5cb8b0
--- /dev/null
+++ b/bitmaps_png/sources/light/add_class_flag.svg
@@ -0,0 +1,108 @@
+
+
diff --git a/bitmaps_png/sources/light/label_align_bottom.svg b/bitmaps_png/sources/light/label_align_bottom.svg
new file mode 100644
index 0000000000..d0e8d9bf69
--- /dev/null
+++ b/bitmaps_png/sources/light/label_align_bottom.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/bitmaps_png/sources/light/label_align_left.svg b/bitmaps_png/sources/light/label_align_left.svg
new file mode 100644
index 0000000000..3a5ccdf8fb
--- /dev/null
+++ b/bitmaps_png/sources/light/label_align_left.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/bitmaps_png/sources/light/label_align_right.svg b/bitmaps_png/sources/light/label_align_right.svg
new file mode 100644
index 0000000000..2937395740
--- /dev/null
+++ b/bitmaps_png/sources/light/label_align_right.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/bitmaps_png/sources/light/label_align_top.svg b/bitmaps_png/sources/light/label_align_top.svg
new file mode 100644
index 0000000000..e8d70796a1
--- /dev/null
+++ b/bitmaps_png/sources/light/label_align_top.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/bitmaps_png/sources/light/text_align_bottom.svg b/bitmaps_png/sources/light/text_align_bottom.svg
new file mode 100644
index 0000000000..964f15ceb5
--- /dev/null
+++ b/bitmaps_png/sources/light/text_align_bottom.svg
@@ -0,0 +1,106 @@
+
+
diff --git a/bitmaps_png/sources/light/text_align_center.svg b/bitmaps_png/sources/light/text_align_center.svg
new file mode 100644
index 0000000000..343c159c8a
--- /dev/null
+++ b/bitmaps_png/sources/light/text_align_center.svg
@@ -0,0 +1,102 @@
+
+
diff --git a/bitmaps_png/sources/light/text_align_left.svg b/bitmaps_png/sources/light/text_align_left.svg
new file mode 100644
index 0000000000..98824edc18
--- /dev/null
+++ b/bitmaps_png/sources/light/text_align_left.svg
@@ -0,0 +1,102 @@
+
+
diff --git a/bitmaps_png/sources/light/text_align_right.svg b/bitmaps_png/sources/light/text_align_right.svg
new file mode 100644
index 0000000000..05c27aa6c8
--- /dev/null
+++ b/bitmaps_png/sources/light/text_align_right.svg
@@ -0,0 +1,102 @@
+
+
diff --git a/bitmaps_png/sources/light/text_align_top.svg b/bitmaps_png/sources/light/text_align_top.svg
new file mode 100644
index 0000000000..d1709cd95e
--- /dev/null
+++ b/bitmaps_png/sources/light/text_align_top.svg
@@ -0,0 +1,102 @@
+
+
diff --git a/bitmaps_png/sources/light/text_bold.svg b/bitmaps_png/sources/light/text_bold.svg
new file mode 100644
index 0000000000..e7a36d7567
--- /dev/null
+++ b/bitmaps_png/sources/light/text_bold.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/bitmaps_png/sources/light/text_horizontal.svg b/bitmaps_png/sources/light/text_horizontal.svg
new file mode 100644
index 0000000000..695f867954
--- /dev/null
+++ b/bitmaps_png/sources/light/text_horizontal.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/bitmaps_png/sources/light/text_italic.svg b/bitmaps_png/sources/light/text_italic.svg
new file mode 100644
index 0000000000..2c0f0c951c
--- /dev/null
+++ b/bitmaps_png/sources/light/text_italic.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/bitmaps_png/sources/light/text_valign_bottom.svg b/bitmaps_png/sources/light/text_valign_bottom.svg
new file mode 100644
index 0000000000..523218c807
--- /dev/null
+++ b/bitmaps_png/sources/light/text_valign_bottom.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/bitmaps_png/sources/light/text_valign_center.svg b/bitmaps_png/sources/light/text_valign_center.svg
new file mode 100644
index 0000000000..c942738701
--- /dev/null
+++ b/bitmaps_png/sources/light/text_valign_center.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/bitmaps_png/sources/light/text_valign_top.svg b/bitmaps_png/sources/light/text_valign_top.svg
new file mode 100644
index 0000000000..a27b7f25bb
--- /dev/null
+++ b/bitmaps_png/sources/light/text_valign_top.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/bitmaps_png/sources/light/text_vertical.svg b/bitmaps_png/sources/light/text_vertical.svg
new file mode 100644
index 0000000000..d6a6dab033
--- /dev/null
+++ b/bitmaps_png/sources/light/text_vertical.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/common/eda_item.cpp b/common/eda_item.cpp
index 34a5b28e3e..5a93f24903 100644
--- a/common/eda_item.cpp
+++ b/common/eda_item.cpp
@@ -342,6 +342,7 @@ static struct EDA_ITEM_DESC
.Map( SCH_BITMAP_T, _HKI( "Bitmap" ) )
.Map( SCH_TEXT_T, _HKI( "Text" ) )
.Map( SCH_LABEL_T, _HKI( "Net Label" ) )
+ .Map( SCH_NETCLASS_FLAG_T, _HKI( "Net Class Flag" ) )
.Map( SCH_GLOBAL_LABEL_T, _HKI( "Global Label" ) )
.Map( SCH_HIER_LABEL_T, _HKI( "Hierarchical Label" ) )
.Map( SCH_FIELD_T, _HKI( "Field" ) )
diff --git a/common/layer_id.cpp b/common/layer_id.cpp
index 21d33edcd8..da7a960bba 100644
--- a/common/layer_id.cpp
+++ b/common/layer_id.cpp
@@ -114,6 +114,8 @@ wxString LayerName( int aLayer )
case LAYER_REFERENCEPART: return _( "Symbol references" );
case LAYER_VALUEPART: return _( "Symbol values" );
case LAYER_FIELDS: return _( "Symbol fields" );
+ case LAYER_INTERSHEET_REFS: return _( "Sheet references" );
+ case LAYER_NETCLASS_REFS: return _( "Net class references" );
case LAYER_DEVICE: return _( "Symbol body outlines" );
case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
case LAYER_NOTES: return _( "Schematic text && graphics" );
diff --git a/common/settings/builtin_color_themes.h b/common/settings/builtin_color_themes.h
index cc83b3c812..cb63efdc2b 100644
--- a/common/settings/builtin_color_themes.h
+++ b/common/settings/builtin_color_themes.h
@@ -46,6 +46,7 @@ static const std::map s_defaultTheme =
{ LAYER_GLOBLABEL, CSS_COLOR( 132, 0, 0, 1 ) },
{ LAYER_HIERLABEL, CSS_COLOR( 114, 86, 0, 1 ) },
{ LAYER_LOCLABEL, CSS_COLOR( 15, 15, 15, 1 ) },
+ { LAYER_NETCLASS_REFS, CSS_COLOR( 72, 72, 72, 1 ) },
{ LAYER_NOCONNECT, CSS_COLOR( 0, 0, 132, 1 ) },
{ LAYER_NOTES, CSS_COLOR( 0, 0, 194, 1 ) },
{ LAYER_NOTES_BACKGROUND, CSS_COLOR( 0, 0, 0, 0 ) },
@@ -192,6 +193,7 @@ static const std::map s_classicTheme =
{ LAYER_GLOBLABEL, COLOR4D( RED ) },
{ LAYER_HIERLABEL, COLOR4D( BROWN ) },
{ LAYER_LOCLABEL, COLOR4D( BLACK ) },
+ { LAYER_NETCLASS_REFS, COLOR4D( BLACK ) },
{ LAYER_NOCONNECT, COLOR4D( BLUE ) },
{ LAYER_NOTES, COLOR4D( LIGHTBLUE ) },
{ LAYER_NOTES_BACKGROUND, COLOR4D( UNSPECIFIED_COLOR ) },
diff --git a/common/settings/color_settings.cpp b/common/settings/color_settings.cpp
index 93dbfcfb15..3823597ad3 100644
--- a/common/settings/color_settings.cpp
+++ b/common/settings/color_settings.cpp
@@ -92,6 +92,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
CLR( "schematic.label_global", LAYER_GLOBLABEL );
CLR( "schematic.label_hier", LAYER_HIERLABEL );
CLR( "schematic.label_local", LAYER_LOCLABEL );
+ CLR( "schematic.netclass_flag", LAYER_NETCLASS_REFS );
CLR( "schematic.no_connect", LAYER_NOCONNECT );
CLR( "schematic.note", LAYER_NOTES );
CLR( "schematic.note_background", LAYER_NOTES_BACKGROUND );
diff --git a/common/tool/selection.cpp b/common/tool/selection.cpp
index 65e7ea6386..7805fba153 100644
--- a/common/tool/selection.cpp
+++ b/common/tool/selection.cpp
@@ -70,7 +70,7 @@ bool SELECTION::Contains( EDA_ITEM* aItem ) const
/// Returns the center point of the selection area bounding box.
VECTOR2I SELECTION::GetCenter() const
{
- KICAD_T textTypes[] = { SCH_TEXT_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT };
+ KICAD_T textTypes[] = { SCH_TEXT_T, SCH_LABEL_LOCATE_ANY_T, EOT };
bool hasOnlyText = true;
// If the selection contains only texts calculate the center as the mean of all positions
diff --git a/common/widgets/bitmap_button.cpp b/common/widgets/bitmap_button.cpp
index 952992b726..2f52ef70fc 100644
--- a/common/widgets/bitmap_button.cpp
+++ b/common/widgets/bitmap_button.cpp
@@ -29,6 +29,8 @@
#include
#include
+#define wxCONTROL_SEPARATOR wxCONTROL_SPECIAL
+
BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos,
const wxSize& aSize, int aStyles ) :
@@ -38,8 +40,28 @@ BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint&
m_acceptDraggedInClicks( false )
{
if( aSize == wxDefaultSize )
- SetMinSize( wxButton::GetDefaultSize() );
+ SetMinSize( wxButton::GetDefaultSize() + wxSize( m_padding * 2, m_padding * 2) );
+ setupEvents();
+}
+
+
+BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxBitmap& aDummyBitmap,
+ const wxPoint& aPos, const wxSize& aSize, int aStyles ) :
+ wxPanel( aParent, aId, aPos, aSize, aStyles ),
+ m_buttonState( 0 ),
+ m_padding( 5 ),
+ m_acceptDraggedInClicks( false )
+{
+ if( aSize == wxDefaultSize )
+ SetMinSize( wxButton::GetDefaultSize() + wxSize( m_padding * 2, m_padding * 2) );
+
+ setupEvents();
+}
+
+
+void BITMAP_BUTTON::setupEvents()
+{
Bind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this );
Bind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this );
Bind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this );
@@ -58,7 +80,7 @@ BITMAP_BUTTON::~BITMAP_BUTTON()
void BITMAP_BUTTON::SetPadding( int aPadding )
{
m_padding = aPadding;
- SetMinSize( m_unadjustedMinSize + wxSize( aPadding * 2, aPadding * 2) );
+ SetMinSize( m_unadjustedMinSize + wxSize( aPadding * 2, aPadding * 2 ) );
}
@@ -109,7 +131,9 @@ void BITMAP_BUTTON::OnKillFocus( wxEvent& aEvent )
void BITMAP_BUTTON::OnSetFocus( wxEvent& aEvent )
{
- setFlag( wxCONTROL_FOCUSED );
+ if( !hasFlag( wxCONTROL_CHECKABLE ) )
+ setFlag( wxCONTROL_FOCUSED );
+
Refresh();
aEvent.Skip();
}
@@ -119,19 +143,15 @@ void BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
{
// Only create a button event when the control is enabled
// and only accept clicks that came without prior mouse-down if configured
- if( !hasFlag( wxCONTROL_DISABLED ) &&
- ( m_acceptDraggedInClicks || hasFlag( wxCONTROL_PRESSED | wxCONTROL_FOCUSED ) ) )
+ if( !hasFlag( wxCONTROL_DISABLED )
+ && ( m_acceptDraggedInClicks || hasFlag( wxCONTROL_PRESSED | wxCONTROL_FOCUSED ) ) )
{
- wxEvtHandler* pEventHandler = GetEventHandler();
- wxASSERT( pEventHandler );
-
- pEventHandler->CallAfter(
- [=]()
- {
- wxCommandEvent evt( wxEVT_BUTTON, GetId() );
- evt.SetEventObject( this );
- GetEventHandler()->ProcessEvent( evt );
- } );
+ GetEventHandler()->CallAfter( [=]()
+ {
+ wxCommandEvent evt( wxEVT_BUTTON, GetId() );
+ evt.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( evt );
+ } );
}
clearFlag( wxCONTROL_PRESSED );
@@ -143,7 +163,29 @@ void BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
void BITMAP_BUTTON::OnLeftButtonDown( wxMouseEvent& aEvent )
{
- setFlag( wxCONTROL_PRESSED );
+ if( hasFlag( wxCONTROL_CHECKABLE ) )
+ {
+ if( hasFlag( wxCONTROL_CHECKED ) )
+ {
+ clearFlag( wxCONTROL_CHECKED );
+ }
+ else
+ {
+ setFlag( wxCONTROL_CHECKED );
+
+ GetEventHandler()->CallAfter( [=]()
+ {
+ wxCommandEvent evt( wxEVT_BUTTON, GetId() );
+ evt.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( evt );
+ } );
+ }
+ }
+ else
+ {
+ setFlag( wxCONTROL_PRESSED );
+ }
+
Refresh();
aEvent.Skip();
@@ -159,6 +201,13 @@ void BITMAP_BUTTON::OnPaint( wxPaintEvent& aEvent )
wxRect rect( wxPoint( 0, 0 ), GetSize() );
wxPaintDC dc( this );
+ if( hasFlag( wxCONTROL_SEPARATOR ) )
+ {
+ dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ) );
+ dc.DrawLine( wxPoint( GetSize().x / 2, 0 ), wxPoint( GetSize().x / 2, GetSize().y ) );
+ return;
+ }
+
// This drawing is done so the button looks the same as an AUI toolbar button
if( !hasFlag( wxCONTROL_DISABLED ) )
{
@@ -214,8 +263,23 @@ bool BITMAP_BUTTON::Enable( bool aEnable )
}
+void BITMAP_BUTTON::SetIsCheckButton()
+{
+ setFlag( wxCONTROL_CHECKABLE );
+}
+
+
+void BITMAP_BUTTON::SetIsSeparator()
+{
+ setFlag( wxCONTROL_SEPARATOR | wxCONTROL_DISABLED );
+ SetMinSize( wxSize( m_padding * 2, wxButton::GetDefaultSize().y ) );
+}
+
+
void BITMAP_BUTTON::Check( bool aCheck )
{
+ wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
+
if( aCheck )
setFlag( wxCONTROL_CHECKED );
else
@@ -223,3 +287,11 @@ void BITMAP_BUTTON::Check( bool aCheck )
Refresh();
}
+
+
+bool BITMAP_BUTTON::IsChecked() const
+{
+ wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
+
+ return hasFlag( wxCONTROL_CHECKED );
+}
\ No newline at end of file
diff --git a/common/widgets/grid_combobox.cpp b/common/widgets/grid_combobox.cpp
index 80f12907f7..1ccc3c2a5d 100644
--- a/common/widgets/grid_combobox.cpp
+++ b/common/widgets/grid_combobox.cpp
@@ -90,6 +90,9 @@ void GRID_CELL_COMBOBOX::BeginEdit( int aRow, int aCol, wxGrid* aGrid )
// Work around a wxWidgets bug where the drop-down is the wrong width on the first drop.
Combo()->Set( Combo()->GetStrings() );
+ Combo()->ChangeValue( m_value );
+ Combo()->SelectAll();
+
#ifdef __WXOSX_COCOA__
// This is a work around for the combobox being simply dismissed when a
// choice is made in it under OS X. The bug is almost certainly due to a
diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt
index 4918e0ec35..52f9116560 100644
--- a/eeschema/CMakeLists.txt
+++ b/eeschema/CMakeLists.txt
@@ -67,6 +67,8 @@ set( EESCHEMA_DLGS
dialogs/dialog_global_edit_text_and_graphics_base.cpp
dialogs/dialog_junction_props.cpp
dialogs/dialog_junction_props_base.cpp
+ dialogs/dialog_label_properties.cpp
+ dialogs/dialog_label_properties_base.cpp
dialogs/dialog_lib_edit_pin_table.cpp
dialogs/dialog_lib_edit_pin_table_base.cpp
dialogs/dialog_lib_text_properties.cpp
@@ -106,8 +108,8 @@ set( EESCHEMA_DLGS
dialogs/dialog_symbol_properties_base.cpp
dialogs/dialog_symbol_remap.cpp
dialogs/dialog_symbol_remap_base.cpp
- dialogs/dialog_text_and_label_properties.cpp
- dialogs/dialog_text_and_label_properties_base.cpp
+ dialogs/dialog_text_properties.cpp
+ dialogs/dialog_text_properties_base.cpp
dialogs/dialog_update_from_pcb.cpp
dialogs/dialog_update_from_pcb_base.cpp
dialogs/dialog_update_symbol_fields.cpp
diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp
index 6e25ddb25f..75a656588b 100644
--- a/eeschema/connection_graph.cpp
+++ b/eeschema/connection_graph.cpp
@@ -119,7 +119,7 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCheckMultipleDrivers )
{
SCH_SHEET_PIN* p = static_cast( c );
- if( p->GetShape() == PINSHEETLABEL_SHAPE::PS_OUTPUT )
+ if( p->GetShape() == LABEL_FLAG_SHAPE::L_OUTPUT )
{
m_driver = c;
break;
@@ -258,7 +258,8 @@ std::vector CONNECTION_SUBGRAPH::GetBusLabels() const
break;
}
- default: break;
+ default:
+ break;
}
}
diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp
index 0e18219a87..3896bc64cb 100644
--- a/eeschema/dialogs/dialog_field_properties.cpp
+++ b/eeschema/dialogs/dialog_field_properties.cpp
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include
#include
#include
#include
@@ -69,6 +70,51 @@ DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const
} );
m_StyledTextCtrl->SetEOLMode( wxSTC_EOL_LF ); // Normalize EOL across platforms
+ m_separator1->SetIsSeparator();
+
+ m_horizontal->SetIsCheckButton();
+ m_horizontal->SetBitmap( KiBitmap( BITMAPS::text_horizontal ) );
+ m_vertical->SetIsCheckButton();
+ m_vertical->SetBitmap( KiBitmap( BITMAPS::text_vertical ) );
+
+ m_separator2->SetIsSeparator();
+
+ m_bold->SetIsCheckButton();
+ m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
+ m_italic->SetIsCheckButton();
+ m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
+
+ m_separator3->SetIsSeparator();
+
+ m_hAlignLeft->SetIsCheckButton();
+ m_hAlignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
+ m_hAlignCenter->SetIsCheckButton();
+ m_hAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) );
+ m_hAlignRight->SetIsCheckButton();
+ m_hAlignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
+
+ m_separator4->SetIsSeparator();
+
+ m_vAlignTop->SetIsCheckButton();
+ m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) );
+ m_vAlignCenter->SetIsCheckButton();
+ m_vAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) );
+ m_vAlignBottom->SetIsCheckButton();
+ m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) );
+
+ m_separator5->SetIsSeparator();
+
+ m_horizontal->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onOrientButton, this );
+ m_vertical->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onOrientButton, this );
+
+ m_hAlignLeft->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
+ m_hAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
+ m_hAlignRight->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
+
+ m_vAlignTop->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
+ m_vAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
+ m_vAlignBottom->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
+
m_text = aTextItem->GetText();
m_isItalic = aTextItem->IsItalic();
m_isBold = aTextItem->IsBold();
@@ -210,6 +256,36 @@ void DIALOG_FIELD_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
}
+void DIALOG_FIELD_PROPERTIES::onOrientButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_horizontal, m_vertical } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+void DIALOG_FIELD_PROPERTIES::onHAlignButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_hAlignLeft, m_hAlignCenter, m_hAlignRight } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+void DIALOG_FIELD_PROPERTIES::onVAlignButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignTop, m_vAlignBottom } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow()
{
if( m_TextCtrl->IsShown() )
@@ -220,12 +296,28 @@ bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow()
m_posX.SetValue( m_position.x );
m_posY.SetValue( m_position.y );
m_textSize.SetValue( m_size );
- m_orientChoice->SetSelection( m_isVertical ? 1 : 0 );
- m_hAlignChoice->SetSelection( m_horizontalJustification );
- m_vAlignChoice->SetSelection( m_verticalJustification );
+
+ m_horizontal->Check( !m_isVertical );
+ m_vertical->Check( m_isVertical );
+
+ m_italic->Check( m_isItalic );
+ m_bold->Check( m_isBold );
+
+ switch ( m_horizontalJustification )
+ {
+ case GR_TEXT_HJUSTIFY_LEFT: m_hAlignLeft->Check( true ); break;
+ case GR_TEXT_HJUSTIFY_CENTER: m_hAlignCenter->Check( true ); break;
+ case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignRight->Check( true ); break;
+ }
+
+ switch ( m_verticalJustification )
+ {
+ case GR_TEXT_VJUSTIFY_TOP: m_vAlignTop->Check( true ); break;
+ case GR_TEXT_VJUSTIFY_CENTER: m_vAlignCenter->Check( true ); break;
+ case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignBottom->Check( true ); break;
+ }
+
m_visible->SetValue( m_isVisible );
- m_italic->SetValue( m_isItalic );
- m_bold->SetValue( m_isBold );
return true;
}
@@ -268,14 +360,29 @@ bool DIALOG_FIELD_PROPERTIES::TransferDataFromWindow()
}
}
- m_isVertical = m_orientChoice->GetSelection() == 1;
m_position = wxPoint( m_posX.GetValue(), m_posY.GetValue() );
m_size = m_textSize.GetValue();
- m_horizontalJustification = m_hAlignChoice->GetSelection();
- m_verticalJustification = m_vAlignChoice->GetSelection();
+
+ m_isVertical = m_vertical->IsChecked();
+
+ m_isBold = m_bold->IsChecked();
+ m_isItalic = m_italic->IsChecked();
+
+ if( m_hAlignLeft->IsChecked() )
+ m_horizontalJustification = GR_TEXT_HJUSTIFY_LEFT;
+ else if( m_hAlignCenter->IsChecked() )
+ m_horizontalJustification = GR_TEXT_HJUSTIFY_CENTER;
+ else
+ m_horizontalJustification = GR_TEXT_HJUSTIFY_RIGHT;
+
+ if( m_vAlignTop->IsChecked() )
+ m_verticalJustification = GR_TEXT_VJUSTIFY_TOP;
+ else if( m_vAlignCenter->IsChecked() )
+ m_verticalJustification = GR_TEXT_VJUSTIFY_CENTER;
+ else
+ m_verticalJustification = GR_TEXT_VJUSTIFY_BOTTOM;
+
m_isVisible = m_visible->GetValue();
- m_isItalic = m_italic->GetValue();
- m_isBold = m_bold->GetValue();
return true;
}
diff --git a/eeschema/dialogs/dialog_field_properties.h b/eeschema/dialogs/dialog_field_properties.h
index bd1df2df43..443d8d6498 100644
--- a/eeschema/dialogs/dialog_field_properties.h
+++ b/eeschema/dialogs/dialog_field_properties.h
@@ -80,6 +80,11 @@ protected:
*/
virtual void OnSetFocusText( wxFocusEvent& event ) override;
+ void onOrientButton( wxCommandEvent &aEvent );
+ void onHAlignButton( wxCommandEvent &aEvent );
+ void onVAlignButton( wxCommandEvent &aEvent );
+
+protected:
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_textSize;
diff --git a/eeschema/dialogs/dialog_label_properties.cpp b/eeschema/dialogs/dialog_label_properties.cpp
new file mode 100644
index 0000000000..445dce2fc1
--- /dev/null
+++ b/eeschema/dialogs/dialog_label_properties.cpp
@@ -0,0 +1,696 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 2013 Wayne Stambaugh
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * 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
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class SCH_EDIT_FRAME;
+class SCH_TEXT;
+
+
+DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_LABEL_BASE* aLabel ) :
+ DIALOG_LABEL_PROPERTIES_BASE( aParent ),
+ m_activeTextEntry( nullptr ),
+ m_netNameValidator( true ),
+ m_fields( nullptr ),
+ m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
+ m_helpWindow( nullptr )
+{
+ m_Parent = aParent;
+ m_currentLabel = aLabel;
+
+ m_fields = new FIELDS_GRID_TABLE( this, aParent, m_grid, m_currentLabel );
+ m_width = 100; // Will be later set to a better value
+ m_delayedFocusRow = -1;
+ m_delayedFocusColumn = FDC_VALUE;
+
+ if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_LABEL_T )
+ {
+ m_activeTextEntry = m_valueCombo;
+ SetInitialFocus( m_valueCombo );
+
+ m_labelSingleLine->Show( false );
+ m_valueSingleLine->Show( false );
+
+ m_valueCombo->SetValidator( m_netNameValidator );
+ }
+ else if( m_currentLabel->Type() == SCH_HIER_LABEL_T )
+ {
+ m_activeTextEntry = m_valueSingleLine;
+ SetInitialFocus( m_valueSingleLine );
+
+ m_labelCombo->Show( false );
+ m_valueCombo->Show( false );
+
+ m_valueSingleLine->SetValidator( m_netNameValidator );
+ }
+ else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
+ {
+ SetInitialFocus( m_grid );
+ m_delayedFocusRow = 0;
+
+ m_labelSingleLine->Show( false );
+ m_valueSingleLine->Show( false );
+ m_labelCombo->Show( false );
+ m_valueCombo->Show( false );
+ m_syntaxHelp->Show( false );
+
+ m_textSizeLabel->SetLabel( _( "Pin length:" ) );
+ }
+
+ switch( m_currentLabel->Type() )
+ {
+ case SCH_GLOBAL_LABEL_T: SetTitle( _( "Global Label Properties" ) ); break;
+ case SCH_HIER_LABEL_T: SetTitle( _( "Hierarchical Label Properties" ) ); break;
+ case SCH_LABEL_T: SetTitle( _( "Label Properties" ) ); break;
+ case SCH_NETCLASS_FLAG_T: SetTitle( _( "Net Class Flag Properties" ) ); break;
+ case SCH_SHEET_PIN_T: SetTitle( _( "Hierarchical Sheet Pin Properties" ) ); break;
+ default: UNIMPLEMENTED_FOR( m_currentLabel->GetClass() ); break;
+ }
+
+ // Give a bit more room for combobox editors
+ m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
+
+ m_grid->SetTable( m_fields );
+ m_grid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this ) );
+ m_grid->SetSelectionMode( wxGrid::wxGridSelectRows );
+
+ // Show/hide columns according to user's preference
+ auto cfg = dynamic_cast( Kiface().KifaceSettings() );
+ wxASSERT( cfg );
+
+ if( cfg )
+ {
+ m_shownColumns = cfg->m_Appearance.edit_label_visible_columns;
+ m_grid->ShowHideColumns( m_shownColumns );
+ }
+
+ // Configure button logos
+ m_bpAdd->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
+ m_bpDelete->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
+ m_bpMoveUp->SetBitmap( KiBitmap( BITMAPS::small_up ) );
+ m_bpMoveDown->SetBitmap( KiBitmap( BITMAPS::small_down ) );
+
+ m_separator1->SetIsSeparator();
+
+ m_bold->SetIsCheckButton();
+ m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
+ m_italic->SetIsCheckButton();
+ m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
+
+ m_separator2->SetIsSeparator();
+
+ m_spin0->SetIsCheckButton();
+ m_spin1->SetIsCheckButton();
+ m_spin2->SetIsCheckButton();
+ m_spin3->SetIsCheckButton();
+
+ m_separator3->SetIsSeparator();
+
+ // Show/hide relevant controls
+ if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_HIER_LABEL_T )
+ {
+ m_dot->Hide();
+ m_circle->Hide();
+ m_diamond->Hide();
+ m_rectangle->Hide();
+
+ m_spin0->SetBitmap( KiBitmap( BITMAPS::label_align_left ) );
+ m_spin1->SetBitmap( KiBitmap( BITMAPS::label_align_right ) );
+ m_spin2->SetBitmap( KiBitmap( BITMAPS::label_align_bottom ) );
+ m_spin3->SetBitmap( KiBitmap( BITMAPS::label_align_top ) );
+ }
+ else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
+ {
+ m_input->Hide();
+ m_output->Hide();
+ m_bidirectional->Hide();
+ m_triState->Hide();
+ m_passive->Hide();
+
+ m_spin0->SetBitmap( KiBitmap( BITMAPS::pinorient_down ) );
+ m_spin1->SetBitmap( KiBitmap( BITMAPS::pinorient_up ) );
+ m_spin2->SetBitmap( KiBitmap( BITMAPS::pinorient_right ) );
+ m_spin3->SetBitmap( KiBitmap( BITMAPS::pinorient_left ) );
+ }
+ else
+ {
+ m_shapeSizer->Show( false );
+
+ m_spin0->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
+ m_spin1->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
+ m_spin2->SetBitmap( KiBitmap( BITMAPS::text_align_bottom ) );
+ m_spin3->SetBitmap( KiBitmap( BITMAPS::text_align_top ) );
+ }
+
+ m_sdbSizer1OK->SetDefault();
+
+ // DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
+ // various versions have different controls so we want to store sizes for each version.
+ m_hash_key = TO_UTF8( GetTitle() );
+
+ m_spin0->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
+ m_spin1->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
+ m_spin2->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
+ m_spin3->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
+
+ // Now all widgets have the size fixed, call FinishDialogSettings
+ finishDialogSettings();
+}
+
+
+DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES()
+{
+ auto cfg = dynamic_cast( Kiface().KifaceSettings() );
+ wxASSERT( cfg );
+
+ if( cfg )
+ cfg->m_Appearance.edit_sheet_visible_columns = m_grid->GetShownColumns();
+
+ // Prevents crash bug in wxGrid's d'tor
+ m_grid->DestroyTable( m_fields );
+
+ // Delete the GRID_TRICKS.
+ m_grid->PopEventHandler( true );
+
+ if( m_helpWindow )
+ m_helpWindow->Destroy();
+}
+
+
+bool DIALOG_LABEL_PROPERTIES::TransferDataToWindow()
+{
+ if( !wxDialog::TransferDataToWindow() )
+ return false;
+
+ if( m_activeTextEntry )
+ {
+ // show control characters in a human-readable format
+ m_activeTextEntry->SetValue( UnescapeString( m_currentLabel->GetText() ) );
+ }
+
+ if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_LABEL_T )
+ {
+ // Load the combobox with the existing labels of the same type
+ std::set existingLabels;
+ SCH_SCREENS allScreens( m_Parent->Schematic().Root() );
+
+ for( SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() )
+ {
+ for( SCH_ITEM* item : screen->Items().OfType( m_currentLabel->Type() ) )
+ {
+ const SCH_TEXT* textItem = static_cast( item );
+ existingLabels.insert( UnescapeString( textItem->GetText() ) );
+ }
+ }
+
+ wxArrayString existingLabelArray;
+
+ for( const wxString& label : existingLabels )
+ existingLabelArray.push_back( label );
+
+ m_valueCombo->Append( existingLabelArray );
+ }
+ else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
+ {
+ // Load the combobox with existing existingNetclassNames
+ NET_SETTINGS& netSettings = m_Parent->Schematic().Prj().GetProjectFile().NetSettings();
+ wxArrayString existingNetclassNames;
+
+ existingNetclassNames.push_back( netSettings.m_NetClasses.GetDefault()->GetName() );
+
+ for( const std::pair& pair : netSettings.m_NetClasses )
+ existingNetclassNames.push_back( pair.second->GetName() );
+
+ m_valueCombo->Append( existingNetclassNames );
+ }
+
+ // Push a copy of each field into m_updateFields
+ for( SCH_FIELD& field : m_currentLabel->GetFields() )
+ {
+ SCH_FIELD field_copy( field );
+
+ // change offset to be symbol-relative
+ field_copy.Offset( -m_currentLabel->GetPosition() );
+
+ m_fields->push_back( field_copy );
+ }
+
+ // notify the grid
+ wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->size() );
+ m_grid->ProcessTableMessage( msg );
+ AdjustGridColumns( m_grid->GetRect().GetWidth() );
+
+ if( m_shapeSizer->AreAnyItemsShown() )
+ {
+ switch( m_currentLabel->GetShape() )
+ {
+ case LABEL_FLAG_SHAPE::L_INPUT: m_input->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::L_OUTPUT: m_output->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::L_BIDI: m_bidirectional->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::L_TRISTATE: m_triState->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::L_UNSPECIFIED: m_passive->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::F_DOT: m_dot->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::F_ROUND: m_circle->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::F_DIAMOND: m_diamond->SetValue( true ); break;
+ case LABEL_FLAG_SHAPE::F_RECTANGLE: m_rectangle->SetValue( true ); break;
+ }
+ }
+
+ if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
+ m_textSize.SetValue( static_cast( m_currentLabel )->GetPinLength() );
+ else
+ m_textSize.SetValue( m_currentLabel->GetTextWidth() );
+
+ m_bold->Check( m_currentLabel->IsBold() );
+ m_italic->Check( m_currentLabel->IsItalic() );
+
+ switch( m_currentLabel->GetLabelSpinStyle() )
+ {
+ case LABEL_SPIN_STYLE::RIGHT: m_spin0->Check( true ); break;
+ case LABEL_SPIN_STYLE::LEFT: m_spin1->Check( true ); break;
+ case LABEL_SPIN_STYLE::UP: m_spin2->Check( true ); break;
+ case LABEL_SPIN_STYLE::BOTTOM: m_spin3->Check( true ); break;
+ }
+
+ return true;
+}
+
+
+/*!
+ * wxEVT_COMMAND_ENTER event handler for single-line control
+ */
+void DIALOG_LABEL_PROPERTIES::OnEnterKey( wxCommandEvent& aEvent )
+{
+ wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
+}
+
+
+static bool positioningChanged( const SCH_FIELD& a, const SCH_FIELD& b )
+{
+ if( a.GetPosition() != b.GetPosition() )
+ return true;
+
+ if( a.GetHorizJustify() != b.GetHorizJustify() )
+ return true;
+
+ if( a.GetVertJustify() != b.GetVertJustify() )
+ return true;
+
+ if( a.GetTextAngle() != b.GetTextAngle() )
+ return true;
+
+ return false;
+}
+
+
+static bool positioningChanged( FIELDS_GRID_TABLE* a, std::vector& b )
+{
+ for( size_t i = 0; i < a->size() && i < b.size(); ++i )
+ {
+ if( positioningChanged( a->at( i ), b.at( i ) ) )
+ return true;
+ }
+
+ return false;
+}
+
+
+bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
+{
+ if( !m_grid->CommitPendingChanges() )
+ return false;
+
+ if( !wxDialog::TransferDataFromWindow() )
+ return false;
+
+ // Don't allow text to disappear; it can be difficult to correct if you can't select it
+ if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
+ return false;
+
+ wxString text;
+
+ /* save old text in undo list if not already in edit */
+ if( m_currentLabel->GetEditFlags() == 0 )
+ {
+ m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_currentLabel, UNDO_REDO::CHANGED,
+ false );
+ }
+
+ m_Parent->GetCanvas()->Refresh();
+
+ if( m_activeTextEntry )
+ {
+ // labels need escaping
+ text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
+
+#ifdef __WXMAC__
+ // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
+ text.Replace( "\r", "\n" );
+#endif
+
+ if( text.IsEmpty() && !m_currentLabel->IsNew() )
+ {
+ DisplayError( this, _( "Label can not be empty." ) );
+ return false;
+ }
+
+ m_currentLabel->SetText( text );
+ }
+
+ bool doAutoplace = false;
+
+ // change all field positions from relative to absolute
+ for( SCH_FIELD& field : *m_fields )
+ {
+ field.Offset( m_currentLabel->GetPosition() );
+
+ if( field.GetCanonicalName() == wxT( "Netclass" ) )
+ field.SetLayer( LAYER_NETCLASS_REFS );
+ else if( field.GetCanonicalName() == wxT( "Intersheetrefs" ) )
+ field.SetLayer( LAYER_INTERSHEET_REFS );
+ else
+ field.SetLayer( LAYER_FIELDS );
+ }
+
+ if( positioningChanged( m_fields, m_currentLabel->GetFields() ) )
+ m_currentLabel->ClearFieldsAutoplaced();
+ else
+ doAutoplace = true;
+
+ m_currentLabel->SetFields( *m_fields );
+
+ if( m_shapeSizer->AreAnyItemsShown() )
+ {
+ if( m_input->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
+ else if( m_output->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT );
+ else if( m_bidirectional->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_BIDI );
+ else if( m_triState->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_TRISTATE );
+ else if( m_passive->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
+ else if( m_dot->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_DOT );
+ else if( m_circle->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_ROUND );
+ else if( m_diamond->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_DIAMOND );
+ else if( m_rectangle->GetValue() )
+ m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_RECTANGLE );
+ }
+
+ if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
+ static_cast( m_currentLabel )->SetPinLength( m_textSize.GetValue() );
+ else if( m_currentLabel->GetTextWidth() != m_textSize.GetValue() )
+ m_currentLabel->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
+
+ if( m_bold->IsChecked() != m_currentLabel->IsBold() )
+ {
+ if( m_bold->IsChecked() )
+ {
+ m_currentLabel->SetBold( true );
+ m_currentLabel->SetTextThickness( GetPenSizeForBold( m_currentLabel->GetTextWidth() ) );
+ }
+ else
+ {
+ m_currentLabel->SetBold( false );
+ m_currentLabel->SetTextThickness( 0 ); // Use default pen width
+ }
+ }
+
+ m_currentLabel->SetItalic( m_italic->IsChecked() );
+
+ LABEL_SPIN_STYLE selectedSpinStyle= LABEL_SPIN_STYLE::LEFT;
+
+ if( m_spin0->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::RIGHT;
+ else if( m_spin1->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::LEFT;
+ else if( m_spin2->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::UP;
+ else if( m_spin3->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::BOTTOM;
+
+ if( m_currentLabel->GetLabelSpinStyle() != selectedSpinStyle )
+ m_currentLabel->SetLabelSpinStyle( selectedSpinStyle );
+
+ if( doAutoplace )
+ m_currentLabel->AutoAutoplaceFields( m_Parent->GetScreen() );
+
+ m_Parent->UpdateItem( m_currentLabel );
+ m_Parent->GetCanvas()->Refresh();
+ m_Parent->OnModify();
+
+ return true;
+}
+
+
+void DIALOG_LABEL_PROPERTIES::onSpinButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_spin0, m_spin1, m_spin2, m_spin3 } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
+{
+ m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnAddField( wxCommandEvent& event )
+{
+ if( !m_grid->CommitPendingChanges() )
+ return;
+
+ int fieldID = m_fields->size();
+ wxString fieldName;
+
+ if( (int) fieldID == m_currentLabel->GetMandatoryFieldCount()
+ || m_fields->at( m_fields->size()-1 ).GetCanonicalName() == wxT( "Netclass" ) )
+ {
+ fieldName = wxT( "Netclass" );
+ }
+ else
+ {
+ fieldName = SCH_LABEL_BASE::GetDefaultFieldName( fieldName, true );
+ }
+
+ SCH_FIELD newField( wxPoint( 0, 0 ), fieldID, m_currentLabel, fieldName );
+
+ if( m_fields->size() > 0 )
+ {
+ newField.SetVisible( m_fields->at( m_fields->size() - 1 ).IsVisible() );
+ newField.SetTextAngle( m_fields->at( m_fields->size() - 1 ).GetTextAngle() );
+ newField.SetItalic( m_fields->at( m_fields->size() - 1 ).IsItalic() );
+ newField.SetBold( m_fields->at( m_fields->size() - 1 ).IsBold() );
+ }
+ else
+ {
+ newField.SetVisible( true );
+ newField.SetItalic( true );
+ }
+
+ m_fields->push_back( newField );
+
+ // notify the grid
+ wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
+ m_grid->ProcessTableMessage( msg );
+
+ m_grid->MakeCellVisible( m_fields->size() - 1, 0 );
+ m_grid->SetGridCursor( m_fields->size() - 1, fieldName == wxT( "Netclass" ) ? 1 : 0 );
+
+ m_grid->EnableCellEditControl();
+ m_grid->ShowCellEditControl();
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnDeleteField( wxCommandEvent& event )
+{
+ wxArrayInt selectedRows = m_grid->GetSelectedRows();
+
+ if( selectedRows.empty() && m_grid->GetGridCursorRow() >= 0 )
+ selectedRows.push_back( m_grid->GetGridCursorRow() );
+
+ if( selectedRows.empty() )
+ return;
+
+ for( int row : selectedRows )
+ {
+ if( row < m_currentLabel->GetMandatoryFieldCount() )
+ {
+ DisplayError( this, _( "The first field is mandatory." ) );
+ return;
+ }
+ }
+
+ m_grid->CommitPendingChanges( true /* quiet mode */ );
+
+ // Reverse sort so deleting a row doesn't change the indexes of the other rows.
+ selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
+
+ for( int row : selectedRows )
+ {
+ m_fields->erase( m_fields->begin() + row );
+
+ // notify the grid
+ wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
+ m_grid->ProcessTableMessage( msg );
+
+ if( m_grid->GetNumberRows() > 0 )
+ {
+ m_grid->MakeCellVisible( std::max( 0, row-1 ), m_grid->GetGridCursorCol() );
+ m_grid->SetGridCursor( std::max( 0, row-1 ), m_grid->GetGridCursorCol() );
+ }
+ }
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnMoveUp( wxCommandEvent& event )
+{
+ if( !m_grid->CommitPendingChanges() )
+ return;
+
+ int i = m_grid->GetGridCursorRow();
+
+ if( i > m_currentLabel->GetMandatoryFieldCount() )
+ {
+ SCH_FIELD tmp = m_fields->at( (unsigned) i );
+ m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
+ m_fields->insert( m_fields->begin() + i - 1, tmp );
+ m_grid->ForceRefresh();
+
+ m_grid->SetGridCursor( i - 1, m_grid->GetGridCursorCol() );
+ m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
+ }
+ else
+ {
+ wxBell();
+ }
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnMoveDown( wxCommandEvent& event )
+{
+ if( !m_grid->CommitPendingChanges() )
+ return;
+
+ int i = m_grid->GetGridCursorRow();
+
+ if( i >= m_currentLabel->GetMandatoryFieldCount() && i < m_grid->GetNumberRows() - 1 )
+ {
+ SCH_FIELD tmp = m_fields->at( (unsigned) i );
+ m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
+ m_fields->insert( m_fields->begin() + i + 1, tmp );
+ m_grid->ForceRefresh();
+
+ m_grid->SetGridCursor( i + 1, m_grid->GetGridCursorCol() );
+ m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
+ }
+ else
+ {
+ wxBell();
+ }
+}
+
+
+void DIALOG_LABEL_PROPERTIES::AdjustGridColumns( int aWidth )
+{
+ m_width = aWidth;
+ // Account for scroll bars
+ aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x );
+
+ m_grid->AutoSizeColumn( 0 );
+ m_grid->SetColSize( 0, std::max( m_grid->GetColSize( 0 ), 72 ) );
+
+ int fixedColsWidth = m_grid->GetColSize( 0 );
+
+ for( int i = 2; i < m_grid->GetNumberCols(); i++ )
+ fixedColsWidth += m_grid->GetColSize( i );
+
+ m_grid->SetColSize( 1, std::max( aWidth - fixedColsWidth, 120 ) );
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
+{
+ wxString shownColumns = m_grid->GetShownColumns();
+
+ if( shownColumns != m_shownColumns )
+ {
+ m_shownColumns = shownColumns;
+
+ if( !m_grid->IsCellEditControlShown() )
+ AdjustGridColumns( m_grid->GetRect().GetWidth() );
+ }
+
+ // Handle a delayed focus
+ if( m_delayedFocusRow >= 0 && m_delayedFocusRow < m_grid->GetNumberRows() )
+ {
+ m_grid->SetFocus();
+ m_grid->MakeCellVisible( m_delayedFocusRow, m_delayedFocusColumn );
+ m_grid->SetGridCursor( m_delayedFocusRow, m_delayedFocusColumn );
+
+ m_grid->EnableCellEditControl( true );
+ m_grid->ShowCellEditControl();
+ }
+
+ m_delayedFocusRow = -1;
+ m_delayedFocusColumn = -1;
+}
+
+
+void DIALOG_LABEL_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
+{
+ int new_size = event.GetSize().GetX();
+
+ if( m_width != new_size )
+ AdjustGridColumns( new_size );
+
+ // Always propagate for a grid repaint (needed if the height changes, as well as width)
+ event.Skip();
+}
+
+
diff --git a/eeschema/dialogs/dialog_label_properties.h b/eeschema/dialogs/dialog_label_properties.h
new file mode 100644
index 0000000000..b45b2477a7
--- /dev/null
+++ b/eeschema/dialogs/dialog_label_properties.h
@@ -0,0 +1,84 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * 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
+ */
+
+#ifndef DIALOG_LABEL_PROPERTIES_H
+#define DIALOG_LABEL_PROPERTIES_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+class SCH_EDIT_FRAME;
+class SCH_TEXT;
+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();
+
+private:
+ void OnEnterKey( wxCommandEvent& aEvent ) override;
+ void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
+
+ void onSpinButton( wxCommandEvent &aEvent );
+
+ // event handlers
+ void OnAddField( wxCommandEvent& event ) override;
+ void OnDeleteField( wxCommandEvent& event ) override;
+ void OnMoveUp( wxCommandEvent& event ) override;
+ void OnMoveDown( wxCommandEvent& event ) override;
+ void OnSizeGrid( wxSizeEvent& event ) override;
+ void OnUpdateUI( wxUpdateUIEvent& event ) override;
+
+ void AdjustGridColumns( int aWidth );
+
+ bool TransferDataToWindow() override;
+ bool TransferDataFromWindow() override;
+
+private:
+ SCH_EDIT_FRAME* m_Parent;
+ int m_width;
+ int m_delayedFocusRow;
+ int m_delayedFocusColumn;
+
+ SCH_LABEL_BASE* m_currentLabel;
+ wxTextEntry* m_activeTextEntry;
+ SCH_NETNAME_VALIDATOR m_netNameValidator;
+
+ FIELDS_GRID_TABLE* m_fields;
+ wxString m_shownColumns;
+
+ UNIT_BINDER m_textSize;
+
+ HTML_MESSAGE_BOX* m_helpWindow;
+};
+
+
+
+#endif // DIALOG_LABEL_PROPERTIES_H
diff --git a/eeschema/dialogs/dialog_label_properties_base.cpp b/eeschema/dialogs/dialog_label_properties_base.cpp
new file mode 100644
index 0000000000..5470d2aeaf
--- /dev/null
+++ b/eeschema/dialogs/dialog_label_properties_base.cpp
@@ -0,0 +1,283 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO *NOT* EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "widgets/bitmap_button.h"
+#include "widgets/wx_grid.h"
+
+#include "dialog_label_properties_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bMainSizer;
+ bMainSizer = new wxBoxSizer( wxVERTICAL );
+
+ m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 3 );
+ m_textEntrySizer->AddGrowableCol( 1 );
+ m_textEntrySizer->AddGrowableRow( 1 );
+ m_textEntrySizer->SetFlexibleDirection( wxBOTH );
+ m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_labelSingleLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_labelSingleLine->Wrap( -1 );
+ m_labelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
+
+ m_textEntrySizer->Add( m_labelSingleLine, 0, wxALIGN_CENTER_VERTICAL, 2 );
+
+ m_valueSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
+ m_textEntrySizer->Add( m_valueSingleLine, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 2 );
+
+ m_labelCombo = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_labelCombo->Wrap( -1 );
+ m_textEntrySizer->Add( m_labelCombo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ 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_textEntrySizer->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
+ m_syntaxHelp->SetToolTip( _("Show syntax help window") );
+
+ m_textEntrySizer->Add( m_syntaxHelp, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
+
+
+ bMainSizer->Add( m_textEntrySizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
+
+ wxStaticBoxSizer* sbFields;
+ sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxVERTICAL );
+
+ m_grid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
+
+ // Grid
+ m_grid->CreateGrid( 4, 11 );
+ m_grid->EnableEditing( true );
+ m_grid->EnableGridLines( true );
+ m_grid->EnableDragGridSize( false );
+ m_grid->SetMargins( 0, 0 );
+
+ // Columns
+ m_grid->SetColSize( 0, 72 );
+ m_grid->SetColSize( 1, 84 );
+ m_grid->SetColSize( 2, 48 );
+ m_grid->SetColSize( 3, 72 );
+ m_grid->SetColSize( 4, 72 );
+ m_grid->SetColSize( 5, 48 );
+ m_grid->SetColSize( 6, 48 );
+ m_grid->SetColSize( 7, 84 );
+ m_grid->SetColSize( 8, 48 );
+ m_grid->SetColSize( 9, 84 );
+ m_grid->SetColSize( 10, 84 );
+ m_grid->EnableDragColMove( false );
+ m_grid->EnableDragColSize( true );
+ m_grid->SetColLabelSize( 22 );
+ m_grid->SetColLabelValue( 0, _("Name") );
+ m_grid->SetColLabelValue( 1, _("Value") );
+ m_grid->SetColLabelValue( 2, _("Show") );
+ m_grid->SetColLabelValue( 3, _("H Align") );
+ m_grid->SetColLabelValue( 4, _("V Align") );
+ m_grid->SetColLabelValue( 5, _("Italic") );
+ m_grid->SetColLabelValue( 6, _("Bold") );
+ m_grid->SetColLabelValue( 7, _("Text Size") );
+ m_grid->SetColLabelValue( 8, _("Orientation") );
+ m_grid->SetColLabelValue( 9, _("X Position") );
+ m_grid->SetColLabelValue( 10, _("Y Position") );
+ m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
+
+ // Rows
+ m_grid->EnableDragRowSize( true );
+ m_grid->SetRowLabelSize( 0 );
+ m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
+
+ // Label Appearance
+
+ // Cell Defaults
+ m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
+ m_grid->SetMinSize( wxSize( -1,100 ) );
+
+ sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
+
+ wxBoxSizer* bButtonSize;
+ bButtonSize = new wxBoxSizer( wxHORIZONTAL );
+
+ m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
+ m_bpAdd->SetToolTip( _("Add field") );
+
+ bButtonSize->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
+ m_bpMoveUp->SetToolTip( _("Move up") );
+
+ bButtonSize->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
+ m_bpMoveDown->SetToolTip( _("Move down") );
+
+ bButtonSize->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+
+ bButtonSize->Add( 20, 0, 0, wxEXPAND, 10 );
+
+ m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
+ m_bpDelete->SetToolTip( _("Delete field") );
+
+ bButtonSize->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
+
+
+ sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
+
+
+ bMainSizer->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
+
+ wxBoxSizer* optionsSizer;
+ optionsSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ m_shapeSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Shape") ), wxVERTICAL );
+
+ m_input = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Input"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_input, 0, wxBOTTOM|wxRIGHT, 2 );
+
+ m_output = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Output"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_output, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_bidirectional = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Bidirectional"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_bidirectional, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_triState = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Tri-state"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_triState, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_passive = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Passive"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_passive, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_dot = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Dot"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_dot, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_circle = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Circle"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_circle, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_diamond = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Diamond"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_diamond, 0, wxBOTTOM|wxRIGHT, 3 );
+
+ m_rectangle = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Rectangle"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_shapeSizer->Add( m_rectangle, 0, wxBOTTOM|wxRIGHT, 3 );
+
+
+ optionsSizer->Add( m_shapeSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
+
+ wxStaticBoxSizer* formatting;
+ formatting = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Formatting") ), wxVERTICAL );
+
+ wxBoxSizer* formattingSizer;
+ formattingSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ m_textSizeLabel = new wxStaticText( formatting->GetStaticBox(), wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textSizeLabel->Wrap( -1 );
+ formattingSizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ m_textSizeCtrl = new wxTextCtrl( formatting->GetStaticBox(), wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ formattingSizer->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_textSizeUnits = new wxStaticText( formatting->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textSizeUnits->Wrap( -1 );
+ formattingSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 2 );
+
+ m_separator1 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator1->Enable( false );
+
+ formattingSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
+
+ m_bold = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_bold->SetToolTip( _("Bold") );
+
+ formattingSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_italic = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_italic->SetToolTip( _("Italic") );
+
+ formattingSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator2 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator2->Enable( false );
+
+ formattingSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin0 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ formattingSizer->Add( m_spin0, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin1 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ formattingSizer->Add( m_spin1, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin2 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ formattingSizer->Add( m_spin2, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ formattingSizer->Add( m_spin3, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator3->Enable( false );
+
+ formattingSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ formatting->Add( formattingSizer, 0, wxEXPAND|wxBOTTOM, 5 );
+
+
+ optionsSizer->Add( formatting, 1, wxEXPAND|wxTOP, 5 );
+
+
+ bMainSizer->Add( optionsSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
+
+ wxBoxSizer* bSizer4;
+ bSizer4 = new wxBoxSizer( wxHORIZONTAL );
+
+ 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();
+
+ bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
+
+
+ bMainSizer->Add( bSizer4, 0, wxEXPAND, 5 );
+
+
+ this->SetSizer( bMainSizer );
+ this->Layout();
+ bMainSizer->Fit( this );
+
+ // Connect Events
+ this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnUpdateUI ) );
+ m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
+ m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), 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 );
+ m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveUp ), NULL, this );
+ m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveDown ), NULL, this );
+ m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnDeleteField ), NULL, this );
+}
+
+DIALOG_LABEL_PROPERTIES_BASE::~DIALOG_LABEL_PROPERTIES_BASE()
+{
+ // Disconnect Events
+ this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnUpdateUI ) );
+ m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
+ m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), 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 );
+ m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveUp ), NULL, this );
+ m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveDown ), NULL, this );
+ m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnDeleteField ), NULL, this );
+
+}
diff --git a/eeschema/dialogs/dialog_label_properties_base.fbp b/eeschema/dialogs/dialog_label_properties_base.fbp
new file mode 100644
index 0000000000..b36cf5d125
--- /dev/null
+++ b/eeschema/dialogs/dialog_label_properties_base.fbp
@@ -0,0 +1,2315 @@
+
+
+
+
+
diff --git a/eeschema/dialogs/dialog_label_properties_base.h b/eeschema/dialogs/dialog_label_properties_base.h
new file mode 100644
index 0000000000..3a0d557a69
--- /dev/null
+++ b/eeschema/dialogs/dialog_label_properties_base.h
@@ -0,0 +1,107 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO *NOT* EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include
+#include
+#include
+class BITMAP_BUTTON;
+class WX_GRID;
+
+#include "dialog_shim.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DIALOG_LABEL_PROPERTIES_BASE
+///////////////////////////////////////////////////////////////////////////////
+class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
+{
+ private:
+
+ protected:
+ enum
+ {
+ wxID_VALUESINGLE = 1000,
+ wxID_SIZE
+ };
+
+ wxFlexGridSizer* m_textEntrySizer;
+ wxStaticText* m_labelSingleLine;
+ wxTextCtrl* m_valueSingleLine;
+ wxStaticText* m_labelCombo;
+ wxComboBox* m_valueCombo;
+ wxHyperlinkCtrl* m_syntaxHelp;
+ WX_GRID* m_grid;
+ wxBitmapButton* m_bpAdd;
+ wxBitmapButton* m_bpMoveUp;
+ wxBitmapButton* m_bpMoveDown;
+ wxBitmapButton* m_bpDelete;
+ wxStaticBoxSizer* m_shapeSizer;
+ wxRadioButton* m_input;
+ wxRadioButton* m_output;
+ wxRadioButton* m_bidirectional;
+ wxRadioButton* m_triState;
+ wxRadioButton* m_passive;
+ wxRadioButton* m_dot;
+ wxRadioButton* m_circle;
+ wxRadioButton* m_diamond;
+ wxRadioButton* m_rectangle;
+ wxStaticText* m_textSizeLabel;
+ wxTextCtrl* m_textSizeCtrl;
+ wxStaticText* m_textSizeUnits;
+ BITMAP_BUTTON* m_separator1;
+ BITMAP_BUTTON* m_bold;
+ BITMAP_BUTTON* m_italic;
+ BITMAP_BUTTON* m_separator2;
+ BITMAP_BUTTON* m_spin0;
+ BITMAP_BUTTON* m_spin1;
+ BITMAP_BUTTON* m_spin2;
+ BITMAP_BUTTON* m_spin3;
+ BITMAP_BUTTON* m_separator3;
+ wxStdDialogButtonSizer* m_sdbSizer1;
+ wxButton* m_sdbSizer1OK;
+ wxButton* m_sdbSizer1Cancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
+ virtual void OnEnterKey( 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(); }
+ virtual void OnMoveUp( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnMoveDown( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnDeleteField( wxCommandEvent& event ) { event.Skip(); }
+
+
+ public:
+
+ DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Label Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_LABEL_PROPERTIES_BASE();
+
+};
+
diff --git a/eeschema/dialogs/dialog_lib_text_properties.cpp b/eeschema/dialogs/dialog_lib_text_properties.cpp
index 039c551a05..6065731fea 100644
--- a/eeschema/dialogs/dialog_lib_text_properties.cpp
+++ b/eeschema/dialogs/dialog_lib_text_properties.cpp
@@ -22,12 +22,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include
#include
#include
#include
#include
#include
#include
+#include
DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent,
@@ -40,6 +42,12 @@ DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aPare
m_parent = aParent;
m_graphicText = aText;
+ m_scintillaTricks = new SCINTILLA_TRICKS( m_StyledTextCtrl, wxT( "{}" ), false,
+ [this]()
+ {
+ wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
+ } );
+
// Disable options for fieldedit, not existing in graphic text
m_visible->Show( false );
m_TextValueSelectButton->Hide();
@@ -61,11 +69,62 @@ DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aPare
m_sdbSizerButtonsOK->SetDefault();
}
+ m_separator1->SetIsSeparator();
+
+ m_horizontal->SetIsCheckButton();
+ m_horizontal->SetBitmap( KiBitmap( BITMAPS::text_horizontal ) );
+ m_vertical->SetIsCheckButton();
+ m_vertical->SetBitmap( KiBitmap( BITMAPS::text_vertical ) );
+
+ m_separator2->SetIsSeparator();
+
+ m_bold->SetIsCheckButton();
+ m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
+ m_italic->SetIsCheckButton();
+ m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
+
+ m_separator3->SetIsSeparator();
+
+ m_hAlignLeft->SetIsCheckButton();
+ m_hAlignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
+ m_hAlignCenter->SetIsCheckButton();
+ m_hAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) );
+ m_hAlignRight->SetIsCheckButton();
+ m_hAlignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
+
+ m_separator4->SetIsSeparator();
+
+ m_vAlignTop->SetIsCheckButton();
+ m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) );
+ m_vAlignCenter->SetIsCheckButton();
+ m_vAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) );
+ m_vAlignBottom->SetIsCheckButton();
+ m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) );
+
+ m_separator5->SetIsSeparator();
+
+ m_horizontal->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onOrientButton, this );
+ m_vertical->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onOrientButton, this );
+
+ m_hAlignLeft->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
+ m_hAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
+ m_hAlignRight->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
+
+ m_vAlignTop->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
+ m_vAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
+ m_vAlignBottom->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
+
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
+DIALOG_LIB_TEXT_PROPERTIES::~DIALOG_LIB_TEXT_PROPERTIES()
+{
+ delete m_scintillaTricks;
+};
+
+
bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
{
if( m_graphicText )
@@ -75,24 +134,28 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
m_textSize.SetValue( m_graphicText->GetTextWidth() );
m_TextCtrl->SetValue( m_graphicText->GetText() );
- m_italic->SetValue( m_graphicText->IsItalic() );
- m_bold->SetValue( m_graphicText->IsBold() );
+ m_italic->Check( m_graphicText->IsItalic() );
+ m_bold->Check( m_graphicText->IsBold() );
m_CommonUnit->SetValue( m_graphicText->GetUnit() == 0 );
m_CommonConvert->SetValue( m_graphicText->GetConvert() == 0 );
- m_orientChoice->SetSelection( m_graphicText->GetTextAngle() == TEXT_ANGLE_HORIZ ? 0 : 1 );
+
+ if( m_graphicText->GetTextAngle() == TEXT_ANGLE_HORIZ )
+ m_horizontal->Check();
+ else
+ m_vertical->Check();
switch ( m_graphicText->GetHorizJustify() )
{
- case GR_TEXT_HJUSTIFY_LEFT: m_hAlignChoice->SetSelection( 0 ); break;
- case GR_TEXT_HJUSTIFY_CENTER: m_hAlignChoice->SetSelection( 1 ); break;
- case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignChoice->SetSelection( 2 ); break;
+ case GR_TEXT_HJUSTIFY_LEFT: m_hAlignLeft->Check( true ); break;
+ case GR_TEXT_HJUSTIFY_CENTER: m_hAlignCenter->Check( true ); break;
+ case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignRight->Check( true ); break;
}
switch ( m_graphicText->GetVertJustify() )
{
- case GR_TEXT_VJUSTIFY_TOP: m_vAlignChoice->SetSelection( 0 ); break;
- case GR_TEXT_VJUSTIFY_CENTER: m_vAlignChoice->SetSelection( 1 ); break;
- case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignChoice->SetSelection( 2 ); break;
+ case GR_TEXT_VJUSTIFY_TOP: m_vAlignTop->Check( true ); break;
+ case GR_TEXT_VJUSTIFY_CENTER: m_vAlignCenter->Check( true ); break;
+ case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignBottom->Check( true ); break;
}
}
else
@@ -104,13 +167,47 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
m_CommonUnit->SetValue( !tools->GetDrawSpecificUnit() );
m_CommonConvert->SetValue( !tools->GetDrawSpecificConvert() );
- m_orientChoice->SetSelection( tools->GetLastTextAngle() == TEXT_ANGLE_HORIZ ? 0 : 1 );
+
+ if( tools->GetLastTextAngle() == TEXT_ANGLE_HORIZ )
+ m_horizontal->Check();
+ else
+ m_vertical->Check();
}
return true;
}
+void DIALOG_LIB_TEXT_PROPERTIES::onOrientButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_horizontal, m_vertical } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+void DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_hAlignLeft, m_hAlignCenter, m_hAlignRight } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+void DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignTop, m_vAlignBottom } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
{
if( m_graphicText )
@@ -125,8 +222,10 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
if( m_textSize.GetValue() != m_graphicText->GetTextWidth() )
m_graphicText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
- m_graphicText->SetTextAngle( m_orientChoice->GetSelection() ? TEXT_ANGLE_VERT
- : TEXT_ANGLE_HORIZ );
+ if( m_horizontal->IsChecked() )
+ m_graphicText->SetTextAngle( TEXT_ANGLE_HORIZ );
+ else
+ m_graphicText->SetTextAngle( TEXT_ANGLE_VERT );
if( !m_CommonUnit->GetValue() )
m_graphicText->SetUnit( m_parent->GetUnit() );
@@ -138,22 +237,22 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
else
m_graphicText->SetConvert( 0 );
- m_graphicText->SetItalic( m_italic->GetValue() );
- m_graphicText->SetBold( m_bold->GetValue() );
+ m_graphicText->SetItalic( m_italic->IsChecked() );
+ m_graphicText->SetBold( m_bold->IsChecked() );
- switch( m_hAlignChoice->GetSelection() )
- {
- case 0: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); break;
- case 1: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); break;
- case 2: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); break;
- }
+ if( m_hAlignLeft->IsChecked() )
+ m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
+ else if( m_hAlignCenter->IsChecked() )
+ m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
+ else
+ m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
- switch( m_vAlignChoice->GetSelection() )
- {
- case 0: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); break;
- case 1: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); break;
- case 2: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); break;
- }
+ if( m_vAlignTop->IsChecked() )
+ m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
+ else if( m_vAlignCenter->IsChecked() )
+ m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
+ else
+ m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
// Record settings used for next time:
auto* tools = m_parent->GetToolManager()->GetTool();
@@ -166,3 +265,12 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
return true;
}
+
+
+void DIALOG_LIB_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
+{
+ if( m_scintillaTricks )
+ m_scintillaTricks->CancelAutocomplete();
+
+ event.Skip();
+}
diff --git a/eeschema/dialogs/dialog_lib_text_properties.h b/eeschema/dialogs/dialog_lib_text_properties.h
index c8b2551f38..f268446352 100644
--- a/eeschema/dialogs/dialog_lib_text_properties.h
+++ b/eeschema/dialogs/dialog_lib_text_properties.h
@@ -30,6 +30,7 @@
#include
class SYMBOL_EDIT_FRAME;
+class SCINTILLA_TRICKS;
class LIB_TEXT;
@@ -37,9 +38,14 @@ class DIALOG_LIB_TEXT_PROPERTIES : public DIALOG_LIB_TEXT_PROPERTIES_BASE
{
public:
DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent, LIB_TEXT* aText );
- ~DIALOG_LIB_TEXT_PROPERTIES() override {};
+ ~DIALOG_LIB_TEXT_PROPERTIES() override;
private:
+ void onOrientButton( wxCommandEvent &aEvent );
+ void onHAlignButton( wxCommandEvent &aEvent );
+ void onVAlignButton( wxCommandEvent &aEvent );
+ void onMultiLineTCLostFocus( wxFocusEvent& event ) override;
+
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
@@ -49,6 +55,7 @@ private:
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_textSize;
+ SCINTILLA_TRICKS* m_scintillaTricks;
};
diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.cpp b/eeschema/dialogs/dialog_lib_text_properties_base.cpp
index a975ee735d..e4fce157ec 100644
--- a/eeschema/dialogs/dialog_lib_text_properties_base.cpp
+++ b/eeschema/dialogs/dialog_lib_text_properties_base.cpp
@@ -5,6 +5,8 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
+#include "widgets/bitmap_button.h"
+
#include "dialog_lib_text_properties_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -86,99 +88,141 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
bPropertiesSizer->Add( bSizer9, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizer3;
- fgSizer3 = new wxFlexGridSizer( 0, 8, 3, 3 );
+ fgSizer3 = new wxFlexGridSizer( 0, 4, 3, 3 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
- m_xPosLabel = new wxStaticText( this, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_xPosLabel->Wrap( -1 );
- fgSizer3->Add( m_xPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
-
- m_xPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer3->Add( m_xPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 );
-
- m_xPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
- m_xPosUnits->Wrap( -1 );
- fgSizer3->Add( m_xPosUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
-
-
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
-
- m_italic = new wxCheckBox( this, wxID_ANY, _("Italic"), wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer3->Add( m_italic, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
-
-
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
-
- m_orientLabel = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_orientLabel->Wrap( -1 );
- fgSizer3->Add( m_orientLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
-
- wxString m_orientChoiceChoices[] = { _("Horizontal"), _("Vertical") };
- int m_orientChoiceNChoices = sizeof( m_orientChoiceChoices ) / sizeof( wxString );
- m_orientChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_orientChoiceNChoices, m_orientChoiceChoices, 0 );
- m_orientChoice->SetSelection( 0 );
- fgSizer3->Add( m_orientChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
-
- m_yPosLabel = new wxStaticText( this, wxID_ANY, _("Position Y:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_yPosLabel->Wrap( -1 );
- fgSizer3->Add( m_yPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
-
- m_yPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer3->Add( m_yPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 );
-
- m_yPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
- m_yPosUnits->Wrap( -1 );
- fgSizer3->Add( m_yPosUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
-
-
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
-
- m_bold = new wxCheckBox( this, wxID_ANY, _("Bold"), wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer3->Add( m_bold, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
-
-
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
-
- m_hAlignLabel = new wxStaticText( this, wxID_ANY, _("H Align:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_hAlignLabel->Wrap( -1 );
- fgSizer3->Add( m_hAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
-
- wxString m_hAlignChoiceChoices[] = { _("Left"), _("Center"), _("Right") };
- int m_hAlignChoiceNChoices = sizeof( m_hAlignChoiceChoices ) / sizeof( wxString );
- m_hAlignChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_hAlignChoiceNChoices, m_hAlignChoiceChoices, 0 );
- m_hAlignChoice->SetSelection( 0 );
- fgSizer3->Add( m_hAlignChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
-
m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );
fgSizer3->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer3->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
+ fgSizer3->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeUnits->Wrap( -1 );
- fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+ fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ wxBoxSizer* formattingSizer;
+ formattingSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ m_separator1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator1->Enable( false );
+
+ formattingSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
+
+ m_horizontal = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_horizontal->SetToolTip( _("Horizontal text") );
+
+ formattingSizer->Add( m_horizontal, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_vertical = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_vertical->SetToolTip( _("Vertical text") );
+
+ formattingSizer->Add( m_vertical, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator2->Enable( false );
+
+ formattingSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_bold = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_bold->SetToolTip( _("Bold") );
+
+ formattingSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_italic = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_italic->SetToolTip( _("Italic") );
+
+ formattingSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator3->Enable( false );
+
+ formattingSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_hAlignLeft = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_hAlignLeft->SetToolTip( _("Align left") );
+
+ formattingSizer->Add( m_hAlignLeft, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_hAlignCenter = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_hAlignCenter->SetToolTip( _("Align horizontal center") );
+
+ formattingSizer->Add( m_hAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_hAlignRight = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_hAlignRight->SetToolTip( _("Align right") );
+
+ formattingSizer->Add( m_hAlignRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator4 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator4->Enable( false );
+
+ formattingSizer->Add( m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_vAlignTop = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_vAlignTop->SetToolTip( _("Align top") );
+
+ formattingSizer->Add( m_vAlignTop, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_vAlignCenter = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_vAlignCenter->SetToolTip( _("Align vertical center") );
+
+ formattingSizer->Add( m_vAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_vAlignBottom = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_vAlignBottom->SetToolTip( _("Align bottom") );
+
+ formattingSizer->Add( m_vAlignBottom, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator5 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator5->Enable( false );
+
+ formattingSizer->Add( m_separator5, 0, wxALIGN_CENTER_VERTICAL, 5 );
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
+ fgSizer3->Add( formattingSizer, 1, wxEXPAND|wxRIGHT, 5 );
- fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
+ fgSizer3->Add( 0, 10, 1, wxEXPAND, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
- m_vAlignLabel = new wxStaticText( this, wxID_ANY, _("V Align:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_vAlignLabel->Wrap( -1 );
- fgSizer3->Add( m_vAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
- wxString m_vAlignChoiceChoices[] = { _("Top"), _("Center"), _("Bottom") };
- int m_vAlignChoiceNChoices = sizeof( m_vAlignChoiceChoices ) / sizeof( wxString );
- m_vAlignChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_vAlignChoiceNChoices, m_vAlignChoiceChoices, 0 );
- m_vAlignChoice->SetSelection( 0 );
- fgSizer3->Add( m_vAlignChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
+ fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
+
+
+ fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ m_xPosLabel = new wxStaticText( this, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_xPosLabel->Wrap( -1 );
+ fgSizer3->Add( m_xPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
+
+ m_xPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_xPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
+
+ m_xPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_xPosUnits->Wrap( -1 );
+ fgSizer3->Add( m_xPosUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_CommonUnit, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 80 );
+
+ m_yPosLabel = new wxStaticText( this, wxID_ANY, _("Position Y:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_yPosLabel->Wrap( -1 );
+ fgSizer3->Add( m_yPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
+
+ m_yPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_yPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
+
+ m_yPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_yPosUnits->Wrap( -1 );
+ fgSizer3->Add( m_yPosUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_CommonConvert, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 80 );
bPropertiesSizer->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -186,12 +230,6 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
wxBoxSizer* bBottomtBoxSizer;
bBottomtBoxSizer = new wxBoxSizer( wxVERTICAL );
- m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
- bBottomtBoxSizer->Add( m_CommonUnit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
-
- m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
- bBottomtBoxSizer->Add( m_CommonConvert, 0, wxLEFT|wxRIGHT, 5 );
-
bPropertiesSizer->Add( bBottomtBoxSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
@@ -218,6 +256,7 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnCloseDialog ) );
m_TextCtrl->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
+ m_StyledTextCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_StyledTextCtrl->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_TextValueSelectButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnTextValueSelectButtonClick ), NULL, this );
}
@@ -227,6 +266,7 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::~DIALOG_LIB_TEXT_PROPERTIES_BASE()
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnCloseDialog ) );
m_TextCtrl->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
+ m_StyledTextCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_StyledTextCtrl->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_TextValueSelectButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnTextValueSelectButtonClick ), NULL, this );
diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.fbp b/eeschema/dialogs/dialog_lib_text_properties_base.fbp
index 5fcd5cdeff..f071c225f9 100644
--- a/eeschema/dialogs/dialog_lib_text_properties_base.fbp
+++ b/eeschema/dialogs/dialog_lib_text_properties_base.fbp
@@ -276,6 +276,7 @@
wxBORDER_SUNKEN
+ onMultiLineTCLostFocus
OnSetFocusText
@@ -497,7 +498,7 @@
wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT
0
- 8
+ 4
wxBOTH
@@ -508,6 +509,1323 @@
none
0
3
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Text size:
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_textSizeLabel
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+ 5
+ wxEXPAND|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+ 0
+
+ 0
+
+ 1
+ m_textSizeCtrl
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ unit
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_textSizeUnits
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+ ; forward_declare
+ 0
+
+
+
+
+ -1
+
+
+
+ 5
+ wxEXPAND|wxRIGHT
+ 1
+
+
+ formattingSizer
+ wxHORIZONTAL
+ none
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_separator1
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Horizontal text
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_horizontal
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Horizontal text
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Vertical text
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_vertical
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Vertical text
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_separator2
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Bold
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_bold
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Bold
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Italic
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_italic
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Italic
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_separator3
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align left
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_hAlignLeft
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align left
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align center
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_hAlignCenter
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align horizontal center
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align right
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_hAlignRight
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align right
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_separator4
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align top
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_vAlignTop
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align top
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align vertical center
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_vAlignCenter
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align vertical center
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align bottom
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_vAlignBottom
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align bottom
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+ -1,-1
+
+ 0
+
+ 1
+ m_separator5
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 10
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
5
wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
@@ -571,7 +1889,7 @@
5
- wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND
+ wxALIGN_CENTER_VERTICAL|wxEXPAND
0
1
@@ -635,7 +1953,7 @@
5
- wxALIGN_CENTER_VERTICAL|wxRIGHT
+ wxALIGN_CENTER_VERTICAL
0
1
@@ -694,21 +2012,11 @@
-1
-
- 5
- wxEXPAND|wxRIGHT|wxLEFT
+
+ 80
+ wxALIGN_CENTER_VERTICAL|wxLEFT
0
-
- 0
- protected
- 0
-
-
-
- 8
- wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL
- 0
-
+
1
1
1
@@ -737,7 +2045,7 @@
0
0
wxID_ANY
- Italic
+ Common to all units
0
@@ -745,7 +2053,7 @@
0
1
- m_italic
+ m_CommonUnit
1
@@ -756,142 +2064,7 @@
1
- ; forward_declare
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
- 5
- wxEXPAND|wxRIGHT|wxLEFT
- 0
-
- 0
- protected
- 0
-
-
-
- 10
- wxALIGN_CENTER_VERTICAL|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Orientation:
- 0
-
- 0
-
-
- 0
-
- 1
- m_orientLabel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Horizontal" "Vertical"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
-
- 0
-
- 1
- m_orientChoice
- 1
-
-
- protected
- 1
-
- Resizable
- 0
- 1
-
-
- ; forward_declare
+
0
@@ -966,7 +2139,7 @@
5
- wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND
+ wxALIGN_CENTER_VERTICAL|wxEXPAND
0
1
@@ -1030,7 +2203,7 @@
5
- wxALIGN_CENTER_VERTICAL|wxRIGHT
+ wxALIGN_CENTER_VERTICAL
0
1
@@ -1089,635 +2262,10 @@
-1
-
- 5
- wxEXPAND|wxRIGHT|wxLEFT
- 0
-
- 0
- protected
- 0
-
-
-
- 8
- wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Bold
-
- 0
-
-
- 0
-
- 1
- m_bold
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
- 5
- wxEXPAND|wxRIGHT|wxLEFT
- 0
-
- 0
- protected
- 0
-
-
-
- 10
- wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- H Align:
- 0
-
- 0
-
-
- 0
-
- 1
- m_hAlignLabel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Left" "Center" "Right"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
-
- 0
-
- 1
- m_hAlignChoice
- 1
-
-
- protected
- 1
-
- Resizable
- 0
- 1
-
-
- ; forward_declare
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
- 5
+ 80
wxALIGN_CENTER_VERTICAL|wxLEFT
0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Text size:
- 0
-
- 0
-
-
- 0
-
- 1
- m_textSizeLabel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
- 0
-
- 0
-
- 1
- m_textSizeCtrl
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
-
- 5
- wxALIGN_CENTER_VERTICAL|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- unit
- 0
-
- 0
-
-
- 0
-
- 1
- m_textSizeUnits
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 10
- wxEXPAND|wxRIGHT|wxLEFT
- 0
-
- 0
- protected
- 0
-
-
-
- 10
- wxEXPAND|wxRIGHT|wxLEFT
- 0
-
- 0
- protected
- 0
-
-
-
- 5
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
- 10
- wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- V Align:
- 0
-
- 0
-
-
- 0
-
- 1
- m_vAlignLabel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Top" "Center" "Bottom"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
-
- 0
-
- 1
- m_vAlignChoice
- 1
-
-
- protected
- 1
-
- Resizable
- 0
- 1
-
-
- ; forward_declare
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
-
-
- 5
- wxEXPAND|wxTOP|wxLEFT
- 0
-
-
- bBottomtBoxSizer
- wxVERTICAL
- none
-
- 5
- wxBOTTOM|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Common to all units
-
- 0
-
-
- 0
-
- 1
- m_CommonUnit
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
- 5
- wxLEFT|wxRIGHT
- 0
1
1
@@ -1780,6 +2328,17 @@
+
+ 5
+ wxEXPAND|wxTOP|wxLEFT
+ 0
+
+
+ bBottomtBoxSizer
+ wxVERTICAL
+ none
+
+
diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.h b/eeschema/dialogs/dialog_lib_text_properties_base.h
index 8ed3f4b36c..c1da0d989d 100644
--- a/eeschema/dialogs/dialog_lib_text_properties_base.h
+++ b/eeschema/dialogs/dialog_lib_text_properties_base.h
@@ -10,6 +10,8 @@
#include
#include
#include
+class BITMAP_BUTTON;
+
#include "dialog_shim.h"
#include
#include
@@ -26,7 +28,6 @@
#include
#include
#include
-#include
#include
#include
@@ -46,24 +47,31 @@ class DIALOG_LIB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
wxBitmapButton* m_TextValueSelectButton;
wxStaticText* m_note;
wxCheckBox* m_visible;
- wxStaticText* m_xPosLabel;
- wxTextCtrl* m_xPosCtrl;
- wxStaticText* m_xPosUnits;
- wxCheckBox* m_italic;
- wxStaticText* m_orientLabel;
- wxChoice* m_orientChoice;
- wxStaticText* m_yPosLabel;
- wxTextCtrl* m_yPosCtrl;
- wxStaticText* m_yPosUnits;
- wxCheckBox* m_bold;
- wxStaticText* m_hAlignLabel;
- wxChoice* m_hAlignChoice;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;
- wxStaticText* m_vAlignLabel;
- wxChoice* m_vAlignChoice;
+ BITMAP_BUTTON* m_separator1;
+ BITMAP_BUTTON* m_horizontal;
+ BITMAP_BUTTON* m_vertical;
+ BITMAP_BUTTON* m_separator2;
+ BITMAP_BUTTON* m_bold;
+ BITMAP_BUTTON* m_italic;
+ BITMAP_BUTTON* m_separator3;
+ BITMAP_BUTTON* m_hAlignLeft;
+ BITMAP_BUTTON* m_hAlignCenter;
+ BITMAP_BUTTON* m_hAlignRight;
+ BITMAP_BUTTON* m_separator4;
+ BITMAP_BUTTON* m_vAlignTop;
+ BITMAP_BUTTON* m_vAlignCenter;
+ BITMAP_BUTTON* m_vAlignBottom;
+ BITMAP_BUTTON* m_separator5;
+ wxStaticText* m_xPosLabel;
+ wxTextCtrl* m_xPosCtrl;
+ wxStaticText* m_xPosUnits;
wxCheckBox* m_CommonUnit;
+ wxStaticText* m_yPosLabel;
+ wxTextCtrl* m_yPosCtrl;
+ wxStaticText* m_yPosUnits;
wxCheckBox* m_CommonConvert;
wxStaticLine* m_staticline2;
wxStdDialogButtonSizer* m_sdbSizerButtons;
@@ -73,6 +81,7 @@ class DIALOG_LIB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class
virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); }
virtual void OnSetFocusText( wxFocusEvent& event ) { event.Skip(); }
+ virtual void onMultiLineTCLostFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void OnTextValueSelectButtonClick( wxCommandEvent& event ) { event.Skip(); }
diff --git a/eeschema/dialogs/dialog_sheet_pin_properties.cpp b/eeschema/dialogs/dialog_sheet_pin_properties.cpp
index c2d8672525..fa2634d347 100644
--- a/eeschema/dialogs/dialog_sheet_pin_properties.cpp
+++ b/eeschema/dialogs/dialog_sheet_pin_properties.cpp
@@ -122,7 +122,7 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
// and expects text width = text height
m_sheetPin->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
- auto shape = static_cast( m_choiceConnectionType->GetCurrentSelection() );
+ auto shape = static_cast( m_choiceConnectionType->GetCurrentSelection() );
m_sheetPin->SetShape( shape );
m_frame->UpdateItem( m_sheetPin, false, true );
diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp
index 70bf11ab0f..76ab261a4e 100644
--- a/eeschema/dialogs/dialog_sheet_properties.cpp
+++ b/eeschema/dialogs/dialog_sheet_properties.cpp
@@ -774,7 +774,9 @@ void DIALOG_SHEET_PROPERTIES::OnMoveUp( wxCommandEvent& event )
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
+ {
wxBell();
+ }
}
@@ -796,7 +798,9 @@ void DIALOG_SHEET_PROPERTIES::OnMoveDown( wxCommandEvent& event )
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
+ {
wxBell();
+ }
}
@@ -866,7 +870,6 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
m_grid->MakeCellVisible( m_delayedFocusRow, m_delayedFocusColumn );
m_grid->SetGridCursor( m_delayedFocusRow, m_delayedFocusColumn );
-
m_grid->EnableCellEditControl( true );
m_grid->ShowCellEditControl();
@@ -878,12 +881,10 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
void DIALOG_SHEET_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
{
- auto new_size = event.GetSize().GetX();
+ int new_size = event.GetSize().GetX();
if( m_width != new_size )
- {
AdjustGridColumns( new_size );
- }
// Always propagate for a grid repaint (needed if the height changes, as well as width)
event.Skip();
diff --git a/eeschema/dialogs/dialog_sheet_properties.h b/eeschema/dialogs/dialog_sheet_properties.h
index c59056285c..441e3f6e34 100644
--- a/eeschema/dialogs/dialog_sheet_properties.h
+++ b/eeschema/dialogs/dialog_sheet_properties.h
@@ -43,21 +43,6 @@ public:
~DIALOG_SHEET_PROPERTIES() override;
private:
- SCH_EDIT_FRAME* m_frame;
- SCH_SHEET* m_sheet;
- bool* m_clearAnnotationNewItems;
-
- int m_width;
- int m_delayedFocusRow;
- int m_delayedFocusColumn;
- wxString m_shownColumns;
-
- FIELDS_GRID_TABLE* m_fields;
- UNIT_BINDER m_borderWidth;
-
- SCH_SHEET m_dummySheet;
- SCH_FIELD m_dummySheetNameField;
-
bool onSheetFilenameChanged( const wxString& aNewFilename );
bool TransferDataToWindow() override;
@@ -76,6 +61,22 @@ private:
void OnInitDlg( wxInitDialogEvent& event ) override;
void AdjustGridColumns( int aWidth );
+
+private:
+ SCH_EDIT_FRAME* m_frame;
+ SCH_SHEET* m_sheet;
+ bool* m_clearAnnotationNewItems;
+
+ int m_width;
+ int m_delayedFocusRow;
+ int m_delayedFocusColumn;
+ wxString m_shownColumns;
+
+ FIELDS_GRID_TABLE* m_fields;
+ UNIT_BINDER m_borderWidth;
+
+ SCH_SHEET m_dummySheet;
+ SCH_FIELD m_dummySheetNameField;
};
#endif // DIALOG_SHEET_PROPERTIES_H
diff --git a/eeschema/dialogs/dialog_sheet_properties_base.cpp b/eeschema/dialogs/dialog_sheet_properties_base.cpp
index c49c484c55..81f7dac74c 100644
--- a/eeschema/dialogs/dialog_sheet_properties_base.cpp
+++ b/eeschema/dialogs/dialog_sheet_properties_base.cpp
@@ -69,7 +69,7 @@ DIALOG_SHEET_PROPERTIES_BASE::DIALOG_SHEET_PROPERTIES_BASE( wxWindow* parent, wx
// Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
- m_grid->SetMinSize( wxSize( -1,180 ) );
+ m_grid->SetMinSize( wxSize( -1,120 ) );
sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
@@ -173,7 +173,7 @@ DIALOG_SHEET_PROPERTIES_BASE::DIALOG_SHEET_PROPERTIES_BASE( wxWindow* parent, wx
bSizer6->Add( 0, 0, 3, wxEXPAND, 5 );
- mainSizer->Add( bSizer6, 0, wxALL|wxEXPAND, 5 );
+ mainSizer->Add( bSizer6, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
mainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
diff --git a/eeschema/dialogs/dialog_sheet_properties_base.fbp b/eeschema/dialogs/dialog_sheet_properties_base.fbp
index 332816990d..5b2e5cacc4 100644
--- a/eeschema/dialogs/dialog_sheet_properties_base.fbp
+++ b/eeschema/dialogs/dialog_sheet_properties_base.fbp
@@ -143,7 +143,7 @@
0
- -1,180
+ -1,120
1
m_grid
1
@@ -975,8 +975,8 @@
- 5
- wxALL|wxEXPAND
+ 10
+ wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT
0
diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp
index 1d93632bf3..e94d127c46 100644
--- a/eeschema/dialogs/dialog_symbol_properties.cpp
+++ b/eeschema/dialogs/dialog_symbol_properties.cpp
@@ -322,7 +322,7 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
if( cfg )
{
- m_shownColumns = cfg->m_Appearance.edit_component_visible_columns;
+ m_shownColumns = cfg->m_Appearance.edit_symbol_visible_columns;
m_fieldsGrid->ShowHideColumns( m_shownColumns );
}
@@ -379,7 +379,7 @@ DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES()
EESCHEMA_SETTINGS* cfg = dynamic_cast( Kiface().KifaceSettings() );
if( cfg )
- cfg->m_Appearance.edit_component_visible_columns = m_fieldsGrid->GetShownColumns();
+ cfg->m_Appearance.edit_symbol_visible_columns = m_fieldsGrid->GetShownColumns();
// Prevents crash bug in wxGrid's d'tor
m_fieldsGrid->DestroyTable( m_fields );
diff --git a/eeschema/dialogs/dialog_text_and_label_properties.cpp b/eeschema/dialogs/dialog_text_and_label_properties.cpp
deleted file mode 100644
index 6064f103bb..0000000000
--- a/eeschema/dialogs/dialog_text_and_label_properties.cpp
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * This program source code file is part of KiCad, a free EDA CAD application.
- *
- * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 2013 Wayne Stambaugh
- * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * 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
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-class SCH_EDIT_FRAME;
-class SCH_TEXT;
-
-
-DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
- SCH_TEXT* aTextItem ) :
- DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( aParent ),
- m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
- m_netNameValidator( true ),
- m_scintillaTricks( nullptr ),
- m_helpWindow( nullptr )
-{
- m_Parent = aParent;
- m_CurrentText = aTextItem;
-
- m_valueMultiLine->SetEOLMode( wxSTC_EOL_LF );
-
- m_scintillaTricks = new SCINTILLA_TRICKS( m_valueMultiLine, wxT( "{}" ), false,
- [this]()
- {
- wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
- } );
-
- if( m_CurrentText->IsMultilineAllowed() )
- {
- m_activeTextCtrl = m_valueMultiLine;
- m_activeTextEntry = nullptr;
-
- m_labelSingleLine->Show( false );
- m_valueSingleLine->Show( false );
- m_labelCombo->Show( false );
- m_valueCombo->Show( false );
-
- m_textEntrySizer->AddGrowableRow( 0 );
- }
- else if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T || m_CurrentText->Type() == SCH_LABEL_T )
- {
- m_activeTextCtrl = m_valueCombo;
- m_activeTextEntry = m_valueCombo;
-
- m_labelSingleLine->Show( false ); m_valueSingleLine->Show( false );
- m_labelMultiLine->Show( false ); m_valueMultiLine->Show( false );
-
- m_valueCombo->SetValidator( m_netNameValidator );
- }
- else
- {
- m_activeTextCtrl = m_valueSingleLine;
- m_activeTextEntry = m_valueSingleLine;
-
- m_labelCombo->Show( false );
- m_valueCombo->Show( false );
- m_labelMultiLine->Show( false );
- m_valueMultiLine->Show( false );
-
- if( m_CurrentText->Type() != SCH_TEXT_T )
- m_valueSingleLine->SetValidator( m_netNameValidator );
-
- m_valueCombo->SetValidator( m_netNameValidator );
- }
-
- switch( m_CurrentText->Type() )
- {
- case SCH_GLOBAL_LABEL_T: SetTitle( _( "Global Label Properties" ) ); break;
- case SCH_HIER_LABEL_T: SetTitle( _( "Hierarchical Label Properties" ) ); break;
- case SCH_LABEL_T: SetTitle( _( "Label Properties" ) ); break;
- case SCH_SHEET_PIN_T: SetTitle( _( "Hierarchical Sheet Pin Properties" ) ); break;
- default: SetTitle( _( "Text Properties" ) ); break;
- }
-
- SetInitialFocus( m_activeTextCtrl );
-
- m_TextShape->Show( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T ||
- m_CurrentText->Type() == SCH_HIER_LABEL_T );
-
- if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T )
- {
- m_note1->SetFont( KIUI::GetInfoFont( this ).Italic() );
- m_note2->SetFont( KIUI::GetInfoFont( this ).Italic() );
- }
- else
- {
- m_note1->Show( false );
- m_note2->Show( false );
- }
-
- m_sdbSizer1OK->SetDefault();
- Layout();
-
- m_valueMultiLine->Bind( wxEVT_STC_CHARADDED, &DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded, this );
-
- // DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
- // various versions have different controls so we want to store sizes for each version.
- m_hash_key = TO_UTF8( GetTitle() );
-
-
- // Now all widgets have the size fixed, call FinishDialogSettings
- finishDialogSettings();
-}
-
-
-DIALOG_TEXT_AND_LABEL_PROPERTIES::~DIALOG_TEXT_AND_LABEL_PROPERTIES()
-{
- delete m_scintillaTricks;
-
- if( m_helpWindow )
- m_helpWindow->Destroy();
-}
-
-
-void DIALOG_TEXT_AND_LABEL_PROPERTIES::SetTitle( const wxString& aTitle )
-{
- // This class is shared for numerous tasks: a couple of single line labels and
- // multi-line text fields. Since the desired size of the multi-line text field editor
- // is often larger, we retain separate sizes based on the dialog titles.
- switch( m_CurrentText->Type() )
- {
- case SCH_GLOBAL_LABEL_T:
- case SCH_HIER_LABEL_T:
- case SCH_LABEL_T:
- // labels can share retained settings probably.
- break;
-
- default:
- m_hash_key = TO_UTF8( aTitle );
- m_hash_key += typeid(*this).name();
- }
-
- DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::SetTitle( aTitle );
-}
-
-
-bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow()
-{
- if( !wxDialog::TransferDataToWindow() )
- return false;
-
- if( m_CurrentText->Type() == SCH_TEXT_T )
- {
- SCHEMATIC& schematic = m_Parent->Schematic();
-
- // show text variable cross-references in a human-readable format
- m_valueMultiLine->SetValue( schematic.ConvertKIIDsToRefs( m_CurrentText->GetText() ) );
- }
- else
- {
- // show control characters in a human-readable format
- m_activeTextEntry->SetValue( UnescapeString( m_CurrentText->GetText() ) );
- }
-
- if( m_valueCombo->IsShown() )
- {
- // Load the combobox with the existing labels of the same type
- std::set existingLabels;
- SCH_SCREENS allScreens( m_Parent->Schematic().Root() );
-
- for( SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() )
- {
- for( SCH_ITEM* item : screen->Items().OfType( m_CurrentText->Type() ) )
- {
- auto textItem = static_cast( item );
- existingLabels.insert( UnescapeString( textItem->GetText() ) );
- }
- }
-
- wxArrayString existingLabelArray;
-
- for( const wxString& label : existingLabels )
- existingLabelArray.push_back( label );
-
- // existingLabelArray.Sort();
- m_valueCombo->Append( existingLabelArray );
- }
-
- // Set text options:
- m_TextOrient->SetSelection( static_cast( m_CurrentText->GetLabelSpinStyle() ) );
-
- m_TextShape->SetSelection( static_cast( m_CurrentText->GetShape() ) );
-
- int style = 0;
-
- if( m_CurrentText->IsItalic() )
- style = 1;
-
- if( m_CurrentText->IsBold() )
- style += 2;
-
- m_TextStyle->SetSelection( style );
-
- m_textSize.SetValue( m_CurrentText->GetTextWidth() );
-
- return true;
-}
-
-
-/*!
- * wxEVT_COMMAND_ENTER event handler for single-line control
- */
-void DIALOG_TEXT_AND_LABEL_PROPERTIES::OnEnterKey( wxCommandEvent& aEvent )
-{
- wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
-}
-
-
-void DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
-{
- wxStyledTextCtrl* te = m_valueMultiLine;
- wxArrayString autocompleteTokens;
- int text_pos = te->GetCurrentPos();
- int start = te->WordStartPosition( text_pos, true );
- wxString partial;
-
- auto textVarRef =
- [&]( int pos )
- {
- return pos >= 2 && te->GetCharAt( pos-2 ) == '$' && te->GetCharAt( pos-1 ) == '{';
- };
-
- // Check for cross-reference
- if( start > 1 && te->GetCharAt( start-1 ) == ':' )
- {
- int refStart = te->WordStartPosition( start-1, true );
-
- if( textVarRef( refStart ) )
- {
- partial = te->GetRange( start+1, text_pos );
-
- wxString ref = te->GetRange( refStart, start-1 );
- SCH_SHEET_LIST sheets = m_Parent->Schematic().GetSheets();
- SCH_REFERENCE_LIST refs;
- SCH_SYMBOL* refSymbol = nullptr;
-
- sheets.GetSymbols( refs );
-
- for( size_t jj = 0; jj < refs.GetCount(); jj++ )
- {
- if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(), true ) == ref )
- {
- refSymbol = refs[ jj ].GetSymbol();
- break;
- }
- }
-
- if( refSymbol )
- refSymbol->GetContextualTextVars( &autocompleteTokens );
- }
- }
- else if( textVarRef( start ) )
- {
- partial = te->GetTextRange( start, text_pos );
-
- m_CurrentText->GetContextualTextVars( &autocompleteTokens );
-
- SCHEMATIC* schematic = m_CurrentText->Schematic();
-
- if( schematic && schematic->CurrentSheet().Last() )
- schematic->CurrentSheet().Last()->GetContextualTextVars( &autocompleteTokens );
-
- for( std::pair entry : Prj().GetTextVars() )
- autocompleteTokens.push_back( entry.first );
- }
-
- m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
- m_valueMultiLine->SetFocus();
-}
-
-
-bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
-{
- if( !wxDialog::TransferDataFromWindow() )
- return false;
-
- // Don't allow text to disappear; it can be difficult to correct if you can't select it
- if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
- return false;
-
- wxString text;
-
- /* save old text in undo list if not already in edit */
- if( m_CurrentText->GetEditFlags() == 0 )
- m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_CurrentText, UNDO_REDO::CHANGED, false );
-
- m_Parent->GetCanvas()->Refresh();
-
- if( m_CurrentText->Type() == SCH_TEXT_T )
- {
- // convert any text variable cross-references to their UUIDs
- text = m_Parent->Schematic().ConvertRefsToKIIDs( m_valueMultiLine->GetValue() );
- }
- else
- {
- // labels need escaping
- text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
- }
-
- if( !text.IsEmpty() )
- {
-#ifdef __WXMAC__
- // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
- text.Replace( "\r", "\n" );
-#endif
- m_CurrentText->SetText( text );
- }
- else if( !m_CurrentText->IsNew() )
- {
- DisplayError( this, _( "Label requires non-empty text." ) );
- return false;
- }
-
- LABEL_SPIN_STYLE selectedSpinStyle(
- static_cast( m_TextOrient->GetSelection() ) );
-
- if( m_CurrentText->GetLabelSpinStyle() != selectedSpinStyle )
- m_CurrentText->SetLabelSpinStyle( selectedSpinStyle );
-
- if( m_CurrentText->GetTextWidth() != m_textSize.GetValue() )
- m_CurrentText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
-
- if( m_TextShape )
- m_CurrentText->SetShape( (PINSHEETLABEL_SHAPE) m_TextShape->GetSelection() );
-
- int style = m_TextStyle->GetSelection();
- bool wantItalic = ( style & 1 ) > 0;
- bool wantBold = (style & 2 ) > 0;
-
- m_CurrentText->SetItalic( wantItalic );
-
- if( wantBold != m_CurrentText->IsBold() )
- {
- if( wantBold )
- {
- m_CurrentText->SetBold( true );
- m_CurrentText->SetTextThickness( GetPenSizeForBold( m_CurrentText->GetTextWidth() ) );
- }
- else
- {
- m_CurrentText->SetBold( false );
- m_CurrentText->SetTextThickness( 0 ); // Use default pen width
- }
- }
-
- m_Parent->UpdateItem( m_CurrentText, false, true );
- m_Parent->GetCanvas()->Refresh();
- m_Parent->OnModify();
-
- if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T )
- {
- SCH_GLOBALLABEL* label = static_cast( m_CurrentText );
- label->UpdateIntersheetRefProps();
- }
-
- return true;
-}
-
-
-void DIALOG_TEXT_AND_LABEL_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
-{
- if( m_scintillaTricks )
- m_scintillaTricks->CancelAutocomplete();
-
- event.Skip();
-}
-
-
-void DIALOG_TEXT_AND_LABEL_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
-{
- m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
-}
diff --git a/eeschema/dialogs/dialog_text_and_label_properties_base.cpp b/eeschema/dialogs/dialog_text_and_label_properties_base.cpp
deleted file mode 100644
index 25c36f7f6e..0000000000
--- a/eeschema/dialogs/dialog_text_and_label_properties_base.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
-// http://www.wxformbuilder.org/
-//
-// PLEASE DO *NOT* EDIT THIS FILE!
-///////////////////////////////////////////////////////////////////////////
-
-#include "dialog_text_and_label_properties_base.h"
-
-///////////////////////////////////////////////////////////////////////////
-
-DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
-{
- this->SetSizeHints( wxDefaultSize, wxDefaultSize );
-
- wxBoxSizer* bMainSizer;
- bMainSizer = new wxBoxSizer( wxVERTICAL );
-
- m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 3 );
- m_textEntrySizer->AddGrowableCol( 1 );
- m_textEntrySizer->AddGrowableRow( 1 );
- m_textEntrySizer->SetFlexibleDirection( wxBOTH );
- m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
- m_textEntrySizer->SetMinSize( wxSize( 500,-1 ) );
- m_labelSingleLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_labelSingleLine->Wrap( -1 );
- m_labelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
-
- m_textEntrySizer->Add( m_labelSingleLine, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
-
- m_valueSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
- m_valueSingleLine->SetMinSize( wxSize( 360,-1 ) );
-
- m_textEntrySizer->Add( m_valueSingleLine, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
-
- m_labelMultiLine = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_labelMultiLine->Wrap( -1 );
- m_textEntrySizer->Add( m_labelMultiLine, 0, wxTOP|wxRIGHT, 2 );
-
- m_valueMultiLine = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
- m_valueMultiLine->SetUseTabs( true );
- m_valueMultiLine->SetTabWidth( 4 );
- m_valueMultiLine->SetIndent( 4 );
- m_valueMultiLine->SetTabIndents( false );
- m_valueMultiLine->SetBackSpaceUnIndents( false );
- m_valueMultiLine->SetViewEOL( false );
- m_valueMultiLine->SetViewWhiteSpace( false );
- m_valueMultiLine->SetMarginWidth( 2, 0 );
- m_valueMultiLine->SetIndentationGuides( false );
- m_valueMultiLine->SetReadOnly( false );
- m_valueMultiLine->SetMarginWidth( 1, 0 );
- m_valueMultiLine->SetMarginWidth( 0, 0 );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
- m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
- m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
- m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
- m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
- m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
- m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
- m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
- m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
- m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
- m_valueMultiLine->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
- m_valueMultiLine->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
- m_textEntrySizer->Add( m_valueMultiLine, 1, wxEXPAND|wxBOTTOM, 2 );
-
- m_labelCombo = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_labelCombo->Wrap( -1 );
- m_textEntrySizer->Add( m_labelCombo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
-
- m_valueCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
- m_valueCombo->SetMinSize( wxSize( 360,-1 ) );
-
- m_textEntrySizer->Add( m_valueCombo, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
-
- m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text Size:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_textSizeLabel->Wrap( -1 );
- m_textEntrySizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 6 );
-
- wxBoxSizer* bSizeCtrlSizer;
- bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
-
- m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxBOTTOM|wxRIGHT|wxTOP, 6 );
-
- m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
- m_textSizeUnits->Wrap( -1 );
- bSizeCtrlSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 6 );
-
-
- bSizeCtrlSizer->Add( 0, 0, 1, wxEXPAND, 15 );
-
- m_formattingHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
- m_formattingHelp->SetToolTip( _("Show syntax help window") );
-
- bSizeCtrlSizer->Add( m_formattingHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
-
-
- m_textEntrySizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 6 );
-
- m_note1 = new wxStaticText( this, wxID_ANY, _("Note:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_note1->Wrap( -1 );
- m_textEntrySizer->Add( m_note1, 0, wxTOP|wxRIGHT, 2 );
-
- m_note2 = new wxStaticText( this, wxID_ANY, _("The margins around the text are controlled by the text offset ratio\nin Schematic Setup > General > Formatting."), wxDefaultPosition, wxDefaultSize, 0 );
- m_note2->Wrap( -1 );
- m_textEntrySizer->Add( m_note2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 2 );
-
-
- bMainSizer->Add( m_textEntrySizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
-
- wxBoxSizer* m_OptionsSizer;
- m_OptionsSizer = new wxBoxSizer( wxHORIZONTAL );
-
- wxString m_TextOrientChoices[] = { _("Align right"), _("Align bottom"), _("Align left"), _("Align top") };
- int m_TextOrientNChoices = sizeof( m_TextOrientChoices ) / sizeof( wxString );
- m_TextOrient = new wxRadioBox( this, wxID_ANY, _("Justification"), wxDefaultPosition, wxDefaultSize, m_TextOrientNChoices, m_TextOrientChoices, 1, wxRA_SPECIFY_COLS );
- m_TextOrient->SetSelection( 2 );
- m_OptionsSizer->Add( m_TextOrient, 1, wxRIGHT|wxTOP|wxEXPAND, 3 );
-
- wxString m_TextStyleChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold and italic") };
- int m_TextStyleNChoices = sizeof( m_TextStyleChoices ) / sizeof( wxString );
- m_TextStyle = new wxRadioBox( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, m_TextStyleNChoices, m_TextStyleChoices, 1, wxRA_SPECIFY_COLS );
- m_TextStyle->SetSelection( 0 );
- m_OptionsSizer->Add( m_TextStyle, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 3 );
-
- wxString m_TextShapeChoices[] = { _("Input"), _("Output"), _("Bidirectional"), _("Tri-state"), _("Passive") };
- int m_TextShapeNChoices = sizeof( m_TextShapeChoices ) / sizeof( wxString );
- m_TextShape = new wxRadioBox( this, wxID_ANY, _("Shape"), wxDefaultPosition, wxDefaultSize, m_TextShapeNChoices, m_TextShapeChoices, 1, wxRA_SPECIFY_COLS );
- m_TextShape->SetSelection( 0 );
- m_OptionsSizer->Add( m_TextShape, 1, wxEXPAND|wxTOP|wxLEFT, 3 );
-
-
- bMainSizer->Add( m_OptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
-
- wxBoxSizer* bSizer4;
- bSizer4 = new wxBoxSizer( wxHORIZONTAL );
-
- 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();
-
- bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
-
-
- bMainSizer->Add( bSizer4, 0, wxEXPAND|wxALL, 5 );
-
-
- this->SetSizer( bMainSizer );
- this->Layout();
- bMainSizer->Fit( this );
-
- // Connect Events
- m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
- m_valueMultiLine->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
- m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
- m_formattingHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
-}
-
-DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::~DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE()
-{
- // Disconnect Events
- m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
- m_valueMultiLine->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
- m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
- m_formattingHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
-
-}
diff --git a/eeschema/dialogs/dialog_text_and_label_properties_base.fbp b/eeschema/dialogs/dialog_text_and_label_properties_base.fbp
deleted file mode 100644
index d9be83b1db..0000000000
--- a/eeschema/dialogs/dialog_text_and_label_properties_base.fbp
+++ /dev/null
@@ -1,1098 +0,0 @@
-
-
-
-
-
- C++
- 1
- source_name
- 0
- 0
- res
- UTF-8
- connect
- dialog_text_and_label_properties_base
- 1000
- none
-
-
- 1
- dialog_text_and_label_properties_base
-
- .
-
- 1
- 1
- 1
- 1
- UI
- 0
- 1
- 0
-
- 0
- wxAUI_MGR_DEFAULT
-
-
-
- 1
- 1
- impl_virtual
-
-
-
- 0
- wxID_ANY
-
-
- DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE
-
- -1,-1
- wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
- DIALOG_SHIM; dialog_shim.h
- Text Properties
-
- 0
-
-
-
-
-
- bMainSizer
- wxVERTICAL
- none
-
- 12
- wxEXPAND|wxLEFT|wxRIGHT|wxTOP
- 1
-
- 2
- wxBOTH
- 1
- 1
- 3
- 500,-1
- m_textEntrySizer
- wxFLEX_GROWMODE_SPECIFIED
- protected
- 5
- 1
-
- 2
- wxALIGN_CENTER_VERTICAL|wxBOTTOM
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Label:
- 0
-
- 0
-
-
- 0
-
- 1
- m_labelSingleLine
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
- Enter the text to be used within the schematic
-
-
-
- -1
-
-
-
- 2
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_VALUESINGLE
-
- 0
-
-
-
- 0
- 360,-1
- 1
- m_valueSingleLine
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
- wxTE_PROCESS_ENTER|wxTE_RICH
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
- OnEnterKey
-
-
-
- 2
- wxTOP|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Text:
- 0
-
- 0
-
-
- 0
-
- 1
- m_labelMultiLine
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 2
- wxEXPAND|wxBOTTOM
- 1
-
- 1
- 1
- 1
- 1
-
-
-
-
- 0
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
- 0
-
- 0
- 0
- wxID_ANY
- 0
- 0
-
- 0
-
-
- 0
- -1,-1
- 1
- m_valueMultiLine
- 1
-
-
- protected
- 1
-
- 0
- Resizable
- 1
-
- ; forward_declare
- 0
- 4
- 0
-
- 1
- 0
- 0
-
-
- wxBORDER_SUNKEN
- onMultiLineTCLostFocus
-
-
-
- 5
- wxALIGN_CENTER_VERTICAL|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Label:
- 0
-
- 0
-
-
- 0
-
- 1
- m_labelCombo
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND|wxALIGN_CENTER_VERTICAL
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
-
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
-
- 0
- 360,-1
- 1
- m_valueCombo
- 1
-
-
- protected
- 1
-
- Resizable
- -1
- 1
-
- wxTE_PROCESS_ENTER
- ; forward_declare
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
- OnEnterKey
-
-
-
- 6
- wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Text Size:
- 0
-
- 0
-
-
- 0
-
- 1
- m_textSizeLabel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
-
-
- -1
-
-
-
- 6
- wxEXPAND
- 1
-
-
- bSizeCtrlSizer
- wxHORIZONTAL
- none
-
- 6
- wxBOTTOM|wxRIGHT|wxTOP
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_SIZE
-
- 0
-
-
-
- 0
-
- 1
- m_textSizeCtrl
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
-
- 6
- wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- mm
- 0
-
- 0
-
-
- 0
-
- 1
- m_textSizeUnits
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
-
-
- -1
-
-
-
- 15
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
- 5
- wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
-
- wxID_ANY
- Syntax help
-
- 0
-
-
- 0
-
- 1
- m_formattingHelp
-
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
- wxHL_DEFAULT_STYLE
- ; ; forward_declare
- 0
- Show syntax help window
-
-
-
-
-
- OnFormattingHelp
-
-
-
-
-
- 2
- wxTOP|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Note:
- 0
-
- 0
-
-
- 0
-
- 1
- m_note1
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
- 2
- wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- The margins around the text are controlled by the text offset ratio
in Schematic Setup > General > Formatting.
- 0
-
- 0
-
-
- 0
-
- 1
- m_note2
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- ; ; forward_declare
- 0
-
-
-
-
- -1
-
-
-
-
-
- 10
- wxEXPAND|wxLEFT|wxRIGHT|wxTOP
- 0
-
-
- m_OptionsSizer
- wxHORIZONTAL
- none
-
- 3
- wxRIGHT|wxTOP|wxEXPAND
- 1
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Align right" "Align bottom" "Align left" "Align top"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Justification
- 1
-
- 0
-
-
- 0
-
- 1
- m_TextOrient
- 1
-
-
- protected
- 1
-
- Resizable
- 2
- 1
-
- wxRA_SPECIFY_COLS
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
- 3
- wxLEFT|wxRIGHT|wxTOP|wxEXPAND
- 1
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Normal" "Italic" "Bold" "Bold and italic"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Style
- 1
-
- 0
-
-
- 0
-
- 1
- m_TextStyle
- 1
-
-
- protected
- 1
-
- Resizable
- 0
- 1
-
- wxRA_SPECIFY_COLS
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
- 3
- wxEXPAND|wxTOP|wxLEFT
- 1
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- "Input" "Output" "Bidirectional" "Tri-state" "Passive"
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
- Shape
- 1
-
- 0
-
-
- 0
-
- 1
- m_TextShape
- 1
-
-
- protected
- 1
-
- Resizable
- 0
- 1
-
- wxRA_SPECIFY_COLS
-
- 0
-
-
- wxFILTER_NONE
- wxDefaultValidator
-
-
-
-
-
-
-
-
-
- 5
- wxEXPAND|wxALL
- 0
-
-
- bSizer4
- wxHORIZONTAL
- none
-
- 5
- wxALL|wxEXPAND
- 1
-
- 0
- 1
- 0
- 0
- 0
- 1
- 0
- 0
-
- m_sdbSizer1
- protected
-
-
-
-
-
-
-
-
diff --git a/eeschema/dialogs/dialog_text_properties.cpp b/eeschema/dialogs/dialog_text_properties.cpp
new file mode 100644
index 0000000000..a294615aff
--- /dev/null
+++ b/eeschema/dialogs/dialog_text_properties.cpp
@@ -0,0 +1,296 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 2013 Wayne Stambaugh
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * 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
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class SCH_EDIT_FRAME;
+class SCH_TEXT;
+
+
+DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTextItem ) :
+ DIALOG_TEXT_PROPERTIES_BASE( aParent ),
+ m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
+ m_scintillaTricks( nullptr ),
+ m_helpWindow( nullptr )
+{
+ m_Parent = aParent;
+ m_currentText = aTextItem;
+
+ m_textCtrl->SetEOLMode( wxSTC_EOL_LF );
+
+ m_scintillaTricks = new SCINTILLA_TRICKS( m_textCtrl, wxT( "{}" ), false,
+ [this]()
+ {
+ wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
+ } );
+
+ m_textEntrySizer->AddGrowableRow( 0 );
+
+ SetInitialFocus( m_textCtrl );
+
+ m_separator1->SetIsSeparator();
+
+ m_bold->SetIsCheckButton();
+ m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
+ m_italic->SetIsCheckButton();
+ m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
+
+ m_separator2->SetIsSeparator();
+
+ m_spin0->SetIsCheckButton();
+ m_spin0->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
+ m_spin1->SetIsCheckButton();
+ m_spin1->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
+ m_spin2->SetIsCheckButton();
+ m_spin2->SetBitmap( KiBitmap( BITMAPS::text_align_bottom ) );
+ m_spin3->SetIsCheckButton();
+ m_spin3->SetBitmap( KiBitmap( BITMAPS::text_align_top ) );
+
+ m_separator3->SetIsSeparator();
+
+ m_sdbSizer1OK->SetDefault();
+ Layout();
+
+ m_textCtrl->Bind( wxEVT_STC_CHARADDED, &DIALOG_TEXT_PROPERTIES::onScintillaCharAdded, this );
+ m_spin0->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
+ m_spin1->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
+ m_spin2->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
+ m_spin3->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
+
+ // Now all widgets have the size fixed, call FinishDialogSettings
+ finishDialogSettings();
+}
+
+
+DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES()
+{
+ delete m_scintillaTricks;
+
+ if( m_helpWindow )
+ m_helpWindow->Destroy();
+}
+
+
+bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
+{
+ if( !wxDialog::TransferDataToWindow() )
+ return false;
+
+ SCHEMATIC& schematic = m_Parent->Schematic();
+
+ // show text variable cross-references in a human-readable format
+ m_textCtrl->SetValue( schematic.ConvertKIIDsToRefs( m_currentText->GetText() ) );
+
+ m_textSize.SetValue( m_currentText->GetTextWidth() );
+
+ m_bold->Check( m_currentText->IsBold() );
+ m_italic->Check( m_currentText->IsItalic() );
+
+ switch( m_currentText->GetLabelSpinStyle() )
+ {
+ case LABEL_SPIN_STYLE::RIGHT: m_spin0->Check( true ); break;
+ case LABEL_SPIN_STYLE::LEFT: m_spin1->Check( true ); break;
+ case LABEL_SPIN_STYLE::UP: m_spin2->Check( true ); break;
+ case LABEL_SPIN_STYLE::BOTTOM: m_spin3->Check( true ); break;
+ }
+
+ return true;
+}
+
+
+void DIALOG_TEXT_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
+{
+ wxStyledTextCtrl* te = m_textCtrl;
+ wxArrayString autocompleteTokens;
+ int text_pos = te->GetCurrentPos();
+ int start = te->WordStartPosition( text_pos, true );
+ wxString partial;
+
+ auto textVarRef =
+ [&]( int pos )
+ {
+ return pos >= 2 && te->GetCharAt( pos-2 ) == '$' && te->GetCharAt( pos-1 ) == '{';
+ };
+
+ // Check for cross-reference
+ if( start > 1 && te->GetCharAt( start-1 ) == ':' )
+ {
+ int refStart = te->WordStartPosition( start-1, true );
+
+ if( textVarRef( refStart ) )
+ {
+ partial = te->GetRange( start+1, text_pos );
+
+ wxString ref = te->GetRange( refStart, start-1 );
+ SCH_SHEET_LIST sheets = m_Parent->Schematic().GetSheets();
+ SCH_REFERENCE_LIST refs;
+ SCH_SYMBOL* refSymbol = nullptr;
+
+ sheets.GetSymbols( refs );
+
+ for( size_t jj = 0; jj < refs.GetCount(); jj++ )
+ {
+ if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(), true ) == ref )
+ {
+ refSymbol = refs[ jj ].GetSymbol();
+ break;
+ }
+ }
+
+ if( refSymbol )
+ refSymbol->GetContextualTextVars( &autocompleteTokens );
+ }
+ }
+ else if( textVarRef( start ) )
+ {
+ partial = te->GetTextRange( start, text_pos );
+
+ SCHEMATIC* schematic = m_currentText->Schematic();
+
+ if( schematic && schematic->CurrentSheet().Last() )
+ schematic->CurrentSheet().Last()->GetContextualTextVars( &autocompleteTokens );
+
+ for( std::pair entry : Prj().GetTextVars() )
+ autocompleteTokens.push_back( entry.first );
+ }
+
+ m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
+ m_textCtrl->SetFocus();
+}
+
+
+void DIALOG_TEXT_PROPERTIES::onSpinButton( wxCommandEvent& aEvent )
+{
+ for( BITMAP_BUTTON* btn : { m_spin0, m_spin1, m_spin2, m_spin3 } )
+ {
+ if( btn->IsChecked() && btn != aEvent.GetEventObject() )
+ btn->Check( false );
+ }
+}
+
+
+bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
+{
+ if( !wxDialog::TransferDataFromWindow() )
+ return false;
+
+ // Don't allow text to disappear; it can be difficult to correct if you can't select it
+ if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
+ return false;
+
+ wxString text;
+
+ /* save old text in undo list if not already in edit */
+ if( m_currentText->GetEditFlags() == 0 )
+ {
+ m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_currentText, UNDO_REDO::CHANGED,
+ false );
+ }
+
+ m_Parent->GetCanvas()->Refresh();
+
+ // convert any text variable cross-references to their UUIDs
+ text = m_Parent->Schematic().ConvertRefsToKIIDs( m_textCtrl->GetValue() );
+
+ if( !text.IsEmpty() )
+ {
+#ifdef __WXMAC__
+ // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
+ text.Replace( "\r", "\n" );
+#endif
+
+ m_currentText->SetText( text );
+ }
+ else if( !m_currentText->IsNew() )
+ {
+ DisplayError( this, _( "Text can not be empty." ) );
+ return false;
+ }
+
+ if( m_currentText->GetTextWidth() != m_textSize.GetValue() )
+ m_currentText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
+
+ if( m_bold->IsChecked() != m_currentText->IsBold() )
+ {
+ if( m_bold->IsChecked() )
+ {
+ m_currentText->SetBold( true );
+ m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
+ }
+ else
+ {
+ m_currentText->SetBold( false );
+ m_currentText->SetTextThickness( 0 ); // Use default pen width
+ }
+ }
+
+ m_currentText->SetItalic( m_italic->IsChecked() );
+
+ LABEL_SPIN_STYLE selectedSpinStyle= LABEL_SPIN_STYLE::LEFT;
+
+ if( m_spin0->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::RIGHT;
+ else if( m_spin1->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::LEFT;
+ else if( m_spin2->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::UP;
+ else if( m_spin3->IsChecked() )
+ selectedSpinStyle = LABEL_SPIN_STYLE::BOTTOM;
+
+ if( m_currentText->GetLabelSpinStyle() != selectedSpinStyle )
+ m_currentText->SetLabelSpinStyle( selectedSpinStyle );
+
+ m_Parent->UpdateItem( m_currentText, false, true );
+ m_Parent->GetCanvas()->Refresh();
+ m_Parent->OnModify();
+
+ return true;
+}
+
+
+void DIALOG_TEXT_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
+{
+ m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
+}
+
+
+void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
+{
+ if( m_scintillaTricks )
+ m_scintillaTricks->CancelAutocomplete();
+
+ event.Skip();
+}
diff --git a/eeschema/dialogs/dialog_text_and_label_properties.h b/eeschema/dialogs/dialog_text_properties.h
similarity index 63%
rename from eeschema/dialogs/dialog_text_and_label_properties.h
rename to eeschema/dialogs/dialog_text_properties.h
index 76c686702e..f5767611c0 100644
--- a/eeschema/dialogs/dialog_text_and_label_properties.h
+++ b/eeschema/dialogs/dialog_text_properties.h
@@ -21,13 +21,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#ifndef DIALOG_TEXT_AND_LABEL_PROPERTIES_H
-#define DIALOG_TEXT_AND_LABEL_PROPERTIES_H
+#ifndef DIALOG_TEXT_PROPERTIES_H
+#define DIALOG_TEXT_PROPERTIES_H
#include
#include
-#include
-#include
+#include
class SCH_EDIT_FRAME;
@@ -36,21 +35,16 @@ class SCINTILLA_TRICKS;
class HTML_MESSAGE_BOX;
-class DIALOG_TEXT_AND_LABEL_PROPERTIES : public DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE
+class DIALOG_TEXT_PROPERTIES : public DIALOG_TEXT_PROPERTIES_BASE
{
public:
- DIALOG_TEXT_AND_LABEL_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
- ~DIALOG_TEXT_AND_LABEL_PROPERTIES();
-
- // This class is shared for numerous tasks: a couple of single line labels and
- // multi-line text fields. Since the desired size of the multi-line text field editor
- // is often larger, we retain separate sizes based on the dialog titles.
- void SetTitle( const wxString& aTitle ) override;
+ DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
+ ~DIALOG_TEXT_PROPERTIES();
private:
void onScintillaCharAdded( wxStyledTextEvent &aEvent );
+ void onSpinButton( wxCommandEvent &aEvent );
- void OnEnterKey( wxCommandEvent& aEvent ) override;
void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
void onMultiLineTCLostFocus( wxFocusEvent& event ) override;
@@ -58,11 +52,8 @@ private:
bool TransferDataFromWindow() override;
SCH_EDIT_FRAME* m_Parent;
- SCH_TEXT* m_CurrentText;
- wxWindow* m_activeTextCtrl;
- wxTextEntry* m_activeTextEntry;
+ SCH_TEXT* m_currentText;
UNIT_BINDER m_textSize;
- SCH_NETNAME_VALIDATOR m_netNameValidator;
SCINTILLA_TRICKS* m_scintillaTricks;
HTML_MESSAGE_BOX* m_helpWindow;
@@ -70,4 +61,4 @@ private:
-#endif // DIALOG_TEXT_AND_LABEL_PROPERTIES_H
+#endif // DIALOG_TEXT_PROPERTIES_H
diff --git a/eeschema/dialogs/dialog_text_properties_base.cpp b/eeschema/dialogs/dialog_text_properties_base.cpp
new file mode 100644
index 0000000000..6653967501
--- /dev/null
+++ b/eeschema/dialogs/dialog_text_properties_base.cpp
@@ -0,0 +1,171 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO *NOT* EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "widgets/bitmap_button.h"
+
+#include "dialog_text_properties_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_TEXT_PROPERTIES_BASE::DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bMainSizer;
+ bMainSizer = new wxBoxSizer( wxVERTICAL );
+
+ m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 5 );
+ m_textEntrySizer->AddGrowableCol( 1 );
+ m_textEntrySizer->AddGrowableRow( 1 );
+ m_textEntrySizer->SetFlexibleDirection( wxBOTH );
+ m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_textLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textLabel->Wrap( -1 );
+ m_textEntrySizer->Add( m_textLabel, 0, wxTOP|wxRIGHT, 2 );
+
+ m_textCtrl = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
+ m_textCtrl->SetUseTabs( true );
+ m_textCtrl->SetTabWidth( 4 );
+ m_textCtrl->SetIndent( 4 );
+ m_textCtrl->SetTabIndents( false );
+ m_textCtrl->SetBackSpaceUnIndents( false );
+ m_textCtrl->SetViewEOL( false );
+ m_textCtrl->SetViewWhiteSpace( false );
+ m_textCtrl->SetMarginWidth( 2, 0 );
+ m_textCtrl->SetIndentationGuides( false );
+ m_textCtrl->SetMarginWidth( 1, 0 );
+ m_textCtrl->SetMarginWidth( 0, 0 );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
+ m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
+ m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
+ m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
+ m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
+ m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
+ m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
+ m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
+ m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
+ m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
+ m_textCtrl->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
+ m_textCtrl->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
+ m_textCtrl->SetMinSize( wxSize( 500,140 ) );
+
+ m_textEntrySizer->Add( m_textCtrl, 1, wxEXPAND|wxBOTTOM, 2 );
+
+ m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textSizeLabel->Wrap( -1 );
+ m_textEntrySizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 6 );
+
+ wxBoxSizer* bSizeCtrlSizer;
+ bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
+
+ m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textSizeUnits->Wrap( -1 );
+ bSizeCtrlSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 );
+
+ m_separator1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator1->Enable( false );
+
+ bSizeCtrlSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
+
+ m_bold = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_bold->SetToolTip( _("Bold") );
+
+ bSizeCtrlSizer->Add( m_bold, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_italic = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_italic->SetToolTip( _("Italic") );
+
+ bSizeCtrlSizer->Add( m_italic, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator2->Enable( false );
+
+ bSizeCtrlSizer->Add( m_separator2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin0 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_spin0->SetToolTip( _("Align right") );
+
+ bSizeCtrlSizer->Add( m_spin0, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_spin1->SetToolTip( _("Align bottom") );
+
+ bSizeCtrlSizer->Add( m_spin1, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_spin2->SetToolTip( _("Align left") );
+
+ bSizeCtrlSizer->Add( m_spin2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spin3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_spin3->SetToolTip( _("Align top") );
+
+ bSizeCtrlSizer->Add( m_spin3, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_separator3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
+ m_separator3->Enable( false );
+
+ bSizeCtrlSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
+
+
+ bSizeCtrlSizer->Add( 0, 0, 1, wxEXPAND, 15 );
+
+ m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
+ m_syntaxHelp->SetToolTip( _("Show syntax help window") );
+
+ bSizeCtrlSizer->Add( m_syntaxHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
+
+
+ m_textEntrySizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 6 );
+
+
+ bMainSizer->Add( m_textEntrySizer, 1, wxEXPAND|wxALL, 12 );
+
+ m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+ bMainSizer->Add( m_staticline, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
+
+ wxBoxSizer* bSizer4;
+ bSizer4 = new wxBoxSizer( wxHORIZONTAL );
+
+ 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();
+
+ bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
+
+
+ bMainSizer->Add( bSizer4, 0, wxEXPAND|wxALL, 5 );
+
+
+ this->SetSizer( bMainSizer );
+ this->Layout();
+ bMainSizer->Fit( this );
+
+ // Connect Events
+ m_textCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
+ m_syntaxHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
+}
+
+DIALOG_TEXT_PROPERTIES_BASE::~DIALOG_TEXT_PROPERTIES_BASE()
+{
+ // Disconnect Events
+ m_textCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
+ m_syntaxHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
+
+}
diff --git a/eeschema/dialogs/dialog_text_properties_base.fbp b/eeschema/dialogs/dialog_text_properties_base.fbp
new file mode 100644
index 0000000000..b97e44cd68
--- /dev/null
+++ b/eeschema/dialogs/dialog_text_properties_base.fbp
@@ -0,0 +1,1216 @@
+
+
+
+
+
+ C++
+ 1
+ source_name
+ 0
+ 0
+ res
+ UTF-8
+ connect
+ dialog_text_properties_base
+ 1000
+ none
+
+ 1
+ dialog_text_properties_base
+
+ .
+
+ 1
+ 1
+ 1
+ 1
+ UI
+ 1
+ 0
+
+ 0
+ wxAUI_MGR_DEFAULT
+
+
+
+ 1
+ 1
+ impl_virtual
+
+
+
+ 0
+ wxID_ANY
+
+
+ DIALOG_TEXT_PROPERTIES_BASE
+
+ -1,-1
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+ DIALOG_SHIM; dialog_shim.h
+ Text Properties
+
+
+
+
+
+
+ bMainSizer
+ wxVERTICAL
+ none
+
+ 12
+ wxEXPAND|wxALL
+ 1
+
+ 2
+ wxBOTH
+ 1
+ 1
+ 5
+ -1,-1
+ m_textEntrySizer
+ wxFLEX_GROWMODE_SPECIFIED
+ protected
+ 5
+ 1
+
+ 2
+ wxTOP|wxRIGHT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Text:
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_textLabel
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+ ; forward_declare
+ 0
+
+
+
+
+ -1
+
+
+
+ 2
+ wxEXPAND|wxBOTTOM
+ 1
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+ 0
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+ 0
+
+ 0
+ 0
+ wxID_ANY
+ 0
+ 0
+
+ 0
+
+
+ 0
+ 500,140
+ 1
+ m_textCtrl
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ ; forward_declare
+ 0
+ 4
+ 0
+
+ 1
+ 0
+ 0
+
+
+ wxBORDER_SUNKEN
+ onMultiLineTCLostFocus
+
+
+
+ 6
+ wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Text size:
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_textSizeLabel
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+ 6
+ wxEXPAND
+ 1
+
+
+ bSizeCtrlSizer
+ wxHORIZONTAL
+ none
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_SIZE
+
+ 0
+
+
+
+ 0
+
+ 1
+ m_textSizeCtrl
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+ 2
+ wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ mm
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_textSizeUnits
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_separator1
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Bold
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_bold
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Bold
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Italic
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_italic
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Italic
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_separator2
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align right
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_spin0
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align right
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align bottom
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_spin1
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align bottom
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align left
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_spin2
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align left
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+ Align top
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_spin3
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+ Align top
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+
+ 0
+ 0
+
+ Dock
+ 0
+ Left
+ 0
+
+ 1
+
+
+ 0
+ 0
+ wxID_ANY
+
+
+ 0
+
+ 0
+
+
+ 0
+
+ 1
+ m_separator3
+ 1
+
+
+ protected
+ 1
+
+
+
+ Resizable
+ 1
+ 21,21
+ wxBORDER_NONE
+ BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 15
+ wxEXPAND
+ 1
+
+ 0
+ protected
+ 0
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+
+ wxID_ANY
+ Syntax help
+
+ 0
+
+
+ 0
+
+ 1
+ m_syntaxHelp
+
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ wxHL_DEFAULT_STYLE
+ ; ; forward_declare
+ 0
+ Show syntax help window
+
+
+
+
+
+ OnFormattingHelp
+
+
+
+
+
+
+
+ 5
+ wxEXPAND|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticline
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ wxLI_HORIZONTAL
+ ; ; forward_declare
+ 0
+
+
+
+
+
+
+
+ 5
+ wxEXPAND|wxALL
+ 0
+
+
+ bSizer4
+ wxHORIZONTAL
+ none
+
+ 5
+ wxALL|wxEXPAND
+ 1
+
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer1
+ protected
+
+
+
+
+
+
+
+
diff --git a/eeschema/dialogs/dialog_text_and_label_properties_base.h b/eeschema/dialogs/dialog_text_properties_base.h
similarity index 54%
rename from eeschema/dialogs/dialog_text_and_label_properties_base.h
rename to eeschema/dialogs/dialog_text_properties_base.h
index 01888ccaa0..9510f80a13 100644
--- a/eeschema/dialogs/dialog_text_and_label_properties_base.h
+++ b/eeschema/dialogs/dialog_text_properties_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -10,6 +10,8 @@
#include
#include
#include
+class BITMAP_BUTTON;
+
#include "dialog_shim.h"
#include
#include
@@ -17,62 +19,63 @@
#include
#include
#include
-#include
#include
-#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include
-#include
-#include
+#include
#include
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-/// Class DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE
+/// Class DIALOG_TEXT_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
-class DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
+class DIALOG_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
{
private:
protected:
enum
{
- wxID_VALUESINGLE = 1000,
- wxID_SIZE
+ wxID_SIZE = 1000
};
wxFlexGridSizer* m_textEntrySizer;
- wxStaticText* m_labelSingleLine;
- wxTextCtrl* m_valueSingleLine;
- wxStaticText* m_labelMultiLine;
- wxStyledTextCtrl* m_valueMultiLine;
- wxStaticText* m_labelCombo;
- wxComboBox* m_valueCombo;
+ wxStaticText* m_textLabel;
+ wxStyledTextCtrl* m_textCtrl;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;
- wxHyperlinkCtrl* m_formattingHelp;
- wxStaticText* m_note1;
- wxStaticText* m_note2;
- wxRadioBox* m_TextOrient;
- wxRadioBox* m_TextStyle;
- wxRadioBox* m_TextShape;
+ BITMAP_BUTTON* m_separator1;
+ BITMAP_BUTTON* m_bold;
+ BITMAP_BUTTON* m_italic;
+ BITMAP_BUTTON* m_separator2;
+ BITMAP_BUTTON* m_spin0;
+ BITMAP_BUTTON* m_spin1;
+ BITMAP_BUTTON* m_spin2;
+ BITMAP_BUTTON* m_spin3;
+ BITMAP_BUTTON* m_separator3;
+ wxHyperlinkCtrl* m_syntaxHelp;
+ wxStaticLine* m_staticline;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
- // Virtual event handlers, override them in your derived class
- virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); }
+ // Virtual event handlers, overide them in your derived class
virtual void onMultiLineTCLostFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void OnFormattingHelp( wxHyperlinkEvent& event ) { event.Skip(); }
public:
- DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-
- ~DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE();
+ DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_TEXT_PROPERTIES_BASE();
};
diff --git a/eeschema/ee_collectors.cpp b/eeschema/ee_collectors.cpp
index d532aac321..7d6f345a5c 100644
--- a/eeschema/ee_collectors.cpp
+++ b/eeschema/ee_collectors.cpp
@@ -48,6 +48,7 @@ const KICAD_T EE_COLLECTOR::EditableItems[] = {
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
+ SCH_NETCLASS_FLAG_T,
SCH_FIELD_T,
SCH_SYMBOL_T,
SCH_SHEET_PIN_T,
@@ -86,6 +87,7 @@ const KICAD_T EE_COLLECTOR::MovableItems[] =
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
+ SCH_NETCLASS_FLAG_T,
SCH_FIELD_T,
SCH_SYMBOL_T,
SCH_SHEET_PIN_T,
@@ -103,7 +105,10 @@ const KICAD_T EE_COLLECTOR::WiresOnly[] = {
const KICAD_T EE_COLLECTOR::FieldOwners[] = {
SCH_SYMBOL_T,
SCH_SHEET_T,
+ SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
+ SCH_HIER_LABEL_T,
+ SCH_NETCLASS_FLAG_T,
EOT
};
@@ -148,48 +153,8 @@ void EE_COLLECTOR::Collect( SCH_SCREEN* aScreen, const KICAD_T aFilterList[], co
if( aScreen )
{
- // Symbols and sheets own their own children so have to be visited even if
- // they're not in the filter list
- bool symbolsVisited = false;
- bool sheetsVisited = false;
- bool globalLabelsVisited = false;
-
- EE_RTREE& items = aScreen->Items();
-
- for( const KICAD_T *filter = aFilterList; *filter != EOT; ++filter )
- {
- for( SCH_ITEM *item : items.Overlapping( *filter, aPos, m_Threshold ) )
- {
- if( *filter == SCH_SYMBOL_T || *filter == SCH_LOCATE_ANY_T )
- symbolsVisited = true;
-
- if( *filter == SCH_SHEET_T || *filter == SCH_LOCATE_ANY_T )
- sheetsVisited = true;
-
- if( *filter == SCH_GLOBAL_LABEL_T || *filter == SCH_LOCATE_ANY_T )
- globalLabelsVisited = true;
-
- item->Visit( m_inspector, nullptr, m_scanTypes );
- }
- }
-
- if( !symbolsVisited )
- {
- for( SCH_ITEM *item : items.Overlapping( SCH_SYMBOL_T, aPos, m_Threshold ) )
- item->Visit( m_inspector, nullptr, m_scanTypes );
- }
-
- if( !sheetsVisited )
- {
- for( SCH_ITEM *item : items.Overlapping( SCH_SHEET_T, aPos, m_Threshold ) )
- item->Visit( m_inspector, nullptr, m_scanTypes );
- }
-
- if( !globalLabelsVisited )
- {
- for( SCH_ITEM *item : items.Overlapping( SCH_GLOBAL_LABEL_T, aPos, m_Threshold ) )
- item->Visit( m_inspector, nullptr, m_scanTypes );
- }
+ for( SCH_ITEM *item : aScreen->Items().Overlapping( SCH_LOCATE_ANY_T, aPos, m_Threshold ) )
+ item->Visit( m_inspector, nullptr, m_scanTypes );
}
}
@@ -245,9 +210,12 @@ void CollectOtherUnits( const wxString& aRef, int aUnit, const LIB_ID& aLibId,
{
SCH_REFERENCE symbol = symbols[i];
- if( symbol.GetRef() == aRef && symbol.GetSymbol()->GetLibId() == aLibId
- && symbol.GetUnit() != aUnit )
+ if( symbol.GetRef() == aRef
+ && symbol.GetSymbol()->GetLibId() == aLibId
+ && symbol.GetUnit() != aUnit )
+ {
otherUnits->push_back( symbol.GetSymbol() );
+ }
}
}
diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp
index 539450ce32..be303edc1c 100644
--- a/eeschema/eeschema_settings.cpp
+++ b/eeschema/eeschema_settings.cpp
@@ -73,12 +73,15 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_Simulator(),
m_RescueNeverShow( false )
{
- m_params.emplace_back( new PARAM( "appearance.edit_component_visible_columns",
- &m_Appearance.edit_component_visible_columns, "0 1 2 3 4 5 6 7" ) );
+ m_params.emplace_back( new PARAM( "appearance.edit_symbol_visible_columns",
+ &m_Appearance.edit_symbol_visible_columns, "0 1 2 3 4 5 6 7" ) );
m_params.emplace_back( new PARAM( "appearance.edit_sheet_visible_columns",
&m_Appearance.edit_sheet_visible_columns, "0 1 2 3 4 5 6 7" ) );
+ m_params.emplace_back( new PARAM( "appearance.edit_label_visible_columns",
+ &m_Appearance.edit_label_visible_columns, "0 1 2 3 4 5 6 7" ) );
+
m_params.emplace_back( new PARAM( "appearance.erc_severities",
&m_Appearance.erc_severities, RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) );
diff --git a/eeschema/eeschema_settings.h b/eeschema/eeschema_settings.h
index 5fed482710..f53136bced 100644
--- a/eeschema/eeschema_settings.h
+++ b/eeschema/eeschema_settings.h
@@ -35,8 +35,9 @@ class EESCHEMA_SETTINGS : public APP_SETTINGS_BASE
public:
struct APPEARANCE
{
- wxString edit_component_visible_columns;
+ wxString edit_symbol_visible_columns;
wxString edit_sheet_visible_columns;
+ wxString edit_label_visible_columns;
int erc_severities;
bool footprint_preview;
bool navigator_stays_open;
diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp
index 9f437c7ed4..c9a57988e2 100644
--- a/eeschema/fields_grid_table.cpp
+++ b/eeschema/fields_grid_table.cpp
@@ -27,17 +27,22 @@
#include
#include
#include
+#include
#include
#include
+#include
+#include
#include
+#include
#include
#include
#include
#include
+#include
#include "eda_doc.h"
#include
#include
-
+#include
enum
{
@@ -88,6 +93,28 @@ FIELDS_GRID_TABLE::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
}
+template
+FIELDS_GRID_TABLE::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame,
+ WX_GRID* aGrid, SCH_LABEL_BASE* aLabel ) :
+ m_frame( aFrame ),
+ m_dialog( aDialog ),
+ m_userUnits( aDialog->GetUserUnits() ),
+ m_grid( aGrid ),
+ m_parentType( SCH_LABEL_LOCATE_ANY_T ),
+ m_mandatoryFieldCount( aLabel->GetMandatoryFieldCount() ),
+ m_part( nullptr ),
+ m_fieldNameValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_NAME ),
+ m_referenceValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 ),
+ m_valueValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 ),
+ m_libIdValidator(),
+ m_urlValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_VALUE ),
+ m_nonUrlValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_VALUE ),
+ m_filepathValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 )
+{
+ initGrid( aGrid );
+}
+
+
template
void FIELDS_GRID_TABLE::initGrid( WX_GRID* aGrid )
{
@@ -169,6 +196,23 @@ void FIELDS_GRID_TABLE::initGrid( WX_GRID* aGrid )
m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
+ SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame );
+ wxArrayString existingNetclasses;
+
+ if( editFrame )
+ {
+ // Load the combobox with existing existingNetclassNames
+ NET_SETTINGS& netSettings = editFrame->Schematic().Prj().GetProjectFile().NetSettings();
+
+ existingNetclasses.push_back( netSettings.m_NetClasses.GetDefault()->GetName() );
+
+ for( const std::pair& pair : netSettings.m_NetClasses )
+ existingNetclasses.push_back( pair.second->GetName() );
+ }
+
+ m_netclassAttr = new wxGridCellAttr;
+ m_netclassAttr->SetEditor( new GRID_CELL_COMBOBOX( existingNetclasses ) );
+
m_frame->Bind( UNITS_CHANGED, &FIELDS_GRID_TABLE::onUnitsChanged, this );
}
@@ -188,6 +232,7 @@ FIELDS_GRID_TABLE::~FIELDS_GRID_TABLE()
m_vAlignAttr->DecRef();
m_hAlignAttr->DecRef();
m_orientationAttr->DecRef();
+ m_netclassAttr->DecRef();
m_frame->Unbind( UNITS_CHANGED, &FIELDS_GRID_TABLE::onUnitsChanged, this );
}
@@ -321,6 +366,12 @@ wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAtt
m_filepathAttr->IncRef();
return m_filepathAttr;
}
+ else if( ( m_parentType == SCH_LABEL_LOCATE_ANY_T )
+ && this->at( (size_t) aRow ).GetCanonicalName() == wxT( "Netclass" ) )
+ {
+ m_netclassAttr->IncRef();
+ return m_netclassAttr;
+ }
else
{
wxString fn = GetValue( aRow, FDC_NAME );
@@ -342,8 +393,6 @@ wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAtt
}
}
- return nullptr;
-
case FDC_TEXT_SIZE:
case FDC_POSX:
case FDC_POSY:
@@ -383,17 +432,31 @@ wxString FIELDS_GRID_TABLE::GetValue( int aRow, int aCol )
switch( aCol )
{
case FDC_NAME:
- // Use default field name for mandatory fields, because they are translated
+ // Use default field names for mandatory and system fields because they are translated
// according to the current locale
- if( aRow < m_mandatoryFieldCount )
+ if( m_parentType == SCH_SYMBOL_T )
{
- if( m_parentType == SCH_SYMBOL_T )
+ if( aRow < m_mandatoryFieldCount )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( aRow );
- else if( m_parentType == SCH_SHEET_T )
- return SCH_SHEET::GetDefaultFieldName( aRow );
+ else
+ return field.GetName( false );
+ }
+ else if( m_parentType == SCH_SHEET_T )
+ {
+ if( aRow < m_mandatoryFieldCount )
+ return SCH_SHEET::GetDefaultFieldName( aRow );
+ else
+ return field.GetName( false );
+ }
+ else if( m_parentType == SCH_LABEL_LOCATE_ANY_T )
+ {
+ return SCH_LABEL_BASE::GetDefaultFieldName( field.GetCanonicalName(), false );
+ }
+ else
+ {
+ wxFAIL_MSG( "Unhandled field owner type." );
+ return field.GetName( false );
}
-
- return field.GetName( false );
case FDC_VALUE:
return UnescapeString( field.GetText() );
@@ -679,8 +742,8 @@ bool FIELDS_GRID_TABLE::BoolFromString( wxString aValue ) const
}
else
{
- wxFAIL_MSG( wxString::Format( "string '%s' can't be converted to boolean "
- "correctly, it will have been perceived as FALSE", aValue ) );
+ wxFAIL_MSG( wxString::Format( "string '%s' can't be converted to boolean correctly and "
+ "will be perceived as FALSE", aValue ) );
return false;
}
}
diff --git a/eeschema/fields_grid_table.h b/eeschema/fields_grid_table.h
index c01b321956..936627d5c4 100644
--- a/eeschema/fields_grid_table.h
+++ b/eeschema/fields_grid_table.h
@@ -33,6 +33,7 @@
class SCH_BASE_FRAME;
class DIALOG_SHIM;
+class SCH_LABEL_BASE;
class FIELDS_GRID_TRICKS : public GRID_TRICKS
@@ -76,6 +77,8 @@ public:
LIB_SYMBOL* aSymbol );
FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, WX_GRID* aGrid,
SCH_SHEET* aSheet );
+ FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, WX_GRID* aGrid,
+ SCH_LABEL_BASE* aLabel );
~FIELDS_GRID_TABLE();
int GetNumberRows() override { return (int) this->size(); }
@@ -135,6 +138,7 @@ private:
wxGridCellAttr* m_vAlignAttr;
wxGridCellAttr* m_hAlignAttr;
wxGridCellAttr* m_orientationAttr;
+ wxGridCellAttr* m_netclassAttr;
};
diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp
index 53859d3194..ba4f406e6a 100644
--- a/eeschema/menubar.cpp
+++ b/eeschema/menubar.cpp
@@ -207,6 +207,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Add( EE_ACTIONS::placeNoConnect );
placeMenu->Add( EE_ACTIONS::placeJunction );
placeMenu->Add( EE_ACTIONS::placeLabel );
+ placeMenu->Add( EE_ACTIONS::placeClassLabel );
placeMenu->Add( EE_ACTIONS::placeGlobalLabel );
placeMenu->AppendSeparator();
diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp
index 162cd5eff8..54ef9def88 100644
--- a/eeschema/sch_base_frame.cpp
+++ b/eeschema/sch_base_frame.cpp
@@ -316,7 +316,13 @@ void SCH_BASE_FRAME::UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete, bool aUpda
GetCanvas()->GetView()->Update( aItem );
// Some children are drawn from their parents. Mark them for re-paint.
- static KICAD_T parentTypes[] = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
+ static KICAD_T parentTypes[] = { SCH_SYMBOL_T,
+ SCH_SHEET_T,
+ SCH_LABEL_T,
+ SCH_GLOBAL_LABEL_T,
+ SCH_HIER_LABEL_T,
+ SCH_NETCLASS_FLAG_T,
+ EOT };
if( parent && parent->IsType( parentTypes ) )
GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp
index 3eeb6f772b..e6f8ef27b5 100644
--- a/eeschema/sch_edit_frame.cpp
+++ b/eeschema/sch_edit_frame.cpp
@@ -479,6 +479,7 @@ void SCH_EDIT_FRAME::setupUIConditions()
CURRENT_TOOL( EE_ACTIONS::placeNoConnect );
CURRENT_TOOL( EE_ACTIONS::placeJunction );
CURRENT_TOOL( EE_ACTIONS::placeLabel );
+ CURRENT_TOOL( EE_ACTIONS::placeClassLabel );
CURRENT_TOOL( EE_ACTIONS::placeGlobalLabel );
CURRENT_TOOL( EE_ACTIONS::placeHierLabel );
CURRENT_TOOL( EE_ACTIONS::drawSheet );
@@ -1135,6 +1136,9 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
static void inheritNetclass( const SCH_SHEET_PATH& aSheetPath, SCH_TEXT* aItem )
{
+ if( CONNECTION_SUBGRAPH::GetDriverPriority( aItem ) == CONNECTION_SUBGRAPH::PRIORITY::NONE )
+ return;
+
// Netclasses are assigned to subgraphs by association with their netname. However, when
// a new label is attached to an existing subgraph (with an existing netclass association),
// the association will be lost as the label will drive its name on to the graph.
@@ -1434,7 +1438,7 @@ void SCH_EDIT_FRAME::RecomputeIntersheetRefs()
for( SCH_GLOBALLABEL* globalLabel : globalLabels )
{
- globalLabel->GetIntersheetRefs()->SetVisible( show );
+ globalLabel->GetFields()[0].SetVisible( show );
if( show )
{
@@ -1450,19 +1454,7 @@ void SCH_EDIT_FRAME::ShowAllIntersheetRefs( bool aShow )
if( aShow )
RecomputeIntersheetRefs();
- SCH_SCREENS screens( Schematic().Root() );
-
- for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
- {
- for( SCH_ITEM* item : screen->Items().OfType( SCH_GLOBAL_LABEL_T ) )
- {
- SCH_GLOBALLABEL* gLabel = (SCH_GLOBALLABEL*)( item );
- SCH_FIELD* intersheetRef = gLabel->GetIntersheetRefs();
-
- intersheetRef->SetVisible( aShow );
- UpdateItem( intersheetRef, true );
- }
- }
+ GetCanvas()->GetView()->SetLayerVisible( LAYER_INTERSHEET_REFS, aShow );
}
diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h
index 37dee4b8b2..c5960b4053 100644
--- a/eeschema/sch_edit_frame.h
+++ b/eeschema/sch_edit_frame.h
@@ -40,7 +40,6 @@
#include
#include