Commit c5a2028a authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: Remove usage of tabs in dialog_choose_component.cpp strings, because...

Eeschema: Remove usage of tabs in dialog_choose_component.cpp strings, because it does not work very well on Linux, and does not work on Windows.
This is replaced by the right number of space, using a fixed font (like in CvPcb)
Fix mismatch between icons and the actual rotation of components (CW instead of CCW) (bug 1022154 )
parents d475c544 b4d1813d
...@@ -141,8 +141,6 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName, ...@@ -141,8 +141,6 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
const wxArrayString& aAliasNameList, const wxArrayString& aAliasNameList,
CMP_LIBRARY* aOptionalLib ) CMP_LIBRARY* aOptionalLib )
{ {
static const wxChar unitLetter[] = wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
TREE_NODE* const lib_node = new TREE_NODE( TREE_NODE::TYPE_LIB, NULL, NULL, TREE_NODE* const lib_node = new TREE_NODE( TREE_NODE::TYPE_LIB, NULL, NULL,
aNodeName, wxEmptyString, wxEmptyString ); aNodeName, wxEmptyString, wxEmptyString );
nodes.push_back( lib_node ); nodes.push_back( lib_node );
...@@ -168,8 +166,16 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName, ...@@ -168,8 +166,16 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
if( !a->GetDescription().empty() ) if( !a->GetDescription().empty() )
{ {
// Preformatting. Unfortunately, the tree widget doesn't have columns // Preformatting. Unfortunately, the tree widget doesn't have columns
display_info.Printf( wxT(" %s[ %s ]"), // and using tabs does not work very well or does not work at all
( a->GetName().length() <= 8 ) ? wxT("\t\t") : wxT("\t"), // (depending on OS versions).
#define COLUMN_DESCR_POS 24
int len = a->GetName().length();
display_info.Clear();
if( len <= COLUMN_DESCR_POS )
display_info.Append( ' ', COLUMN_DESCR_POS - len );
display_info += wxString::Format( wxT( " [ %s ]" ),
GetChars( a->GetDescription() ) ); GetChars( a->GetDescription() ) );
} }
...@@ -178,15 +184,20 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName, ...@@ -178,15 +184,20 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
nodes.push_back( alias_node ); nodes.push_back( alias_node );
if( a->GetComponent()->IsMulti() ) // Add all units as sub-nodes. if( a->GetComponent()->IsMulti() ) // Add all units as sub-nodes.
for ( int u = 0; u < a->GetComponent()->GetPartCount(); ++u ) {
wxString unitName;
for( int u = 1; u <= a->GetComponent()->GetPartCount(); ++u )
{ {
const wxString unitName = unitLetter[u]; unitName = LIB_COMPONENT::ReturnSubReference( u, false );
TREE_NODE* unit_node = new TREE_NODE(TREE_NODE::TYPE_UNIT, alias_node, a, TREE_NODE* unit_node = new TREE_NODE( TREE_NODE::TYPE_UNIT,
_("Unit ") + unitName, alias_node, a,
wxEmptyString, wxEmptyString ); _("Unit") + wxT( " " ) + unitName,
unit_node->Unit = u + 1; wxEmptyString, wxEmptyString );
unit_node->Unit = u;
nodes.push_back( unit_node ); nodes.push_back( unit_node );
} }
}
} }
} }
......
...@@ -47,6 +47,13 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxStr ...@@ -47,6 +47,13 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxStr
m_search_container->SetTree( m_libraryComponentTree ); m_search_container->SetTree( m_libraryComponentTree );
m_searchBox->SetFocus(); m_searchBox->SetFocus();
m_componentDetails->SetEditable( false ); m_componentDetails->SetEditable( false );
// The tree showing libs and component uses a fixed font,
// because we want controle the position of some info when drawing the
// tree. Using tabs does not work very well (does not work on Windows)
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
m_libraryComponentTree->SetFont( wxFont( font.GetPointSize(),
wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL ) );
} }
......
...@@ -399,8 +399,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -399,8 +399,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Library // Library
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "Set &Library Path" ), _( "Set Active &Libraries" ),
_( "Set library preferences" ), _( "Set active library list and library paths" ),
KiBitmap( library_xpm ) ); KiBitmap( library_xpm ) );
// Colors // Colors
......
...@@ -764,14 +764,14 @@ void SCH_COMPONENT::SetOrientation( int aOrientation ) ...@@ -764,14 +764,14 @@ void SCH_COMPONENT::SetOrientation( int aOrientation )
m_transform.x2 = m_transform.y1 = 0; m_transform.x2 = m_transform.y1 = 0;
break; break;
case CMP_ROTATE_CLOCKWISE: // Rotate + (incremental rotation) case CMP_ROTATE_COUNTERCLOCKWISE: // Rotate + (incremental rotation)
temp.x1 = temp.y2 = 0; temp.x1 = temp.y2 = 0;
temp.y1 = 1; temp.y1 = 1;
temp.x2 = -1; temp.x2 = -1;
transform = true; transform = true;
break; break;
case CMP_ROTATE_COUNTERCLOCKWISE: // Rotate - (incremental rotation) case CMP_ROTATE_CLOCKWISE: // Rotate - (incremental rotation)
temp.x1 = temp.y2 = 0; temp.x1 = temp.y2 = 0;
temp.y1 = -1; temp.y1 = -1;
temp.x2 = 1; temp.x2 = 1;
...@@ -1534,8 +1534,7 @@ void SCH_COMPONENT::Rotate( wxPoint aPosition ) ...@@ -1534,8 +1534,7 @@ void SCH_COMPONENT::Rotate( wxPoint aPosition )
RotatePoint( &m_Pos, aPosition, 900 ); RotatePoint( &m_Pos, aPosition, 900 );
//SetOrientation( CMP_ROTATE_COUNTERCLOCKWISE ); SetOrientation( CMP_ROTATE_COUNTERCLOCKWISE );
SetOrientation( CMP_ROTATE_CLOCKWISE );
for( int ii = 0; ii < GetFieldCount(); ii++ ) for( int ii = 0; ii < GetFieldCount(); ii++ )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment