From b177716b65bf285443b9f203ae5d53771c697a50 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Mon, 18 Nov 2013 16:03:34 -0600 Subject: [PATCH] Work around wx 2.8 bug in wxListControl not honoring omissing of wxHSCROLL. --- common/displlst.cpp | 23 +++++++++++++++++++ .../dialog_edit_component_in_schematic.cpp | 10 ++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/common/displlst.cpp b/common/displlst.cpp index 9da30cbdb1..e03910ee55 100644 --- a/common/displlst.cpp +++ b/common/displlst.cpp @@ -65,7 +65,30 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl m_staticTextMsg->Show( false ); } +#if !wxCHECK_VERSION( 2, 9, 0 ) + // wx 2.8.x has bug in wxListCtrl WRT honoring the omission of wxHSCROLL, at least + // on gtk2. Fix by setting minimum width so horizontal wxListCtrl scrolling is + // not needed on 2.8.x because of minumum visible width setting: + { + int width = 0; + + for( unsigned col = 0; col < aItemHeaders.Count(); ++col ) + { + width += m_listBox->GetColumnWidth( col ) + 2; + } + + //width += 40; // vert scroll bar. + + wxSize sz = m_listBox->GetSize(); + + sz.SetWidth( width ); + + m_listBox->SetMinSize( sz ); + } +#endif + Fit(); + Centre(); if( !!aSelection ) { diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index 61d33c37d4..f10a58628d 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -793,13 +793,15 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField() rotateCheckBox->SetValue( field.GetOrientation() == TEXT_ORIENT_VERT ); // Copy the text justification - EDA_TEXT_HJUSTIFY_T hjustify[3] = { - GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER, + static const EDA_TEXT_HJUSTIFY_T hjustify[] = { + GR_TEXT_HJUSTIFY_LEFT, + GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_RIGHT }; - EDA_TEXT_VJUSTIFY_T vjustify[3] = { - GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, + static const EDA_TEXT_VJUSTIFY_T vjustify[] = { + GR_TEXT_VJUSTIFY_BOTTOM, + GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP };