Commit ccabd605 authored by Wayne Stambaugh's avatar Wayne Stambaugh

More EESchema dialog file housekeeping and coding policy fixes.

parent 408cf4d8
...@@ -4,6 +4,16 @@ KiCad ChangeLog 2010 ...@@ -4,6 +4,16 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-nov-19 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++EESchema
* Move library dimension, schematic configuration, and schematic options
dialogs to dialogs folder.
* Set library dimension, schematic configuration, and schematic options
dialogs default button to OK button.
* Kicad coding policy clean ups.
2010-nov-17 UPDATE Wayne Stambaugh <stambaughw@verizon.net> 2010-nov-17 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================ ================================================================================
++EESchema ++EESchema
......
...@@ -47,14 +47,14 @@ set(EESCHEMA_SRCS ...@@ -47,14 +47,14 @@ set(EESCHEMA_SRCS
dialogs/dialog_edit_label_base.cpp dialogs/dialog_edit_label_base.cpp
dialogs/dialog_edit_libentry_fields_in_lib.cpp dialogs/dialog_edit_libentry_fields_in_lib.cpp
dialogs/dialog_edit_libentry_fields_in_lib_base.cpp dialogs/dialog_edit_libentry_fields_in_lib_base.cpp
dialog_eeschema_config.cpp dialogs/dialog_eeschema_config.cpp
dialog_eeschema_config_fbp.cpp dialogs/dialog_eeschema_config_fbp.cpp
dialog_eeschema_options_base.cpp dialogs/dialog_eeschema_options_base.cpp
dialog_eeschema_options.cpp dialogs/dialog_eeschema_options.cpp
dialogs/dialog_erc.cpp dialogs/dialog_erc.cpp
dialogs/dialog_erc_base.cpp dialogs/dialog_erc_base.cpp
dialog_libedit_dimensions.cpp dialogs/dialog_libedit_dimensions.cpp
dialog_libedit_dimensions_base.cpp dialogs/dialog_libedit_dimensions_base.cpp
dialogs/dialog_lib_edit_draw_item.cpp dialogs/dialog_lib_edit_draw_item.cpp
dialogs/dialog_lib_edit_draw_item_base.cpp dialogs/dialog_lib_edit_draw_item_base.cpp
dialogs/dialog_lib_edit_pin.cpp dialogs/dialog_lib_edit_pin.cpp
......
...@@ -22,7 +22,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -22,7 +22,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to * Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
* the key (ALT, SHIFT ALT ..) * the key (ALT, SHIFT ALT ..)
*/ */
int WinEDA_LibeditFrame::ReturnBlockCommand( int key ) int LIB_EDIT_FRAME::ReturnBlockCommand( int key )
{ {
int cmd; int cmd;
...@@ -69,7 +69,7 @@ int WinEDA_LibeditFrame::ReturnBlockCommand( int key ) ...@@ -69,7 +69,7 @@ int WinEDA_LibeditFrame::ReturnBlockCommand( int key )
* 1 if HandleBlockPlace must follow (items found, and a block place * 1 if HandleBlockPlace must follow (items found, and a block place
* command must follow) * command must follow)
*/ */
bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
int ItemCount = 0; int ItemCount = 0;
int nextCmd = false; int nextCmd = false;
...@@ -192,7 +192,7 @@ bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -192,7 +192,7 @@ bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
* - block move & drag * - block move & drag
* - block copy & paste * - block copy & paste
*/ */
void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
bool err = FALSE; bool err = FALSE;
wxPoint pt; wxPoint pt;
...@@ -281,7 +281,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -281,7 +281,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
wxPoint move_offset; wxPoint move_offset;
PtBlock = &screen->m_BlockLocate; PtBlock = &screen->m_BlockLocate;
WinEDA_LibeditFrame* parent = ( WinEDA_LibeditFrame* ) panel->GetParent(); LIB_EDIT_FRAME* parent = ( LIB_EDIT_FRAME* ) panel->GetParent();
wxASSERT( parent != NULL ); wxASSERT( parent != NULL );
LIB_COMPONENT* component = parent->GetComponent(); LIB_COMPONENT* component = parent->GetComponent();
......
...@@ -323,7 +323,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi ...@@ -323,7 +323,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi
} }
void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) void LIB_EDIT_FRAME::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
{ {
wxRealPoint delta; wxRealPoint delta;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "dialog_edit_component_in_lib.h" #include "dialog_edit_component_in_lib.h"
DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* aParent ): DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* aParent ):
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( aParent ) DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( aParent )
{ {
m_Parent = aParent; m_Parent = aParent;
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
class DIALOG_EDIT_COMPONENT_IN_LIBRARY: public DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE class DIALOG_EDIT_COMPONENT_IN_LIBRARY: public DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE
{ {
public: public:
WinEDA_LibeditFrame * m_Parent; LIB_EDIT_FRAME* m_Parent;
bool m_RecreateToolbar; bool m_RecreateToolbar;
int m_AliasLocation; int m_AliasLocation;
public: public:
/// Constructors /// Constructors
DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* parent); DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* parent);
~DIALOG_EDIT_COMPONENT_IN_LIBRARY(); ~DIALOG_EDIT_COMPONENT_IN_LIBRARY();
private: private:
......
...@@ -31,16 +31,15 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB : public DIALOG_EDIT_LIBENTRY_FIELDS_IN ...@@ -31,16 +31,15 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB : public DIALOG_EDIT_LIBENTRY_FIELDS_IN
/*****************************************************************************************/ /*****************************************************************************************/
{ {
private: private:
WinEDA_LibeditFrame* m_Parent; LIB_EDIT_FRAME* m_Parent;
LIB_COMPONENT* m_LibEntry; LIB_COMPONENT* m_LibEntry;
bool m_skipCopyFromPanel; bool m_skipCopyFromPanel;
/// a copy of the edited component's LIB_FIELDs /// a copy of the edited component's LIB_FIELDs
std::vector <LIB_FIELD> m_FieldsBuf; std::vector <LIB_FIELD> m_FieldsBuf;
public: public:
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( WinEDA_LibeditFrame* aParent, DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( LIB_EDIT_FRAME* aParent, LIB_COMPONENT* aLibEntry );
LIB_COMPONENT* aLibEntry );
~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB(); ~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB();
private: private:
...@@ -104,7 +103,7 @@ private: ...@@ -104,7 +103,7 @@ private:
}; };
void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event ) void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
{ {
if( m_component == NULL ) if( m_component == NULL )
return; return;
...@@ -127,8 +126,8 @@ void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event ) ...@@ -127,8 +126,8 @@ void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event )
/***********************************************************************/ /***********************************************************************/
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB(
WinEDA_LibeditFrame* aParent, LIB_EDIT_FRAME* aParent,
LIB_COMPONENT* aLibEntry ) : LIB_COMPONENT* aLibEntry ) :
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( aParent ) DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( aParent )
/***********************************************************************/ /***********************************************************************/
{ {
......
...@@ -22,65 +22,16 @@ ...@@ -22,65 +22,16 @@
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include "dialog_eeschema_config_fbp.h" #include "dialog_eeschema_config.h"
class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
{
private:
WinEDA_SchematicFrame* m_Parent;
bool m_LibListChanged;
bool m_LibPathChanged;
wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer
private:
// event handlers, overiding the fbp handlers
void Init();
void OnCloseWindow( wxCloseEvent& event );
void OnRemoveLibClick( wxCommandEvent& event );
void OnAddOrInsertLibClick( wxCommandEvent& event );
void OnAddOrInsertPath( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnRemoveUserPath( wxCommandEvent& event );
void OnButtonUpClick( wxCommandEvent& event );
void OnButtonDownClick( wxCommandEvent& event );
public:
DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame * parent, WinEDA_DrawFrame * activeWindow );
~DIALOG_EESCHEMA_CONFIG() {};
};
/******************************************************************/
void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event )
/******************************************************************/
{
DIALOG_EESCHEMA_CONFIG CfgFrame( this, this );
CfgFrame.ShowModal();
}
/******************************************************************/
void WinEDA_LibeditFrame::InstallConfigFrame( wxCommandEvent& event )
/******************************************************************/
{
DIALOG_EESCHEMA_CONFIG CfgFrame( (WinEDA_SchematicFrame *)GetParent(), this );
CfgFrame.ShowModal(); DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* aSchFrame,
} WinEDA_DrawFrame* aParent )
: DIALOG_EESCHEMA_CONFIG_FBP( aParent )
/*******************************************************************************/
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent,
WinEDA_DrawFrame * activeWindow )
: DIALOG_EESCHEMA_CONFIG_FBP( activeWindow )
/*******************************************************************************/
{ {
wxString msg; wxString msg;
m_Parent = parent; m_Parent = aSchFrame;
Init(); Init();
...@@ -92,9 +43,7 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent, ...@@ -92,9 +43,7 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent,
} }
/***********************************/
void DIALOG_EESCHEMA_CONFIG::Init() void DIALOG_EESCHEMA_CONFIG::Init()
/***********************************/
{ {
wxString msg; wxString msg;
...@@ -104,7 +53,6 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -104,7 +53,6 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_LibPathChanged = false; m_LibPathChanged = false;
m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath; m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath;
m_ListLibr->InsertItems( m_Parent->m_ComponentLibFiles, 0 ); m_ListLibr->InsertItems( m_Parent->m_ComponentLibFiles, 0 );
// Load user libs paths: // Load user libs paths:
...@@ -112,30 +60,33 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -112,30 +60,33 @@ void DIALOG_EESCHEMA_CONFIG::Init()
while( Token.HasMoreTokens() ) while( Token.HasMoreTokens() )
{ {
wxString path = Token.GetNextToken(); wxString path = Token.GetNextToken();
if( wxFileName::DirExists( path ) ) if( wxFileName::DirExists( path ) )
m_listUserPaths->Append(path); m_listUserPaths->Append( path );
} }
// Display actual libraries paths: // Display actual libraries paths:
wxPathList libpaths = wxGetApp().GetLibraryPathList(); wxPathList libpaths = wxGetApp().GetLibraryPathList();
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
{ {
m_DefaultLibraryPathslistBox->Append( libpaths[ii]); m_DefaultLibraryPathslistBox->Append( libpaths[ii]);
} }
// select the first path afer the current path project // select the first path after the current path project
if ( libpaths.GetCount() > 1 ) if ( libpaths.GetCount() > 1 )
m_DefaultLibraryPathslistBox->Select( 1 ); m_DefaultLibraryPathslistBox->Select( 1 );
m_sdbSizer1OK->SetDefault();
} }
/********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
/********************************************************************/
{ {
wxArrayInt selections; wxArrayInt selections;
m_ListLibr->GetSelections(selections); m_ListLibr->GetSelections( selections );
if ( selections.GetCount() <= 0 ) // No selection. if ( selections.GetCount() <= 0 ) // No selection.
return; return;
...@@ -149,6 +100,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event ) ...@@ -149,6 +100,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
int jj = selections[ii]; int jj = selections[ii];
EXCHG( libnames[jj], libnames[jj-1]); EXCHG( libnames[jj], libnames[jj-1]);
} }
m_ListLibr->Set(libnames); m_ListLibr->Set(libnames);
// Reselect previously selected names // Reselect previously selected names
...@@ -162,13 +114,12 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event ) ...@@ -162,13 +114,12 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
} }
/*********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
/*********************************************************************/
{ {
wxArrayInt selections; wxArrayInt selections;
m_ListLibr->GetSelections(selections); m_ListLibr->GetSelections(selections);
if ( selections.GetCount() <= 0 ) // No selection. if ( selections.GetCount() <= 0 ) // No selection.
return; return;
...@@ -183,6 +134,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event ) ...@@ -183,6 +134,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
int jj = selections[ii]; int jj = selections[ii];
EXCHG( libnames[jj], libnames[jj+1]); EXCHG( libnames[jj], libnames[jj+1]);
} }
m_ListLibr->Set(libnames); m_ListLibr->Set(libnames);
// Reselect previously selected names // Reselect previously selected names
...@@ -191,19 +143,18 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event ) ...@@ -191,19 +143,18 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
int jj = selections[ii]; int jj = selections[ii];
m_ListLibr->SetSelection(jj+1); m_ListLibr->SetSelection(jj+1);
} }
m_LibListChanged = TRUE; m_LibListChanged = TRUE;
} }
/******************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
/******************************************************************/
{ {
// Recreate the user lib path // Recreate the user lib path
if ( m_LibPathChanged ) if ( m_LibPathChanged )
{ {
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii) );
wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1); wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1);
} }
...@@ -211,19 +162,19 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -211,19 +162,19 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
} }
/**************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
/**************************************************************/
{ {
// Recreate the user lib path // Recreate the user lib path
if ( m_LibPathChanged ) if ( m_LibPathChanged )
{ {
m_Parent->m_UserLibraryPath.Empty(); m_Parent->m_UserLibraryPath.Empty();
for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii ++ )
for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ )
{ {
if ( ii > 0 ) if ( ii > 0 )
m_Parent->m_UserLibraryPath << wxT(";"); m_Parent->m_UserLibraryPath << wxT( ";" );
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString(ii);
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString( ii );
} }
} }
...@@ -234,42 +185,41 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -234,42 +185,41 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
{ {
// Recreate lib list // Recreate lib list
m_Parent->m_ComponentLibFiles.Clear(); m_Parent->m_ComponentLibFiles.Clear();
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ )
m_Parent->m_ComponentLibFiles.Add(m_ListLibr->GetString(ii) ); m_Parent->m_ComponentLibFiles.Add(m_ListLibr->GetString( ii ) );
// take new list in account // take new list in account
m_Parent->LoadLibraries(); m_Parent->LoadLibraries();
// Clear (if needed) the current active library in libedit because it could be // Clear (if needed) the current active library in libedit because it could be
// removed from memory // removed from memory
WinEDA_LibeditFrame::EnsureActiveLibExists(); LIB_EDIT_FRAME::EnsureActiveLibExists();
} }
m_Parent->SaveProjectFile( this, false ); m_Parent->SaveProjectFile( this, false );
EndModal( wxID_OK ); EndModal( wxID_OK );
} }
/**************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event )
/**************************************************************/
{ {
EndModal( wxID_CANCEL ); EndModal( wxID_CANCEL );
} }
/*********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
/*********************************************************************/
/* Remove a library to the library list. /* Remove a library to the library list.
* The real list (m_Parent->m_ComponentLibFiles) is not changed, so the change can be cancelled * The real list (m_Parent->m_ComponentLibFiles) is not changed, so the change can be canceled
*/ */
void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
{ {
wxArrayInt selections; wxArrayInt selections;
m_ListLibr->GetSelections(selections); m_ListLibr->GetSelections( selections );
for( int ii = selections.GetCount()-1; ii >= 0; ii-- ) for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
{ {
m_ListLibr->Delete(selections[ii] ); m_ListLibr->Delete( selections[ii] );
m_LibListChanged = TRUE; m_LibListChanged = TRUE;
} }
...@@ -277,32 +227,32 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event ) ...@@ -277,32 +227,32 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
if( m_ListLibr->GetCount() > 0 && selections.GetCount() > 0 ) if( m_ListLibr->GetCount() > 0 && selections.GetCount() > 0 )
{ {
int pos = selections[selections.GetCount()-1]; int pos = selections[selections.GetCount()-1];
if( pos == (int)m_ListLibr->GetCount() ) if( pos == (int)m_ListLibr->GetCount() )
pos = m_ListLibr->GetCount() - 1; pos = m_ListLibr->GetCount() - 1;
m_ListLibr->SetSelection( pos ); m_ListLibr->SetSelection( pos );
} }
} }
/**************************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
/**************************************************************************/
/* Insert or add a library to the library list: /* Insert or add a library to the library list:
* The new library is put in list before (insert button) the selection, * The new library is put in list before (insert button) the selection,
* or added (add button) to end of list * or added (add button) to end of list
* The real list (m_Parent->m_ComponentLibFiles) is not changed, so the change * The real list (m_Parent->m_ComponentLibFiles) is not changed, so the change
* can be cancelled * can be canceled
*/ */
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
{ {
int ii; int ii;
wxString libfilename; wxString libfilename;
wxFileName fn; wxFileName fn;
wxArrayInt selections; wxArrayInt selections;
m_ListLibr->GetSelections(selections);
m_ListLibr->GetSelections( selections );
ii = selections.GetCount(); ii = selections.GetCount();
if( ii > 0 ) if( ii > 0 )
ii = selections[0]; ii = selections[0];
else else
...@@ -310,6 +260,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -310,6 +260,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
wxString libpath; wxString libpath;
libpath = m_DefaultLibraryPathslistBox->GetStringSelection(); libpath = m_DefaultLibraryPathslistBox->GetStringSelection();
if ( libpath.IsEmpty() ) if ( libpath.IsEmpty() )
libpath = wxGetApp().ReturnLastVisitedLibraryPath(); libpath = wxGetApp().ReturnLastVisitedLibraryPath();
...@@ -323,9 +274,10 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -323,9 +274,10 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
wxArrayString Filenames; wxArrayString Filenames;
FilesDialog.GetPaths( Filenames ); FilesDialog.GetPaths( Filenames );
for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ ) for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
{ {
fn = Filenames[jj]; fn = Filenames[jj];
if ( jj == 0 ) if ( jj == 0 )
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
...@@ -337,6 +289,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -337,6 +289,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* is a sub path of these default paths * is a sub path of these default paths
*/ */
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() ); libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension: // Remove extension:
fn = libfilename; fn = libfilename;
fn.SetExt(wxEmptyString); fn.SetExt(wxEmptyString);
...@@ -362,9 +315,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -362,9 +315,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
/***********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
/***********************************************************************/
{ {
wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString path = wxGetApp().ReturnLastVisitedLibraryPath();
...@@ -375,26 +326,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) ...@@ -375,26 +326,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
if( !select ) if( !select )
return; return;
if( ! wxFileName::DirExists( path ) ) // Should not occurs if( !wxFileName::DirExists( path ) ) // Should not occurs
return; return;
// Add or insert path if not already in list // Add or insert path if not already in list
if( m_listUserPaths->FindString( path ) == wxNOT_FOUND ) if( m_listUserPaths->FindString( path ) == wxNOT_FOUND )
{ {
int ipos = m_listUserPaths->GetCount(); int ipos = m_listUserPaths->GetCount();
if ( event.GetId() == wxID_INSERT_PATH ) if ( event.GetId() == wxID_INSERT_PATH )
{ {
if ( ipos ) ipos--; if ( ipos )
ipos--;
int jj = m_listUserPaths->GetSelection(); int jj = m_listUserPaths->GetSelection();
if ( jj >= 0 ) if ( jj >= 0 )
ipos = jj; ipos = jj;
} }
// Ask the user if this is a relative path // Ask the user if this is a relative path
int diag = wxMessageBox( int diag = wxMessageBox( _( "Use a relative path?" ), _( "Path type" ),
_( "Use a relative path?" ), wxYES_NO | wxICON_QUESTION, this );
_( "Path type" ),
wxYES_NO | wxICON_QUESTION, this );
if( diag == wxYES ) if( diag == wxYES )
{ // Make it relative { // Make it relative
...@@ -410,26 +363,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) ...@@ -410,26 +363,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
// Display actual libraries paths: // Display actual libraries paths:
wxPathList libpaths = wxGetApp().GetLibraryPathList(); wxPathList libpaths = wxGetApp().GetLibraryPathList();
m_DefaultLibraryPathslistBox->Clear(); m_DefaultLibraryPathslistBox->Clear();
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
{ {
m_DefaultLibraryPathslistBox->Append( libpaths[ii]); m_DefaultLibraryPathslistBox->Append( libpaths[ii]);
} }
} }
else else
DisplayError(this, _("Path already in use") ); {
DisplayError( this, _("Path already in use") );
}
wxGetApp().SaveLastVisitedLibraryPath( path ); wxGetApp().SaveLastVisitedLibraryPath( path );
} }
/***********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
/***********************************************************************/
{ {
int ii = m_listUserPaths->GetSelection(); int ii = m_listUserPaths->GetSelection();
if ( ii < 0 ) if ( ii < 0 )
ii = m_listUserPaths->GetCount()-1; ii = m_listUserPaths->GetCount()-1;
if ( ii >= 0 ) if ( ii >= 0 )
{ {
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() ); wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() );
...@@ -440,8 +395,9 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event ) ...@@ -440,8 +395,9 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
// Display actual libraries paths: // Display actual libraries paths:
wxPathList libpaths = wxGetApp().GetLibraryPathList(); wxPathList libpaths = wxGetApp().GetLibraryPathList();
m_DefaultLibraryPathslistBox->Clear(); m_DefaultLibraryPathslistBox->Clear();
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
{ {
m_DefaultLibraryPathslistBox->Append( libpaths[ii]); m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
} }
} }
#ifndef _DIALOG_EESCHEMA_CONFIG_H_
#define _DIALOG_EESCHEMA_CONFIG_H_
#include "dialog_eeschema_config_fbp.h"
class WinEDA_SchematicFrame;
class WinEDA_DrawFrame;
class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
{
private:
WinEDA_SchematicFrame* m_Parent;
bool m_LibListChanged;
bool m_LibPathChanged;
wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer
private:
// event handlers, overiding the fbp handlers
void Init();
void OnCloseWindow( wxCloseEvent& event );
void OnRemoveLibClick( wxCommandEvent& event );
void OnAddOrInsertLibClick( wxCommandEvent& event );
void OnAddOrInsertPath( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnRemoveUserPath( wxCommandEvent& event );
void OnButtonUpClick( wxCommandEvent& event );
void OnButtonDownClick( wxCommandEvent& event );
public:
DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent, WinEDA_DrawFrame* activeWindow );
~DIALOG_EESCHEMA_CONFIG() {};
};
#endif // _DIALOG_EESCHEMA_CONFIG_H_
...@@ -8,6 +8,7 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : ...@@ -8,6 +8,7 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) :
DIALOG_EESCHEMA_OPTIONS_BASE( parent ) DIALOG_EESCHEMA_OPTIONS_BASE( parent )
{ {
m_choiceUnits->SetFocus(); m_choiceUnits->SetFocus();
m_sdbSizer1OK->SetDefault();
} }
...@@ -21,8 +22,7 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) ...@@ -21,8 +22,7 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select )
} }
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GridArray& grid_sizes, void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GridArray& grid_sizes, int grid_id )
int grid_id )
{ {
wxASSERT( grid_sizes.GetCount() > 0 ); wxASSERT( grid_sizes.GetCount() > 0 );
......
...@@ -94,7 +94,7 @@ public: ...@@ -94,7 +94,7 @@ public:
/** Set the field \a aNdx textctrl to \a aName */ /** Set the field \a aNdx textctrl to \a aName */
void SetFieldName( int aNdx, wxString aName); void SetFieldName( int aNdx, wxString aName );
/** Get the field \a aNdx name from the fields textctrl */ /** Get the field \a aNdx name from the fields textctrl */
wxString GetFieldName( int aNdx ); wxString GetFieldName( int aNdx );
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "dialog_lib_edit_text.h" #include "dialog_lib_edit_text.h"
DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT( WinEDA_LibeditFrame* aParent, LIB_TEXT* aText ) : DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT( LIB_EDIT_FRAME* aParent, LIB_TEXT* aText ) :
DIALOG_LIB_EDIT_TEXT_BASE( aParent ) DIALOG_LIB_EDIT_TEXT_BASE( aParent )
{ {
m_Parent = aParent; m_Parent = aParent;
...@@ -34,8 +34,8 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( ) ...@@ -34,8 +34,8 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( )
if ( m_GraphicText ) if ( m_GraphicText )
{ {
msg = ReturnStringFromValue(g_UserUnit, m_GraphicText->m_Size.x, msg = ReturnStringFromValue( g_UserUnit, m_GraphicText->m_Size.x,
m_Parent->m_InternalUnits); m_Parent->m_InternalUnits );
m_TextSize->SetValue( msg ); m_TextSize->SetValue( msg );
m_TextValue->SetValue( m_GraphicText->m_Text ); m_TextValue->SetValue( m_GraphicText->m_Text );
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
#include "dialog_lib_edit_text_base.h" #include "dialog_lib_edit_text_base.h"
class WinEDA_LibeditFrame; class LIB_EDIT_FRAME;
class LIB_TEXT; class LIB_TEXT;
class DIALOG_LIB_EDIT_TEXT : public DIALOG_LIB_EDIT_TEXT_BASE class DIALOG_LIB_EDIT_TEXT : public DIALOG_LIB_EDIT_TEXT_BASE
{ {
private: private:
WinEDA_LibeditFrame* m_Parent; LIB_EDIT_FRAME* m_Parent;
LIB_TEXT* m_GraphicText; LIB_TEXT* m_GraphicText;
public: public:
DIALOG_LIB_EDIT_TEXT( WinEDA_LibeditFrame* aParent, LIB_TEXT* aText ); DIALOG_LIB_EDIT_TEXT( LIB_EDIT_FRAME* aParent, LIB_TEXT* aText );
~DIALOG_LIB_EDIT_TEXT() {}; ~DIALOG_LIB_EDIT_TEXT() {};
private: private:
......
...@@ -9,39 +9,23 @@ ...@@ -9,39 +9,23 @@
#include "general.h" #include "general.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "dialog_libedit_dimensions_base.h" #include "dialog_libedit_dimensions.h"
class DIALOG_LIBEDIT_DIMENSIONS : public DIALOG_LIBEDIT_DIMENSIONS_BASE DIALOG_LIBEDIT_DIMENSIONS::DIALOG_LIBEDIT_DIMENSIONS( LIB_EDIT_FRAME* parent )
{
private:
public:
DIALOG_LIBEDIT_DIMENSIONS( WinEDA_LibeditFrame* parent);
~DIALOG_LIBEDIT_DIMENSIONS();
private:
void initDialog( );
};
void WinEDA_LibeditFrame::InstallDimensionsDialog( wxCommandEvent& event )
{
DIALOG_LIBEDIT_DIMENSIONS dlg(this);
dlg.ShowModal( );
}
DIALOG_LIBEDIT_DIMENSIONS::DIALOG_LIBEDIT_DIMENSIONS( WinEDA_LibeditFrame* parent )
: DIALOG_LIBEDIT_DIMENSIONS_BASE( parent ) : DIALOG_LIBEDIT_DIMENSIONS_BASE( parent )
{ {
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints( this );
Centre( wxBOTH ); Centre( wxBOTH );
} }
DIALOG_LIBEDIT_DIMENSIONS::~DIALOG_LIBEDIT_DIMENSIONS() DIALOG_LIBEDIT_DIMENSIONS::~DIALOG_LIBEDIT_DIMENSIONS()
{ {
} }
void DIALOG_LIBEDIT_DIMENSIONS::initDialog() void DIALOG_LIBEDIT_DIMENSIONS::initDialog()
{ {
SetFocus( ); SetFocus();
} }
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "sch_sheet.h" #include "sch_sheet.h"
#include "dialog_eeschema_options.h"
#include "dialog_hotkeys_editor.h" #include "dialog_hotkeys_editor.h"
#include "dialogs/dialog_eeschema_config.h"
#include "dialogs/dialog_eeschema_options.h"
#include <wx/fdrepdlg.h> #include <wx/fdrepdlg.h>
...@@ -30,7 +32,16 @@ ...@@ -30,7 +32,16 @@
#define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings. #define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings.
void WinEDA_LibeditFrame::Process_Config( wxCommandEvent& event )
void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{
DIALOG_EESCHEMA_CONFIG CfgFrame( (WinEDA_SchematicFrame *)GetParent(), this );
CfgFrame.ShowModal();
}
void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
...@@ -87,11 +98,18 @@ void WinEDA_LibeditFrame::Process_Config( wxCommandEvent& event ) ...@@ -87,11 +98,18 @@ void WinEDA_LibeditFrame::Process_Config( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_LibeditFrame::Process_Config error" ) ); DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Config error" ) );
} }
} }
void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event )
{
DIALOG_EESCHEMA_CONFIG CfgFrame( this, this );
CfgFrame.ShowModal();
}
void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
{ {
......
...@@ -218,7 +218,7 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN ...@@ -218,7 +218,7 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN
// Clear (if needed) the current active library in libedit because it could be // Clear (if needed) the current active library in libedit because it could be
// removed from memory // removed from memory
WinEDA_LibeditFrame::EnsureActiveLibExists(); LIB_EDIT_FRAME::EnsureActiveLibExists();
// Delete old caches. // Delete old caches.
CMP_LIBRARY::RemoveCacheLibrary(); CMP_LIBRARY::RemoveCacheLibrary();
......
...@@ -837,7 +837,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -837,7 +837,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
* under the mouse cursor * under the mouse cursor
* Commands are case insensitive * Commands are case insensitive
*/ */
void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ) void LIB_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct )
{ {
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
wxCommandEvent toolCmd( wxEVT_COMMAND_TOOL_CLICKED ); wxCommandEvent toolCmd( wxEVT_COMMAND_TOOL_CLICKED );
......
...@@ -31,7 +31,7 @@ extern int ExportPartId; ...@@ -31,7 +31,7 @@ extern int ExportPartId;
* Or 1 component if there are several. * Or 1 component if there are several.
* If the first component is an alias, it will load the corresponding root. * If the first component is an alias, it will load the corresponding root.
*/ */
void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
{ {
wxString errMsg; wxString errMsg;
wxFileName fn; wxFileName fn;
...@@ -90,7 +90,7 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event ) ...@@ -90,7 +90,7 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event )
* *
* The file format is created in all cases the same. * The file format is created in all cases the same.
*/ */
void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event )
{ {
wxFileName fn; wxFileName fn;
wxString msg, title; wxString msg, title;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* Update the main window title bar with the current library name. */ /* Update the main window title bar with the current library name. */
void WinEDA_LibeditFrame::DisplayLibInfos() void LIB_EDIT_FRAME::DisplayLibInfos()
{ {
wxString msg = _( "Component Library Editor: " ); wxString msg = _( "Component Library Editor: " );
...@@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::DisplayLibInfos() ...@@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::DisplayLibInfos()
/* Function to select the current library (working library) */ /* Function to select the current library (working library) */
void WinEDA_LibeditFrame::SelectActiveLibrary() void LIB_EDIT_FRAME::SelectActiveLibrary()
{ {
CMP_LIBRARY* Lib; CMP_LIBRARY* Lib;
...@@ -59,7 +59,7 @@ void WinEDA_LibeditFrame::SelectActiveLibrary() ...@@ -59,7 +59,7 @@ void WinEDA_LibeditFrame::SelectActiveLibrary()
* If there is no current selected library, * If there is no current selected library,
* prompt user for library name and make the selected library the current lib. * prompt user for library name and make the selected library the current lib.
*/ */
void WinEDA_LibeditFrame::LoadOneLibraryPart( wxCommandEvent& event ) void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event )
{ {
int i; int i;
wxString msg; wxString msg;
...@@ -127,7 +127,7 @@ void WinEDA_LibeditFrame::LoadOneLibraryPart( wxCommandEvent& event ) ...@@ -127,7 +127,7 @@ void WinEDA_LibeditFrame::LoadOneLibraryPart( wxCommandEvent& event )
* 1 if error * 1 if error
* m_component advanced copy and created * m_component advanced copy and created
*/ */
bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY* aLibrary ) bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY* aLibrary )
{ {
wxString msg, cmpName, rootName; wxString msg, cmpName, rootName;
LIB_COMPONENT* component; LIB_COMPONENT* component;
...@@ -194,7 +194,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY* ...@@ -194,7 +194,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY*
/* Function to redraw the current loaded library component */ /* Function to redraw the current loaded library component */
void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
if( GetScreen() == NULL ) if( GetScreen() == NULL )
return; return;
...@@ -233,7 +233,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -233,7 +233,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
* Save (on disk) the current library * Save (on disk) the current library
* if exists the old file is renamed (.bak) * if exists the old file is renamed (.bak)
*/ */
void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event ) void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
{ {
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
...@@ -306,7 +306,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -306,7 +306,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
* *
* Used when displaying the list of library components. * Used when displaying the list of library components.
*/ */
void WinEDA_LibeditFrame::DisplayCmpDoc() void LIB_EDIT_FRAME::DisplayCmpDoc()
{ {
wxString msg; wxString msg;
LIB_ALIAS* alias; LIB_ALIAS* alias;
...@@ -369,7 +369,7 @@ void WinEDA_LibeditFrame::DisplayCmpDoc() ...@@ -369,7 +369,7 @@ void WinEDA_LibeditFrame::DisplayCmpDoc()
* Otherwise the alias becomes the new component name, and the other * Otherwise the alias becomes the new component name, and the other
* aliases become dependent on newly named component. * aliases become dependent on newly named component.
*/ */
void WinEDA_LibeditFrame::DeleteOnePart( wxCommandEvent& event ) void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
{ {
wxString CmpName; wxString CmpName;
LIB_ALIAS* LibEntry; LIB_ALIAS* LibEntry;
...@@ -467,7 +467,7 @@ All changes will be lost. Discard changes?" ) ) ) ...@@ -467,7 +467,7 @@ All changes will be lost. Discard changes?" ) ) )
* *
* If an old component is currently in edit, it is deleted. * If an old component is currently in edit, it is deleted.
*/ */
void WinEDA_LibeditFrame::CreateNewLibraryPart( wxCommandEvent& event ) void LIB_EDIT_FRAME::CreateNewLibraryPart( wxCommandEvent& event )
{ {
wxString name; wxString name;
...@@ -570,7 +570,7 @@ lost!\n\nClear the current component from the screen?" ) ) ) ...@@ -570,7 +570,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
* The routine deletes the old component (and / or aliases) to replace * The routine deletes the old component (and / or aliases) to replace
* If any, and saves the new and creates the corresponding alias. * If any, and saves the new and creates the corresponding alias.
*/ */
void WinEDA_LibeditFrame::SaveOnePartInMemory() void LIB_EDIT_FRAME::SaveOnePartInMemory()
{ {
LIB_COMPONENT* oldComponent; LIB_COMPONENT* oldComponent;
LIB_COMPONENT* Component; LIB_COMPONENT* Component;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "class_libentry.h" #include "class_libentry.h"
void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
LIB_DRAW_ITEM* DrawEntry = m_drawItem; LIB_DRAW_ITEM* DrawEntry = m_drawItem;
...@@ -129,7 +129,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -129,7 +129,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_LibeditFrame::OnLeftClick error" ) ); DisplayError( this, wxT( "LIB_EDIT_FRAME::OnLeftClick error" ) );
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break; break;
} }
...@@ -142,7 +142,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -142,7 +142,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
* If an editable item (field, pin, graphic): * If an editable item (field, pin, graphic):
* Call the suitable dialog editor. * Call the suitable dialog editor.
*/ */
void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{ {
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
...@@ -222,7 +222,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -222,7 +222,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
default: default:
wxString msg; wxString msg;
msg.Printf( wxT( "WinEDA_LibeditFrame::OnLeftDClick Error: unknown StructType %d" ), msg.Printf( wxT( "LIB_EDIT_FRAME::OnLeftDClick Error: unknown StructType %d" ),
m_drawItem->Type() ); m_drawItem->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
break; break;
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
/* functions to add commands and submenus depending on the item */ /* functions to add commands and submenus depending on the item */
static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame ); static void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame );
static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, WinEDA_LibeditFrame* frame ); static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame );
bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
{ {
LIB_DRAW_ITEM* DrawEntry = LocateItemUsingCursor(); LIB_DRAW_ITEM* DrawEntry = LocateItemUsingCursor();
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE ); bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE );
...@@ -262,9 +262,8 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -262,9 +262,8 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
default: default:
wxString msg; wxString msg;
msg.Printf( wxT( "WinEDA_LibeditFrame::OnRightClick Error: unknown \ msg.Printf( wxT( "LIB_EDIT_FRAME::OnRightClick Error: unknown StructType %d" ),
StructType %d" ), DrawEntry->Type() );
DrawEntry->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
m_drawItem = NULL; m_drawItem = NULL;
break; break;
...@@ -275,9 +274,7 @@ StructType %d" ), ...@@ -275,9 +274,7 @@ StructType %d" ),
} }
void AddMenusForPin( wxMenu* PopMenu, void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
LIB_PIN* Pin,
WinEDA_LibeditFrame* frame )
{ {
bool selected = (Pin->m_Selected & IS_SELECTED) != 0; bool selected = (Pin->m_Selected & IS_SELECTED) != 0;
bool not_in_move = (Pin->m_Flags == 0); bool not_in_move = (Pin->m_Flags == 0);
...@@ -325,7 +322,7 @@ void AddMenusForPin( wxMenu* PopMenu, ...@@ -325,7 +322,7 @@ void AddMenusForPin( wxMenu* PopMenu,
/* Add menu commands for block */ /* Add menu commands for block */
void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame ) void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING,
_( "Cancel Block" ), cancel_xpm ); _( "Cancel Block" ), cancel_xpm );
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Function OnPlotCurrentComponent * Function OnPlotCurrentComponent
* plot in SVG or PNG format the curren component * plot in SVG or PNG format the curren component
*/ */
void WinEDA_LibeditFrame::OnPlotCurrentComponent( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
{ {
LIB_COMPONENT* cmp = GetComponent(); LIB_COMPONENT* cmp = GetComponent();
wxString FullFileName; wxString FullFileName;
...@@ -98,7 +98,7 @@ void WinEDA_LibeditFrame::OnPlotCurrentComponent( wxCommandEvent& event ) ...@@ -98,7 +98,7 @@ void WinEDA_LibeditFrame::OnPlotCurrentComponent( wxCommandEvent& event )
* @param aFileName = the full filename * @param aFileName = the full filename
* @param aFmt_jpeg = true to use JPEG file format, false to use PNG file format * @param aFmt_jpeg = true to use JPEG file format, false to use PNG file format
*/ */
void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg ) void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg )
{ {
wxSize image_size = DrawPanel->GetClientSize(); wxSize image_size = DrawPanel->GetClientSize();
...@@ -112,9 +112,7 @@ void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool a ...@@ -112,9 +112,7 @@ void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool a
wxImage image = bitmap.ConvertToImage(); wxImage image = bitmap.ConvertToImage();
if( !image.SaveFile( aFileName, if( !image.SaveFile( aFileName, aFmt_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
aFmt_jpeg ? wxBITMAP_TYPE_JPEG :
wxBITMAP_TYPE_PNG ) )
{ {
wxString msg; wxString msg;
msg.Printf( _( "Can't save file <%s>" ), GetChars( aFileName ) ); msg.Printf( _( "Can't save file <%s>" ), GetChars( aFileName ) );
...@@ -133,14 +131,13 @@ void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool a ...@@ -133,14 +131,13 @@ void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool a
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode) * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not used here) * @param aData = a pointer on an auxiliary data (not used here)
*/ */
void WinEDA_LibeditFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMask,
int aPrintMask, bool aPrintMirrorMode, bool aPrintMirrorMode, void* aData)
void * aData)
{ {
if( ! m_component ) if( ! m_component )
return; return;
wxSize pagesize = GetScreen()->ReturnPageSize( ); wxSize pagesize = GetScreen()->ReturnPageSize();
/* Plot item centered to the page /* Plot item centered to the page
* In libedit, the component is centered at 0,0 coordinates. * In libedit, the component is centered at 0,0 coordinates.
* So we must plot it with an offset = pagesize/2. * So we must plot it with an offset = pagesize/2.
...@@ -149,8 +146,7 @@ void WinEDA_LibeditFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, ...@@ -149,8 +146,7 @@ void WinEDA_LibeditFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
plot_offset.x = pagesize.x/2; plot_offset.x = pagesize.x/2;
plot_offset.y = pagesize.y/2; plot_offset.y = pagesize.y/2;
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
m_convert, GR_DEFAULT_DRAWMODE );
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "class_libentry.h" #include "class_libentry.h"
void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int unused_flag ) void LIB_EDIT_FRAME::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int unused_flag )
{ {
LIB_COMPONENT* CopyItem; LIB_COMPONENT* CopyItem;
PICKED_ITEMS_LIST* lastcmd; PICKED_ITEMS_LIST* lastcmd;
...@@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int un ...@@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int un
* - Place the current edited library component in undo list * - Place the current edited library component in undo list
* - Get old version of the current edited library component * - Get old version of the current edited library component
*/ */
void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event) void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
{ {
if ( GetScreen()->GetRedoCommandCount() <= 0 ) if ( GetScreen()->GetRedoCommandCount() <= 0 )
return; return;
...@@ -75,7 +75,7 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event) ...@@ -75,7 +75,7 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event)
* - Place the current edited library component in Redo list * - Place the current edited library component in Redo list
* - Get old version of the current edited library component * - Get old version of the current edited library component
*/ */
void WinEDA_LibeditFrame::GetComponentFromUndoList(wxCommandEvent& event) void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
{ {
if ( GetScreen()->GetUndoCommandCount() <= 0 ) if ( GetScreen()->GetUndoCommandCount() <= 0 )
return; return;
......
/** /**
* EESchema - libeditframe.cpp * EESchema - libeditframe.cpp
* class WinEDA_LibeditFrame: the component editor frame * class LIB_EDIT_FRAME: the component editor frame
* *
*/ */
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "dialogs/dialog_lib_edit_text.h" #include "dialogs/dialog_lib_edit_text.h"
#include "dialogs/dialog_SVG_print.h" #include "dialogs/dialog_SVG_print.h"
#include "dialogs/dialog_edit_component_in_lib.h" #include "dialogs/dialog_edit_component_in_lib.h"
#include "dialogs/dialog_libedit_dimensions.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
...@@ -52,115 +53,115 @@ int CreateNewLibAndSavePartId = ::wxNewId(); ...@@ -52,115 +53,115 @@ int CreateNewLibAndSavePartId = ::wxNewId();
* that was being edited will be displayed. These members are protected * that was being edited will be displayed. These members are protected
* making it necessary to use the class access methods. * making it necessary to use the class access methods.
*/ */
LIB_COMPONENT* WinEDA_LibeditFrame::m_component = NULL; LIB_COMPONENT* LIB_EDIT_FRAME::m_component = NULL;
CMP_LIBRARY* WinEDA_LibeditFrame:: m_library = NULL; CMP_LIBRARY* LIB_EDIT_FRAME:: m_library = NULL;
wxString WinEDA_LibeditFrame:: m_aliasName; wxString LIB_EDIT_FRAME:: m_aliasName;
int WinEDA_LibeditFrame:: m_unit = 1; int LIB_EDIT_FRAME:: m_unit = 1;
int WinEDA_LibeditFrame:: m_convert = 1; int LIB_EDIT_FRAME:: m_convert = 1;
LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_lastDrawItem = NULL; LIB_DRAW_ITEM* LIB_EDIT_FRAME::m_lastDrawItem = NULL;
LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_drawItem = NULL; LIB_DRAW_ITEM* LIB_EDIT_FRAME::m_drawItem = NULL;
bool WinEDA_LibeditFrame:: m_showDeMorgan = false; bool LIB_EDIT_FRAME:: m_showDeMorgan = false;
wxSize WinEDA_LibeditFrame:: m_clientSize = wxSize( -1, -1 ); wxSize LIB_EDIT_FRAME:: m_clientSize = wxSize( -1, -1 );
int WinEDA_LibeditFrame:: m_textSize = DEFAULT_SIZE_TEXT; int LIB_EDIT_FRAME:: m_textSize = DEFAULT_SIZE_TEXT;
int WinEDA_LibeditFrame:: m_textOrientation = TEXT_ORIENT_HORIZ; int LIB_EDIT_FRAME:: m_textOrientation = TEXT_ORIENT_HORIZ;
int WinEDA_LibeditFrame:: m_drawLineWidth = 0; int LIB_EDIT_FRAME:: m_drawLineWidth = 0;
FILL_T WinEDA_LibeditFrame:: m_drawFillStyle = NO_FILL; FILL_T LIB_EDIT_FRAME:: m_drawFillStyle = NO_FILL;
/*****************************/ /************************/
/* class WinEDA_LibeditFrame */ /* class LIB_EDIT_FRAME */
/*****************************/ /************************/
BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, WinEDA_DrawFrame )
EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow ) EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
EVT_SIZE( WinEDA_LibeditFrame::OnSize ) EVT_SIZE( LIB_EDIT_FRAME::OnSize )
EVT_ACTIVATE( WinEDA_LibeditFrame::OnActivate ) EVT_ACTIVATE( LIB_EDIT_FRAME::OnActivate )
/* Main horizontal toolbar. */ /* Main horizontal toolbar. */
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_LibeditFrame::OnZoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, LIB_EDIT_FRAME::OnZoom )
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, WinEDA_LibeditFrame::SaveActiveLibrary ) EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::SaveActiveLibrary )
EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, LIB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_LIBEDIT_DELETE_PART, WinEDA_LibeditFrame::DeleteOnePart ) EVT_TOOL( ID_LIBEDIT_DELETE_PART, LIB_EDIT_FRAME::DeleteOnePart )
EVT_TOOL( ID_LIBEDIT_NEW_PART, WinEDA_LibeditFrame::CreateNewLibraryPart ) EVT_TOOL( ID_LIBEDIT_NEW_PART, LIB_EDIT_FRAME::CreateNewLibraryPart )
EVT_TOOL( ID_LIBEDIT_SELECT_PART, WinEDA_LibeditFrame::LoadOneLibraryPart ) EVT_TOOL( ID_LIBEDIT_SELECT_PART, LIB_EDIT_FRAME::LoadOneLibraryPart )
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, LIB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, WinEDA_LibeditFrame::GetComponentFromUndoList ) EVT_TOOL( wxID_UNDO, LIB_EDIT_FRAME::GetComponentFromUndoList )
EVT_TOOL( wxID_REDO, WinEDA_LibeditFrame::GetComponentFromRedoList ) EVT_TOOL( wxID_REDO, LIB_EDIT_FRAME::GetComponentFromRedoList )
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, WinEDA_LibeditFrame::OnEditComponentProperties ) EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnEditComponentProperties )
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, WinEDA_LibeditFrame::InstallFieldsEditorDialog ) EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::InstallFieldsEditorDialog )
EVT_TOOL( ID_LIBEDIT_CHECK_PART, WinEDA_LibeditFrame::OnCheckComponent ) EVT_TOOL( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnCheckComponent )
EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, WinEDA_LibeditFrame::OnSelectBodyStyle ) EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
EVT_TOOL( ID_DE_MORGAN_CONVERT_BUTT, WinEDA_LibeditFrame::OnSelectBodyStyle ) EVT_TOOL( ID_DE_MORGAN_CONVERT_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
EVT_TOOL( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnViewEntryDoc ) EVT_TOOL( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnViewEntryDoc )
EVT_TOOL( ID_LIBEDIT_EDIT_PIN_BY_PIN, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ExportPartId, WinEDA_LibeditFrame::OnExportPart ) EVT_TOOL( ExportPartId, LIB_EDIT_FRAME::OnExportPart )
EVT_TOOL( CreateNewLibAndSavePartId, WinEDA_LibeditFrame::OnExportPart ) EVT_TOOL( CreateNewLibAndSavePartId, LIB_EDIT_FRAME::OnExportPart )
EVT_TOOL( ImportPartId, WinEDA_LibeditFrame::OnImportPart ) EVT_TOOL( ImportPartId, LIB_EDIT_FRAME::OnImportPart )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER, WinEDA_LibeditFrame::OnSelectPart ) EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnSelectPart )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS, WinEDA_LibeditFrame::OnSelectAlias ) EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnSelectAlias )
/* Right vertical toolbar. */ /* Right vertical toolbar. */
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_NO_SELECT_BUTT, LIB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT, EVT_TOOL_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT,
WinEDA_LibeditFrame::Process_Special_Functions ) LIB_EDIT_FRAME::Process_Special_Functions )
/* menubar commands */ /* menubar commands */
EVT_MENU( wxID_EXIT, WinEDA_LibeditFrame::CloseWindow ) EVT_MENU( wxID_EXIT, LIB_EDIT_FRAME::CloseWindow )
EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, WinEDA_LibeditFrame::SaveActiveLibrary ) EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, LIB_EDIT_FRAME::SaveActiveLibrary )
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, WinEDA_LibeditFrame::OnPlotCurrentComponent ) EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, WinEDA_LibeditFrame::OnPlotCurrentComponent ) EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_CONFIG_REQ, WinEDA_LibeditFrame::InstallConfigFrame ) EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
EVT_MENU( ID_CONFIG_SAVE, WinEDA_LibeditFrame::Process_Config ) EVT_MENU( ID_CONFIG_SAVE, LIB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_CONFIG_READ, WinEDA_LibeditFrame::Process_Config ) EVT_MENU( ID_CONFIG_READ, LIB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_COLORS_SETUP, WinEDA_LibeditFrame::Process_Config ) EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_LIBEDIT_DIMENSIONS, WinEDA_LibeditFrame::InstallDimensionsDialog ) EVT_MENU( ID_LIBEDIT_DIMENSIONS, LIB_EDIT_FRAME::InstallDimensionsDialog )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START,
ID_PREFERENCES_HOTKEY_END, ID_PREFERENCES_HOTKEY_END,
WinEDA_LibeditFrame::Process_Config ) LIB_EDIT_FRAME::Process_Config )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, WinEDA_LibeditFrame::SetLanguage ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, LIB_EDIT_FRAME::SetLanguage )
/* Context menu events and commands. */ /* Context menu events and commands. */
EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin ) EVT_MENU( ID_LIBEDIT_EDIT_PIN, LIB_EDIT_FRAME::OnEditPin )
EVT_MENU( ID_LIBEDIT_ROTATE_PIN, WinEDA_LibeditFrame::OnRotatePin ) EVT_MENU( ID_LIBEDIT_ROTATE_PIN, LIB_EDIT_FRAME::OnRotatePin )
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
WinEDA_LibeditFrame::Process_Special_Functions ) LIB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_LibeditFrame::Process_Special_Functions ) LIB_EDIT_FRAME::Process_Special_Functions )
/* Update user interface elements. */ /* Update user interface elements. */
EVT_UPDATE_UI( ExportPartId, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( ExportPartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( CreateNewLibAndSavePartId, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( CreateNewLibAndSavePartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_PART, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_PART, WinEDA_LibeditFrame::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
EVT_UPDATE_UI( wxID_UNDO, WinEDA_LibeditFrame::OnUpdateUndo ) EVT_UPDATE_UI( wxID_UNDO, LIB_EDIT_FRAME::OnUpdateUndo )
EVT_UPDATE_UI( wxID_REDO, WinEDA_LibeditFrame::OnUpdateRedo ) EVT_UPDATE_UI( wxID_REDO, LIB_EDIT_FRAME::OnUpdateRedo )
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, WinEDA_LibeditFrame::OnUpdateSaveCurrentLib ) EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::OnUpdateSaveCurrentLib )
EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnUpdateViewDoc ) EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnUpdateViewDoc )
EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_PIN, WinEDA_LibeditFrame::OnUpdatePinByPin ) EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::OnUpdatePinByPin )
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_PART_NUMBER, WinEDA_LibeditFrame::OnUpdatePartNumber ) EVT_UPDATE_UI( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnUpdatePartNumber )
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_ALIAS, WinEDA_LibeditFrame::OnUpdateSelectAlias ) EVT_UPDATE_UI( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnUpdateSelectAlias )
EVT_UPDATE_UI( ID_DE_MORGAN_NORMAL_BUTT, WinEDA_LibeditFrame::OnUpdateDeMorganNormal ) EVT_UPDATE_UI( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnUpdateDeMorganNormal )
EVT_UPDATE_UI( ID_DE_MORGAN_CONVERT_BUTT, WinEDA_LibeditFrame::OnUpdateDeMorganConvert ) EVT_UPDATE_UI( ID_DE_MORGAN_CONVERT_BUTT, LIB_EDIT_FRAME::OnUpdateDeMorganConvert )
EVT_UPDATE_UI_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT, EVT_UPDATE_UI_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT,
WinEDA_LibeditFrame::OnUpdateEditingPart ) LIB_EDIT_FRAME::OnUpdateEditingPart )
END_EVENT_TABLE() END_EVENT_TABLE()
WinEDA_LibeditFrame::WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent, LIB_EDIT_FRAME::LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style ) : long style ) :
WinEDA_DrawFrame( aParent, LIBEDITOR_FRAME, title, pos, size, style ) WinEDA_DrawFrame( aParent, LIBEDITOR_FRAME, title, pos, size, style )
{ {
wxASSERT( aParent ); wxASSERT( aParent );
...@@ -238,7 +239,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent, ...@@ -238,7 +239,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent,
} }
WinEDA_LibeditFrame::~WinEDA_LibeditFrame() LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
{ {
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
...@@ -256,7 +257,7 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame() ...@@ -256,7 +257,7 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
* Don't forget to call this base method from any derived classes or the * Don't forget to call this base method from any derived classes or the
* settings will not get loaded. * settings will not get loaded.
*/ */
void WinEDA_LibeditFrame::LoadSettings() void LIB_EDIT_FRAME::LoadSettings()
{ {
wxConfig* cfg; wxConfig* cfg;
...@@ -270,7 +271,7 @@ void WinEDA_LibeditFrame::LoadSettings() ...@@ -270,7 +271,7 @@ void WinEDA_LibeditFrame::LoadSettings()
} }
void WinEDA_LibeditFrame::SetDrawItem( LIB_DRAW_ITEM* drawItem ) void LIB_EDIT_FRAME::SetDrawItem( LIB_DRAW_ITEM* drawItem )
{ {
m_drawItem = drawItem; m_drawItem = drawItem;
} }
...@@ -282,7 +283,7 @@ void WinEDA_LibeditFrame::SetDrawItem( LIB_DRAW_ITEM* drawItem ) ...@@ -282,7 +283,7 @@ void WinEDA_LibeditFrame::SetDrawItem( LIB_DRAW_ITEM* drawItem )
* Don't forget to call this base method from any derived classes or the * Don't forget to call this base method from any derived classes or the
* settings will not get saved. * settings will not get saved.
*/ */
void WinEDA_LibeditFrame::SaveSettings() void LIB_EDIT_FRAME::SaveSettings()
{ {
wxConfig* cfg; wxConfig* cfg;
...@@ -296,7 +297,7 @@ void WinEDA_LibeditFrame::SaveSettings() ...@@ -296,7 +297,7 @@ void WinEDA_LibeditFrame::SaveSettings()
} }
void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event ) void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{ {
if( GetScreen()->IsModify() ) if( GetScreen()->IsModify() )
{ {
...@@ -329,7 +330,7 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -329,7 +330,7 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
} }
int WinEDA_LibeditFrame::BestZoom() int LIB_EDIT_FRAME::BestZoom()
{ {
int dx, dy, ii, jj; int dx, dy, ii, jj;
wxSize size; wxSize size;
...@@ -379,7 +380,7 @@ int WinEDA_LibeditFrame::BestZoom() ...@@ -379,7 +380,7 @@ int WinEDA_LibeditFrame::BestZoom()
} }
void WinEDA_LibeditFrame::UpdateAliasSelectList() void LIB_EDIT_FRAME::UpdateAliasSelectList()
{ {
if( m_SelAliasBox == NULL ) if( m_SelAliasBox == NULL )
return; return;
...@@ -399,7 +400,7 @@ void WinEDA_LibeditFrame::UpdateAliasSelectList() ...@@ -399,7 +400,7 @@ void WinEDA_LibeditFrame::UpdateAliasSelectList()
} }
void WinEDA_LibeditFrame::UpdatePartSelectList() void LIB_EDIT_FRAME::UpdatePartSelectList()
{ {
if( m_SelpartBox == NULL ) if( m_SelpartBox == NULL )
return; return;
...@@ -425,39 +426,39 @@ void WinEDA_LibeditFrame::UpdatePartSelectList() ...@@ -425,39 +426,39 @@ void WinEDA_LibeditFrame::UpdatePartSelectList()
} }
void WinEDA_LibeditFrame::OnUpdateEditingPart( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& event )
{ {
event.Enable( m_component != NULL ); event.Enable( m_component != NULL );
} }
void WinEDA_LibeditFrame::OnUpdateNotEditingPart( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateNotEditingPart( wxUpdateUIEvent& event )
{ {
event.Enable( m_component == NULL ); event.Enable( m_component == NULL );
} }
void WinEDA_LibeditFrame::OnUpdateUndo( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateUndo( wxUpdateUIEvent& event )
{ {
event.Enable( m_component != NULL && GetScreen() != NULL event.Enable( m_component != NULL && GetScreen() != NULL
&& GetScreen()->GetUndoCommandCount() != 0 && !IsEditingDrawItem() ); && GetScreen()->GetUndoCommandCount() != 0 && !IsEditingDrawItem() );
} }
void WinEDA_LibeditFrame::OnUpdateRedo( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateRedo( wxUpdateUIEvent& event )
{ {
event.Enable( m_component != NULL && GetScreen() != NULL event.Enable( m_component != NULL && GetScreen() != NULL
&& GetScreen()->GetRedoCommandCount() != 0 && !IsEditingDrawItem() ); && GetScreen()->GetRedoCommandCount() != 0 && !IsEditingDrawItem() );
} }
void WinEDA_LibeditFrame::OnUpdateSaveCurrentLib( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateSaveCurrentLib( wxUpdateUIEvent& event )
{ {
event.Enable( m_library != NULL && ( m_library->IsModified() || GetScreen()->IsModify() ) ); event.Enable( m_library != NULL && ( m_library->IsModified() || GetScreen()->IsModify() ) );
} }
void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateViewDoc( wxUpdateUIEvent& event )
{ {
bool enable = false; bool enable = false;
...@@ -474,7 +475,7 @@ void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event ) ...@@ -474,7 +475,7 @@ void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnUpdatePinByPin( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
{ {
event.Enable( ( m_component != NULL ) event.Enable( ( m_component != NULL )
&& ( ( m_component->GetPartCount() > 1 ) || m_showDeMorgan ) ); && ( ( m_component->GetPartCount() > 1 ) || m_showDeMorgan ) );
...@@ -484,7 +485,7 @@ void WinEDA_LibeditFrame::OnUpdatePinByPin( wxUpdateUIEvent& event ) ...@@ -484,7 +485,7 @@ void WinEDA_LibeditFrame::OnUpdatePinByPin( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnUpdatePartNumber( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
{ {
if( m_SelpartBox == NULL ) if( m_SelpartBox == NULL )
return; return;
...@@ -496,7 +497,7 @@ void WinEDA_LibeditFrame::OnUpdatePartNumber( wxUpdateUIEvent& event ) ...@@ -496,7 +497,7 @@ void WinEDA_LibeditFrame::OnUpdatePartNumber( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnUpdateDeMorganNormal( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
{ {
if( m_HToolBar == NULL ) if( m_HToolBar == NULL )
return; return;
...@@ -506,7 +507,7 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganNormal( wxUpdateUIEvent& event ) ...@@ -506,7 +507,7 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
{ {
if( m_HToolBar == NULL ) if( m_HToolBar == NULL )
return; return;
...@@ -516,7 +517,7 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) ...@@ -516,7 +517,7 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnUpdateSelectAlias( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateSelectAlias( wxUpdateUIEvent& event )
{ {
if( m_SelAliasBox == NULL ) if( m_SelAliasBox == NULL )
return; return;
...@@ -528,7 +529,7 @@ void WinEDA_LibeditFrame::OnUpdateSelectAlias( wxUpdateUIEvent& event ) ...@@ -528,7 +529,7 @@ void WinEDA_LibeditFrame::OnUpdateSelectAlias( wxUpdateUIEvent& event )
} }
void WinEDA_LibeditFrame::OnSelectAlias( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
{ {
if( m_SelAliasBox == NULL if( m_SelAliasBox == NULL
|| m_SelAliasBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0 ) || m_SelAliasBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0 )
...@@ -542,7 +543,7 @@ void WinEDA_LibeditFrame::OnSelectAlias( wxCommandEvent& event ) ...@@ -542,7 +543,7 @@ void WinEDA_LibeditFrame::OnSelectAlias( wxCommandEvent& event )
} }
void WinEDA_LibeditFrame::OnSelectPart( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnSelectPart( wxCommandEvent& event )
{ {
int i = event.GetSelection(); int i = event.GetSelection();
...@@ -556,7 +557,7 @@ void WinEDA_LibeditFrame::OnSelectPart( wxCommandEvent& event ) ...@@ -556,7 +557,7 @@ void WinEDA_LibeditFrame::OnSelectPart( wxCommandEvent& event )
} }
void WinEDA_LibeditFrame::OnViewEntryDoc( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
{ {
if( m_component == NULL ) if( m_component == NULL )
return; return;
...@@ -573,7 +574,7 @@ void WinEDA_LibeditFrame::OnViewEntryDoc( wxCommandEvent& event ) ...@@ -573,7 +574,7 @@ void WinEDA_LibeditFrame::OnViewEntryDoc( wxCommandEvent& event )
} }
void WinEDA_LibeditFrame::OnSelectBodyStyle( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
{ {
DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW ); DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW );
...@@ -587,7 +588,7 @@ void WinEDA_LibeditFrame::OnSelectBodyStyle( wxCommandEvent& event ) ...@@ -587,7 +588,7 @@ void WinEDA_LibeditFrame::OnSelectBodyStyle( wxCommandEvent& event )
} }
void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
...@@ -914,7 +915,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -914,7 +915,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_LibeditFrame::Process_Special_Functions error" ) ); DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Special_Functions error" ) );
break; break;
} }
...@@ -925,7 +926,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -925,7 +926,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
} }
void WinEDA_LibeditFrame::OnActivate( wxActivateEvent& event ) void LIB_EDIT_FRAME::OnActivate( wxActivateEvent& event )
{ {
WinEDA_DrawFrame::OnActivate( event ); WinEDA_DrawFrame::OnActivate( event );
...@@ -935,7 +936,7 @@ void WinEDA_LibeditFrame::OnActivate( wxActivateEvent& event ) ...@@ -935,7 +936,7 @@ void WinEDA_LibeditFrame::OnActivate( wxActivateEvent& event )
} }
void WinEDA_LibeditFrame::EnsureActiveLibExists() void LIB_EDIT_FRAME::EnsureActiveLibExists()
{ {
if( m_library == NULL ) if( m_library == NULL )
return; return;
...@@ -948,7 +949,7 @@ void WinEDA_LibeditFrame::EnsureActiveLibExists() ...@@ -948,7 +949,7 @@ void WinEDA_LibeditFrame::EnsureActiveLibExists()
} }
void WinEDA_LibeditFrame::SetLanguage( wxCommandEvent& event ) void LIB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
{ {
WinEDA_BasicFrame::SetLanguage( event ); WinEDA_BasicFrame::SetLanguage( event );
WinEDA_SchematicFrame *parent = (WinEDA_SchematicFrame *)GetParent(); WinEDA_SchematicFrame *parent = (WinEDA_SchematicFrame *)GetParent();
...@@ -961,7 +962,7 @@ void WinEDA_LibeditFrame::SetLanguage( wxCommandEvent& event ) ...@@ -961,7 +962,7 @@ void WinEDA_LibeditFrame::SetLanguage( wxCommandEvent& event )
* create a temporary copy of the current edited component * create a temporary copy of the current edited component
* Used to prepare an Undo ant/or abort command before editing the component * Used to prepare an Undo ant/or abort command before editing the component
*/ */
void WinEDA_LibeditFrame::TempCopyComponent() void LIB_EDIT_FRAME::TempCopyComponent()
{ {
if( m_tempCopyComponent ) if( m_tempCopyComponent )
delete m_tempCopyComponent; delete m_tempCopyComponent;
...@@ -975,7 +976,7 @@ void WinEDA_LibeditFrame::TempCopyComponent() ...@@ -975,7 +976,7 @@ void WinEDA_LibeditFrame::TempCopyComponent()
* Restore the current edited component from its temporary copy. * Restore the current edited component from its temporary copy.
* Used to abort a command * Used to abort a command
*/ */
void WinEDA_LibeditFrame::RestoreComponent() void LIB_EDIT_FRAME::RestoreComponent()
{ {
if( m_tempCopyComponent == NULL ) if( m_tempCopyComponent == NULL )
return; return;
...@@ -989,7 +990,7 @@ void WinEDA_LibeditFrame::RestoreComponent() ...@@ -989,7 +990,7 @@ void WinEDA_LibeditFrame::RestoreComponent()
* Function ClearTempCopyComponent * Function ClearTempCopyComponent
* delete temporary copy of the current component and clear pointer * delete temporary copy of the current component and clear pointer
*/ */
void WinEDA_LibeditFrame::ClearTempCopyComponent() void LIB_EDIT_FRAME::ClearTempCopyComponent()
{ {
delete m_tempCopyComponent; delete m_tempCopyComponent;
m_tempCopyComponent = NULL; m_tempCopyComponent = NULL;
...@@ -998,13 +999,13 @@ void WinEDA_LibeditFrame::ClearTempCopyComponent() ...@@ -998,13 +999,13 @@ void WinEDA_LibeditFrame::ClearTempCopyComponent()
/* Creates the SVG print file for the current edited component. /* Creates the SVG print file for the current edited component.
*/ */
void WinEDA_LibeditFrame::SVG_Print_Component( const wxString& FullFileName ) void LIB_EDIT_FRAME::SVG_Print_Component( const wxString& FullFileName )
{ {
DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() ); DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() );
} }
void WinEDA_LibeditFrame::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
{ {
if ( ( DrawItem == NULL ) || ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) ) if ( ( DrawItem == NULL ) || ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) )
return; return;
...@@ -1026,7 +1027,7 @@ void WinEDA_LibeditFrame::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) ...@@ -1026,7 +1027,7 @@ void WinEDA_LibeditFrame::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
} }
void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
{ {
bool partLocked = GetComponent()->UnitsLocked(); bool partLocked = GetComponent()->UnitsLocked();
...@@ -1048,3 +1049,10 @@ void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event ) ...@@ -1048,3 +1049,10 @@ void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event )
OnModify(); OnModify();
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
void LIB_EDIT_FRAME::InstallDimensionsDialog( wxCommandEvent& event )
{
DIALOG_LIBEDIT_DIMENSIONS dlg( this );
dlg.ShowModal();
}
/*****************************/
/* class WinEDA_LibeditFrame */ /************************/
/*****************************/ /* class LIB_EDIT_FRAME */
/************************/
#ifndef __LIBEDITFRM_H__ #ifndef __LIBEDITFRM_H__
#define __LIBEDITFRM_H__ #define __LIBEDITFRM_H__
...@@ -22,7 +23,7 @@ class DIALOG_LIB_EDIT_TEXT; ...@@ -22,7 +23,7 @@ class DIALOG_LIB_EDIT_TEXT;
/** /**
* The component library editor main window. * The component library editor main window.
*/ */
class WinEDA_LibeditFrame : public WinEDA_DrawFrame class LIB_EDIT_FRAME : public WinEDA_DrawFrame
{ {
LIB_COMPONENT* m_tempCopyComponent; ///< Temporary copy of current component during edit. LIB_COMPONENT* m_tempCopyComponent; ///< Temporary copy of current component during edit.
wxString m_oldRootName; ///< The actual pointer of the component loaded from wxString m_oldRootName; ///< The actual pointer of the component loaded from
...@@ -34,12 +35,11 @@ public: ...@@ -34,12 +35,11 @@ public:
WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any) WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any)
public: public:
WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent, LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent, const wxString& title,
const wxString& title, const wxPoint& pos, const wxSize& size,
const wxPoint& pos, const wxSize& size, long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_LibeditFrame(); ~LIB_EDIT_FRAME();
void ReCreateMenuBar(); void ReCreateMenuBar();
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
* triggers the wxCloseEvent, which is handled by the function given * triggers the wxCloseEvent, which is handled by the function given
* to EVT_CLOSE() macro: * to EVT_CLOSE() macro:
* <p> * <p>
* EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow ) * EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
*/ */
void CloseWindow( wxCommandEvent& WXUNUSED(event) ) void CloseWindow( wxCommandEvent& WXUNUSED(event) )
{ {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "template_fieldnames.h" #include "template_fieldnames.h"
void WinEDA_LibeditFrame::EditField( wxDC* DC, LIB_FIELD* Field ) void LIB_EDIT_FRAME::EditField( wxDC* DC, LIB_FIELD* Field )
{ {
wxString Text; wxString Text;
wxString title; wxString title;
...@@ -95,7 +95,7 @@ not conflict with any library entries." ), ...@@ -95,7 +95,7 @@ not conflict with any library entries." ),
} }
LIB_DRAW_ITEM* WinEDA_LibeditFrame::LocateItemUsingCursor() LIB_DRAW_ITEM* LIB_EDIT_FRAME::LocateItemUsingCursor()
{ {
if( m_component == NULL ) if( m_component == NULL )
return NULL; return NULL;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/** /**
* @brief Create or update the menubar for the Component Editor frame * @brief Create or update the menubar for the Component Editor frame
*/ */
void WinEDA_LibeditFrame::ReCreateMenuBar() void LIB_EDIT_FRAME::ReCreateMenuBar()
{ {
wxString text; wxString text;
wxMenuItem *item; wxMenuItem *item;
...@@ -72,8 +72,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar() ...@@ -72,8 +72,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
*/ */
#if !defined(__WXMAC__) #if !defined(__WXMAC__)
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit Library Editor" ) );
_( "Quit Library Editor" ) );
item->SetBitmap( exit_xpm ); item->SetBitmap( exit_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
#endif #endif
...@@ -86,8 +85,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar() ...@@ -86,8 +85,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
/* Undo */ /* Undo */
text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO); text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO);
item = new wxMenuItem( editMenu, wxID_UNDO, text, item = new wxMenuItem( editMenu, wxID_UNDO, text, _( "Undo last edition" ), wxITEM_NORMAL );
_( "Undo last edition" ), wxITEM_NORMAL );
item->SetBitmap( undo_xpm ); item->SetBitmap( undo_xpm );
editMenu->Append( item ); editMenu->Append( item );
...@@ -126,35 +124,29 @@ void WinEDA_LibeditFrame::ReCreateMenuBar() ...@@ -126,35 +124,29 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
*/ */
/* Zoom in */ /* Zoom in */
text =_( "Zoom In" ); text =_( "Zoom In" );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
wxITEM_NORMAL );
item->SetBitmap( zoom_in_xpm ); item->SetBitmap( zoom_in_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* Zoom out */ /* Zoom out */
text = _( "Zoom Out" ); text = _( "Zoom Out" );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
wxITEM_NORMAL );
item->SetBitmap( zoom_out_xpm ); item->SetBitmap( zoom_out_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* Fit on screen */ /* Fit on screen */
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
HELP_ZOOM_FIT, wxITEM_NORMAL );
item->SetBitmap( zoom_auto_xpm ); item->SetBitmap( zoom_auto_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
/* Redraw view */ /* Redraw view */
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, wxITEM_NORMAL );
HELP_ZOOM_REDRAW, wxITEM_NORMAL );
item->SetBitmap( zoom_redraw_xpm ); item->SetBitmap( zoom_redraw_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
......
...@@ -38,7 +38,9 @@ static bool LastPinCommonConvert = false; ...@@ -38,7 +38,9 @@ static bool LastPinCommonConvert = false;
static bool LastPinCommonUnit = false; static bool LastPinCommonUnit = false;
static bool LastPinVisible = true; static bool LastPinVisible = true;
void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){
void LIB_EDIT_FRAME::OnRotatePin( wxCommandEvent& event )
{
// Check, if the item is a pin, else return // Check, if the item is a pin, else return
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE ) if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
...@@ -72,7 +74,7 @@ void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){ ...@@ -72,7 +74,7 @@ void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){
pin->m_Flags = item_flags; pin->m_Flags = item_flags;
} }
void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
{ {
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE ) if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
return; return;
...@@ -176,7 +178,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) ...@@ -176,7 +178,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
*/ */
static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ) static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) Panel->GetParent(); LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) Panel->GetParent();
if( parent == NULL ) if( parent == NULL )
return; return;
...@@ -203,7 +205,7 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -203,7 +205,7 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC )
/** /**
* Managed cursor callback for placing component pins. * Managed cursor callback for placing component pins.
*/ */
void WinEDA_LibeditFrame::PlacePin( wxDC* DC ) void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
{ {
LIB_PIN* Pin; LIB_PIN* Pin;
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem; LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
...@@ -214,7 +216,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC ) ...@@ -214,7 +216,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC )
// Some tests // Some tests
if( (CurrentPin == NULL) || (CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE) ) if( (CurrentPin == NULL) || (CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE) )
{ {
wxMessageBox( wxT("WinEDA_LibeditFrame::PlacePin() error") ); wxMessageBox( wxT("LIB_EDIT_FRAME::PlacePin() error") );
return; return;
} }
...@@ -291,7 +293,7 @@ another pin. Continue?" ) ); ...@@ -291,7 +293,7 @@ another pin. Continue?" ) );
* Locate the pin pointed to by the cursor, and set the cursor management * Locate the pin pointed to by the cursor, and set the cursor management
* function move the pin. * function move the pin.
*/ */
void WinEDA_LibeditFrame::StartMovePin( wxDC* DC ) void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
{ {
LIB_PIN* Pin; LIB_PIN* Pin;
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem; LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
...@@ -333,7 +335,7 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC ) ...@@ -333,7 +335,7 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
* cursor management code. */ * cursor management code. */
static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) panel->GetParent(); LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) panel->GetParent();
if( parent == NULL ) if( parent == NULL )
return; return;
...@@ -374,9 +376,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -374,9 +376,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
* All pins at the same position will be erased. * All pins at the same position will be erased.
* Otherwise only the pin of the current unit and convert will be erased. * Otherwise only the pin of the current unit and convert will be erased.
*/ */
void WinEDA_LibeditFrame::DeletePin( wxDC* DC, void LIB_EDIT_FRAME::DeletePin( wxDC* DC, LIB_COMPONENT* LibEntry, LIB_PIN* Pin )
LIB_COMPONENT* LibEntry,
LIB_PIN* Pin )
{ {
LIB_PIN* tmp; LIB_PIN* tmp;
wxPoint PinPos; wxPoint PinPos;
...@@ -410,7 +410,7 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC, ...@@ -410,7 +410,7 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
/* /*
* Create a new pin. * Create a new pin.
*/ */
void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
{ {
LIB_PIN* pin; LIB_PIN* pin;
bool showPinText = true; bool showPinText = true;
...@@ -535,7 +535,7 @@ static void CreateImagePins( LIB_PIN* Pin, int unit, int convert, bool asDeMorga ...@@ -535,7 +535,7 @@ static void CreateImagePins( LIB_PIN* Pin, int unit, int convert, bool asDeMorga
* If Pin is selected ( .m_flag == IS_SELECTED ) only the other selected * If Pin is selected ( .m_flag == IS_SELECTED ) only the other selected
* pins are modified * pins are modified
*/ */
void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
{ {
LIB_PIN* Pin; LIB_PIN* Pin;
...@@ -583,7 +583,7 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) ...@@ -583,7 +583,7 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
/* Create a new pin based on the previous pin with an incremented pin number. */ /* Create a new pin based on the previous pin with an incremented pin number. */
void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin ) void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
{ {
LIB_PIN* Pin; LIB_PIN* Pin;
wxString msg; wxString msg;
...@@ -647,7 +647,7 @@ bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst ) ...@@ -647,7 +647,7 @@ bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
* Pins are considered off grid when they are not on the 25 mils grid * Pins are considered off grid when they are not on the 25 mils grid
* A grid smaller than 25 mils must be used only to build graphic shapes. * A grid smaller than 25 mils must be used only to build graphic shapes.
*/ */
void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
{ {
#define MIN_GRID_SIZE 25 #define MIN_GRID_SIZE 25
int dup_error; int dup_error;
......
...@@ -13,7 +13,7 @@ class EDA_BaseStruct; ...@@ -13,7 +13,7 @@ class EDA_BaseStruct;
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
class WinEDA_DrawFrame; class WinEDA_DrawFrame;
class WinEDA_SchematicFrame; class WinEDA_SchematicFrame;
class WinEDA_LibeditFrame; class LIB_EDIT_FRAME;
class CMP_LIBRARY; class CMP_LIBRARY;
class LIB_COMPONENT; class LIB_COMPONENT;
class LIB_DRAW_ITEM; class LIB_DRAW_ITEM;
...@@ -229,7 +229,7 @@ void DeleteAllMarkers( int type ); ...@@ -229,7 +229,7 @@ void DeleteAllMarkers( int type );
/**************/ /**************/
/* PINEDIT.CPP */ /* PINEDIT.CPP */
/**************/ /**************/
void InstallPineditFrame( WinEDA_LibeditFrame* parent, wxDC* DC, const wxPoint& pos ); void InstallPineditFrame( LIB_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos );
/**************/ /**************/
......
...@@ -738,10 +738,10 @@ void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event ) ...@@ -738,10 +738,10 @@ void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event )
} }
else else
{ {
m_LibeditFrame = new WinEDA_LibeditFrame( this, m_LibeditFrame = new LIB_EDIT_FRAME( this,
wxT( "Library Editor" ), wxT( "Library Editor" ),
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( 600, 400 ) ); wxSize( 600, 400 ) );
ActiveScreen = GetBaseScreen(); ActiveScreen = GetBaseScreen();
m_LibeditFrame->AdjustScrollBars(); m_LibeditFrame->AdjustScrollBars();
} }
......
...@@ -30,7 +30,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -30,7 +30,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
/* /*
* Show the dialog box for editing a graphical item properties * Show the dialog box for editing a graphical item properties
*/ */
void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
{ {
if( DrawItem == NULL ) if( DrawItem == NULL )
return; return;
...@@ -99,8 +99,8 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) ...@@ -99,8 +99,8 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) Panel->GetParent(); LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) Panel->GetParent();
LIB_DRAW_ITEM* item = parent->GetDrawItem(); LIB_DRAW_ITEM* item = parent->GetDrawItem();
if( item == NULL ) if( item == NULL )
return; return;
...@@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) LIB_DRAW_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
{ {
DrawPanel->ManageCurseur = SymbolDisplayDraw; DrawPanel->ManageCurseur = SymbolDisplayDraw;
DrawPanel->ForceCloseManageCurseur = AbortSymbolTraceOn; DrawPanel->ForceCloseManageCurseur = AbortSymbolTraceOn;
...@@ -176,7 +176,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, ...@@ -176,7 +176,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry,
break; break;
} }
default: default:
DisplayError( this, wxT( "WinEDA_LibeditFrame::CreateGraphicItem() error" ) ); DisplayError( this, wxT( "LIB_EDIT_FRAME::CreateGraphicItem() error" ) );
return NULL; return NULL;
} }
...@@ -210,7 +210,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry, ...@@ -210,7 +210,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry,
/* Create new library component graphic object. /* Create new library component graphic object.
*/ */
void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC ) void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
{ {
if( m_drawItem == NULL ) if( m_drawItem == NULL )
return; return;
...@@ -234,7 +234,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -234,7 +234,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
{ {
LIB_DRAW_ITEM* item; LIB_DRAW_ITEM* item;
item = ( (WinEDA_LibeditFrame*) panel->GetParent() )->GetDrawItem(); item = ( (LIB_EDIT_FRAME*) panel->GetParent() )->GetDrawItem();
if( item == NULL ) if( item == NULL )
return; return;
...@@ -247,7 +247,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -247,7 +247,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
} }
void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC ) void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
{ {
if( m_drawItem == NULL ) if( m_drawItem == NULL )
return; return;
...@@ -266,7 +266,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC ) ...@@ -266,7 +266,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
// @brief Modify a graphic symbol (drag edges etc.) // @brief Modify a graphic symbol (drag edges etc.)
void WinEDA_LibeditFrame::StartModifyDrawSymbol( wxDC* DC ) void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC )
{ {
if( m_drawItem == NULL ) if( m_drawItem == NULL )
return; return;
...@@ -283,7 +283,7 @@ void WinEDA_LibeditFrame::StartModifyDrawSymbol( wxDC* DC ) ...@@ -283,7 +283,7 @@ void WinEDA_LibeditFrame::StartModifyDrawSymbol( wxDC* DC )
static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
BASE_SCREEN* Screen = panel->GetScreen(); BASE_SCREEN* Screen = panel->GetScreen();
LIB_DRAW_ITEM* item = ( (WinEDA_LibeditFrame*) panel->GetParent() )->GetDrawItem(); LIB_DRAW_ITEM* item = ( (LIB_EDIT_FRAME*) panel->GetParent() )->GetDrawItem();
if( item == NULL ) if( item == NULL )
return; return;
...@@ -298,7 +298,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -298,7 +298,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
* Place the new graphic object in the list of component drawing objects, * Place the new graphic object in the list of component drawing objects,
* or terminate a draw item edition * or terminate a draw item edition
*/ */
void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
{ {
if( m_component == NULL || m_drawItem == NULL ) if( m_component == NULL || m_drawItem == NULL )
return; return;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* A symbol file *.sym has the same format as a library, and contains only * A symbol file *.sym has the same format as a library, and contains only
* one symbol * one symbol
*/ */
void WinEDA_LibeditFrame::LoadOneSymbol( void ) void LIB_EDIT_FRAME::LoadOneSymbol( void )
{ {
LIB_COMPONENT* Component; LIB_COMPONENT* Component;
wxString msg, err; wxString msg, err;
...@@ -122,7 +122,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -122,7 +122,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
* *
* Invisible pins are not saved * Invisible pins are not saved
*/ */
void WinEDA_LibeditFrame::SaveOneSymbol() void LIB_EDIT_FRAME::SaveOneSymbol()
{ {
wxString msg; wxString msg;
...@@ -223,7 +223,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -223,7 +223,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
* *
* All coordinates of the object are offset to the cursor position. * All coordinates of the object are offset to the cursor position.
*/ */
void WinEDA_LibeditFrame::PlaceAncre() void LIB_EDIT_FRAME::PlaceAncre()
{ {
if( m_component == NULL ) if( m_component == NULL )
return; return;
......
...@@ -26,7 +26,7 @@ extern int ImportPartId; ...@@ -26,7 +26,7 @@ extern int ImportPartId;
extern int CreateNewLibAndSavePartId; extern int CreateNewLibAndSavePartId;
void WinEDA_LibeditFrame::ReCreateVToolbar() void LIB_EDIT_FRAME::ReCreateVToolbar()
{ {
if( m_VToolBar != NULL ) if( m_VToolBar != NULL )
return; return;
...@@ -86,7 +86,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar() ...@@ -86,7 +86,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar()
} }
void WinEDA_LibeditFrame::ReCreateHToolbar() void LIB_EDIT_FRAME::ReCreateHToolbar()
{ {
wxString msg; wxString msg;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "template_fieldnames.h" #include "template_fieldnames.h"
class WinEDA_LibeditFrame; class LIB_EDIT_FRAME;
class WinEDA_ViewlibFrame; class WinEDA_ViewlibFrame;
class SCH_SCREEN; class SCH_SCREEN;
class DRAWSEGMENT; class DRAWSEGMENT;
...@@ -63,7 +63,7 @@ public: ...@@ -63,7 +63,7 @@ public:
int m_NetlistFormat; int m_NetlistFormat;
bool m_ShowAllPins; bool m_ShowAllPins;
wxPoint m_OldPos; wxPoint m_OldPos;
WinEDA_LibeditFrame* m_LibeditFrame; LIB_EDIT_FRAME* m_LibeditFrame;
WinEDA_ViewlibFrame* m_ViewlibFrame; WinEDA_ViewlibFrame* m_ViewlibFrame;
wxString m_UserLibraryPath; wxString m_UserLibraryPath;
wxArrayString m_ComponentLibFiles; wxArrayString m_ComponentLibFiles;
......
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