Browse Source

Apply Scintilla hack to get auto-sizing canvas.

Fixes https://gitlab.com/kicad/code/kicad/issues/4207
pull/16/head
Jeff Young 6 years ago
parent
commit
7e4d255cdd
  1. 12
      eeschema/dialogs/dialog_edit_label.cpp
  2. 2
      pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp
  3. 2
      pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp
  4. 6
      pcbnew/dialogs/dialog_text_properties.cpp

12
eeschema/dialogs/dialog_edit_label.cpp

@ -117,7 +117,11 @@ DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTe
}
m_valueMultiLine->SetEOLMode( wxSTC_EOL_LF );
m_valueMultiLine->SetUseHorizontalScrollBar( false );
// A hack which causes Scintilla to auto-size the text editor canvas
// See: https://github.com/jacobslusser/ScintillaNET/issues/216
m_valueMultiLine->SetScrollWidth( 1 );
m_valueMultiLine->SetScrollWidthTracking( true );
if( m_CurrentText->IsMultilineAllowed() )
{
@ -146,8 +150,10 @@ DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTe
m_activeTextCtrl = m_valueSingleLine;
m_activeTextEntry = m_valueSingleLine;
m_labelCombo->Show( false ); m_valueCombo->Show( false );
m_labelMultiLine->Show( false ); m_valueMultiLine->Show( false );
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 );

2
pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp

@ -445,7 +445,7 @@ DIALOG_FOOTPRINT_BOARD_EDITOR_BASE::DIALOG_FOOTPRINT_BOARD_EDITOR_BASE( wxWindow
// Cell Defaults
m_modelsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_modelsGrid->SetMinSize( wxSize( -1,86 ) );
m_modelsGrid->SetMinSize( wxSize( -1,56 ) );
sbSizer3->Add( m_modelsGrid, 1, wxEXPAND|wxRIGHT, 5 );

2
pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp

@ -3653,7 +3653,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,86</property>
<property name="minimum_size">-1,56</property>
<property name="moveable">1</property>
<property name="name">m_modelsGrid</property>
<property name="pane_border">1</property>

6
pcbnew/dialogs/dialog_text_properties.cpp

@ -60,7 +60,11 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO
wxString title;
m_MultiLineText->SetEOLMode( wxSTC_EOL_LF );
m_MultiLineText->SetUseHorizontalScrollBar( false );
// A hack which causes Scintilla to auto-size the text editor canvas
// See: https://github.com/jacobslusser/ScintillaNET/issues/216
m_MultiLineText->SetScrollWidth( 1 );
m_MultiLineText->SetScrollWidthTracking( true );
m_linesThickness.Show( m_item->Type() == PCB_DIMENSION_T );

Loading…
Cancel
Save