Commit de9fb14f authored by charras's avatar charras

minor updates

parent 26b20cad
......@@ -512,7 +512,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const
break;
text.erase( i, 1 );
text.insert( i, _( "\\n" ) );
text.insert( i, wxT( "\\n" ) );
}
if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n",
......
......@@ -93,26 +93,6 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_LibPathChanged = false;
m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath;
// Init currently availlable netlist formats
wxArrayString NetlistNameItems;
NetlistNameItems.Add( wxT( "Pcbnew" ) );
NetlistNameItems.Add( wxT( "OrcadPcb2" ) );
NetlistNameItems.Add( wxT( "CadStar" ) );
NetlistNameItems.Add( wxT( "Spice" ) );
// Add extra neltlist format (using external converter)
msg = ReturnUserNetlistTypeName( true );
while( !msg.IsEmpty() )
{
NetlistNameItems.Add( msg );
msg = ReturnUserNetlistTypeName( false );
}
m_NetFormatBox->InsertItems( NetlistNameItems, 0 );
if( m_Parent->m_NetlistFormat > (int) m_NetFormatBox->GetCount() )
m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW;
m_NetFormatBox->SetSelection( m_Parent->m_NetlistFormat - NET_TYPE_PCBNEW );
m_ListLibr->InsertItems( m_Parent->m_ComponentLibFiles, 0 );
......@@ -158,9 +138,6 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
/**************************************************************/
{
// Set new netlist format
m_Parent->m_NetlistFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW;
// Recreate the user lib path
if ( m_LibPathChanged )
{
......
......@@ -16,23 +16,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer5;
sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default netlist format") ), wxHORIZONTAL );
m_NetFormatBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxSize( 150,70 ), 0, NULL, wxLB_NEEDED_SB|wxLB_SINGLE );
sbSizer5->Add( m_NetFormatBox, 0, wxALL|wxEXPAND, 5 );
sbSizer5->Add( 0, 15, 0, wxEXPAND, 5 );
bMainSizer->Add( sbSizer5, 0, wxALL, 5 );
wxStaticBoxSizer* sbLibsChoiceSizer;
sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component library files") ), wxHORIZONTAL );
m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Eeschema.\nThe order of this list is important:\nEeschema searchs for a given component using this list order priority.") );
m_ListLibr->SetMinSize( wxSize( 400,90 ) );
m_ListLibr->SetMinSize( wxSize( 400,250 ) );
sbLibsChoiceSizer->Add( m_ListLibr, 1, wxALL|wxEXPAND, 5 );
......
......@@ -75,82 +75,6 @@
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Default netlist format</property>
<property name="minimum_size"></property>
<property name="name">sbSizer5</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxListBox" expanded="1">
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_NetFormatBox</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size">150,70</property>
<property name="style">wxLB_NEEDED_SB|wxLB_SINGLE</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">15</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
......@@ -177,7 +101,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">400,90</property>
<property name="minimum_size">400,250</property>
<property name="name">m_ListLibr</property>
<property name="permission">protected</property>
<property name="pos"></property>
......
......@@ -16,9 +16,9 @@
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/dialog.h>
......@@ -41,8 +41,6 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
wxID_REMOVE_PATH,
};
wxListBox* m_NetFormatBox;
wxListBox* m_ListLibr;
wxButton* m_buttonAddLib;
wxButton* m_buttonIns;
......
......@@ -259,12 +259,10 @@ bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName,
/* User library path takes precedent over default library search paths. */
wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 );
// If the list is void, load the libraries "power.lib" and "device.lib"
/* If the list is void, force loadind the library "power.lib" that is the "standard" library for power symbols
*/
if( m_ComponentLibFiles.GetCount() == 0 )
{
m_ComponentLibFiles.Add( wxT( "power" ) );
m_ComponentLibFiles.Add( wxT( "device" ) );
}
if( frame )
{
......
......@@ -35,7 +35,7 @@ static wxString currentLibraryName;
/** Function LoadLibraryName
* Routine to load the given library name. FullLibName should hold full path
* of file name to open, while LibName should hold only its name.
* IF library already exists, it is NOT reloaded.
* If library already exists, it is NOT reloaded.
* @return : new lib or NULL
*/
/****************************************************************************/
......@@ -101,20 +101,16 @@ LibraryStruct* LoadLibraryName( WinEDA_DrawFrame* frame,
}
/******************************************/
/* Function LoadLibraries
* Clear all alredy loaded librries and load all librairies
/** Function LoadLibraries
* Clear all already loaded libraries and load all librairies
* given in frame->m_ComponentLibFiles
*/
/******************************************/
void LoadLibraries( WinEDA_SchematicFrame* frame )
{
wxFileName fn;
wxString msg, tmp;
unsigned ii, iimax = frame->m_ComponentLibFiles.GetCount();
frame->PrintMsg( _( "Loading schematic component libraries" ) );
// Free the unwanted libraries (i.e. not in list) but keep the cache lib
LibraryStruct* nextlib, * lib = g_LibraryList;
......@@ -143,10 +139,8 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
tmp = wxGetApp().FindLibraryPath( fn );
if( !tmp )
{
msg.Printf( _( "Library file <%s> not found." ),
fn.GetName().c_str() );
wxMessageBox( msg, _( "Library Load Error" ),
wxOK | wxICON_ERROR, frame );
msg.Printf( _( "Library file <%s> not found." ), fn.GetName().c_str() );
wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, frame );
continue;
}
}
......
......@@ -580,9 +580,13 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, _( "Edit Sheet" ), edit_sheet_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize Sheet" ), resize_sheet_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_IMPORT_GLABEL, _("Import PinSheets"),
import_hierarchical_label_xpm );
if( Sheet->m_Label ) // Sheet has pin labels, and can be cleaned
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_CLEANUP_SHEET,
_( "Cleanup PinSheets" ), options_pinsheet_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Sheet" ), delete_sheet_xpm );
}
}
......
......@@ -135,12 +135,12 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
wxString val= CONV_FROM_UTF8( text );
for (;;)
{
int i=val.find(_("\\n"));
int i=val.find(wxT("\\n"));
if (i==wxNOT_FOUND)
break;
val.erase(i,2);
val.insert(i,_("\n"));
val.insert(i,wxT("\n"));
}
SCH_TEXT* TextStruct = new SCH_TEXT( pos, val );
......
......@@ -54,6 +54,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_CLEANUP_SHEET:
case ID_POPUP_SCH_END_SHEET:
case ID_POPUP_SCH_RESIZE_SHEET:
case ID_POPUP_IMPORT_GLABEL:
case ID_POPUP_SCH_EDIT_PINSHEET:
case ID_POPUP_SCH_MOVE_PINSHEET:
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
......@@ -386,15 +387,19 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_EDIT_SHEET:
EditSheet( (DrawSheetStruct*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_IMPORT_GLABEL:
if ( screen->GetCurItem() && screen->GetCurItem()->Type() == DRAW_SHEET_STRUCT_TYPE )
GetScreen()->SetCurItem( Import_PinSheet( (DrawSheetStruct*)screen->GetCurItem(), &dc ) );
break;
case ID_POPUP_SCH_CLEANUP_SHEET:
( (DrawSheetStruct*)
screen->GetCurItem() )->CleanupSheet( this, true );
if ( screen->GetCurItem() && screen->GetCurItem()->Type() == DRAW_SHEET_STRUCT_TYPE )
( (DrawSheetStruct*) screen->GetCurItem() )->CleanupSheet( this, true );
break;
case ID_POPUP_SCH_EDIT_PINSHEET:
Edit_PinSheet( (Hierarchical_PIN_Sheet_Struct*)
screen->GetCurItem(), &dc );
Edit_PinSheet( (Hierarchical_PIN_Sheet_Struct*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_MOVE_PINSHEET:
......
......@@ -201,9 +201,9 @@ void WinEDA_SchematicFrame::ReCreateVToolbar()
wxBitmap( add_hierarchical_subsheet_xpm ),
_( "Place hierarchical sheet" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_IMPORT_GLABEL_BUTT, wxEmptyString,
m_VToolBar->AddTool( ID_POPUP_IMPORT_GLABEL, wxEmptyString,
wxBitmap( import_hierarchical_label_xpm ),
_( "Place a pin sheet , imported from a hierarchical label in sheet" ),
_( "Place a pin sheet , imported from the corresponding hierarchical label in sheet" ),
wxITEM_CHECK );
m_VToolBar->AddTool( ID_SHEET_LABEL_BUTT, wxEmptyString,
......
......@@ -289,6 +289,7 @@ enum main_id {
ID_POPUP_SCH_CLEANUP_SHEET,
ID_POPUP_SCH_EDIT_PINSHEET,
ID_POPUP_SCH_MOVE_PINSHEET,
ID_POPUP_IMPORT_GLABEL,
ID_POPUP_SCH_GENERIC_ORIENT_CMP,
ID_POPUP_SCH_GENERIC_EDIT_CMP,
ID_POPUP_SCH_EDIT_VALUE_CMP,
......
No preview for this file type
This diff is collapsed.
......@@ -985,7 +985,7 @@ void WinEDA_PrjFrame::OnRight( wxTreeEvent& Event )
{
// Grrrr! wxMenu does not have any copy constructor !! (do it by hand)
wxMenuItem* src = list[i];
wxString label = src->GetLabel();
wxString label = src->GetItemLabelText();
// for obscure reasons, the & is translated into _ ... so replace it
label.Replace( wxT( "_" ), wxT( "&" ), true );
......
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