mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Fix wxStyledTextCtrl in field properties dialog on MSW.
The sunken border was included in the size calculation on Windows, causing the same visibility bug. Use a panel with a border that wraps the control instead. (cherry picked from commit 830b963b3a8f057bb4cc81b68836c1105dd008c9)
This commit is contained in:
parent
004645db32
commit
86de85ad78
@ -293,6 +293,7 @@ void DIALOG_FIELD_PROPERTIES::init()
|
||||
SetInitialFocus( m_TextCtrl );
|
||||
|
||||
m_StyledTextCtrl->Show( false );
|
||||
m_StyledTextCtrlBorder->Show( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -37,7 +37,11 @@ DIALOG_FIELD_PROPERTIES_BASE::DIALOG_FIELD_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
m_TextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bTextValueBoxSizer->Add( m_TextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_StyledTextCtrl = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
|
||||
m_StyledTextCtrlBorder = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME|wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer10;
|
||||
bSizer10 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_StyledTextCtrl = new wxStyledTextCtrl( m_StyledTextCtrlBorder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxEmptyString );
|
||||
m_StyledTextCtrl->SetUseTabs( true );
|
||||
m_StyledTextCtrl->SetTabWidth( 4 );
|
||||
m_StyledTextCtrl->SetIndent( 4 );
|
||||
@ -67,7 +71,13 @@ DIALOG_FIELD_PROPERTIES_BASE::DIALOG_FIELD_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
|
||||
m_StyledTextCtrl->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
m_StyledTextCtrl->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
|
||||
bTextValueBoxSizer->Add( m_StyledTextCtrl, 1, wxRIGHT|wxLEFT, 5 );
|
||||
bSizer10->Add( m_StyledTextCtrl, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_StyledTextCtrlBorder->SetSizer( bSizer10 );
|
||||
m_StyledTextCtrlBorder->Layout();
|
||||
bSizer10->Fit( m_StyledTextCtrlBorder );
|
||||
bTextValueBoxSizer->Add( m_StyledTextCtrlBorder, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_TextValueSelectButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bTextValueBoxSizer->Add( m_TextValueSelectButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
@ -222,7 +222,68 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxPanel" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_StyledTextCtrlBorder</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxBORDER_THEME|wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer10</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStyledTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -285,11 +346,14 @@
|
||||
<property name="view_whitespace">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxBORDER_SUNKEN</property>
|
||||
<property name="window_style">wxBORDER_NONE</property>
|
||||
<event name="OnKillFocus">onMultiLineTCLostFocus</event>
|
||||
<event name="OnSetFocus">OnSetFocusText</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
|
@ -24,15 +24,15 @@ class STD_BITMAP_BUTTON;
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/stc/stc.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
@ -48,6 +48,7 @@ class DIALOG_FIELD_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
protected:
|
||||
wxStaticText* m_textLabel;
|
||||
wxTextCtrl* m_TextCtrl;
|
||||
wxPanel* m_StyledTextCtrlBorder;
|
||||
wxStyledTextCtrl* m_StyledTextCtrl;
|
||||
STD_BITMAP_BUTTON* m_TextValueSelectButton;
|
||||
wxStaticText* m_unitLabel;
|
||||
|
Loading…
x
Reference in New Issue
Block a user