More EESchema dialog file housekeeping and coding policy fixes.
This commit is contained in:
parent
408cf4d87e
commit
ccabd605a5
|
@ -4,6 +4,16 @@ KiCad ChangeLog 2010
|
|||
Please add newer entries at the top, list the date and your name with
|
||||
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>
|
||||
================================================================================
|
||||
++EESchema
|
||||
|
|
|
@ -47,14 +47,14 @@ set(EESCHEMA_SRCS
|
|||
dialogs/dialog_edit_label_base.cpp
|
||||
dialogs/dialog_edit_libentry_fields_in_lib.cpp
|
||||
dialogs/dialog_edit_libentry_fields_in_lib_base.cpp
|
||||
dialog_eeschema_config.cpp
|
||||
dialog_eeschema_config_fbp.cpp
|
||||
dialog_eeschema_options_base.cpp
|
||||
dialog_eeschema_options.cpp
|
||||
dialogs/dialog_eeschema_config.cpp
|
||||
dialogs/dialog_eeschema_config_fbp.cpp
|
||||
dialogs/dialog_eeschema_options_base.cpp
|
||||
dialogs/dialog_eeschema_options.cpp
|
||||
dialogs/dialog_erc.cpp
|
||||
dialogs/dialog_erc_base.cpp
|
||||
dialog_libedit_dimensions.cpp
|
||||
dialog_libedit_dimensions_base.cpp
|
||||
dialogs/dialog_libedit_dimensions.cpp
|
||||
dialogs/dialog_libedit_dimensions_base.cpp
|
||||
dialogs/dialog_lib_edit_draw_item.cpp
|
||||
dialogs/dialog_lib_edit_draw_item_base.cpp
|
||||
dialogs/dialog_lib_edit_pin.cpp
|
||||
|
|
|
@ -22,7 +22,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
|
|||
* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
|
||||
* the key (ALT, SHIFT ALT ..)
|
||||
*/
|
||||
int WinEDA_LibeditFrame::ReturnBlockCommand( int key )
|
||||
int LIB_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||
{
|
||||
int cmd;
|
||||
|
||||
|
@ -69,7 +69,7 @@ int WinEDA_LibeditFrame::ReturnBlockCommand( int key )
|
|||
* 1 if HandleBlockPlace must follow (items found, and a block place
|
||||
* command must follow)
|
||||
*/
|
||||
bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
|
||||
bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||
{
|
||||
int ItemCount = 0;
|
||||
int nextCmd = false;
|
||||
|
@ -192,7 +192,7 @@ bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
|
|||
* - block move & drag
|
||||
* - block copy & paste
|
||||
*/
|
||||
void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
|
||||
void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
{
|
||||
bool err = FALSE;
|
||||
wxPoint pt;
|
||||
|
@ -281,7 +281,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
wxPoint move_offset;
|
||||
PtBlock = &screen->m_BlockLocate;
|
||||
|
||||
WinEDA_LibeditFrame* parent = ( WinEDA_LibeditFrame* ) panel->GetParent();
|
||||
LIB_EDIT_FRAME* parent = ( LIB_EDIT_FRAME* ) panel->GetParent();
|
||||
wxASSERT( parent != NULL );
|
||||
|
||||
LIB_COMPONENT* component = parent->GetComponent();
|
||||
|
|
|
@ -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;
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* dialog_libedit_dimensions.cpp
|
||||
* Handles the dialog so set current texts and pins sizes in LibEdit
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "general.h"
|
||||
#include "libeditframe.h"
|
||||
|
||||
#include "dialog_libedit_dimensions_base.h"
|
||||
|
||||
|
||||
class DIALOG_LIBEDIT_DIMENSIONS : public DIALOG_LIBEDIT_DIMENSIONS_BASE
|
||||
{
|
||||
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 )
|
||||
{
|
||||
GetSizer()->SetSizeHints(this);
|
||||
Centre( wxBOTH );
|
||||
}
|
||||
|
||||
DIALOG_LIBEDIT_DIMENSIONS::~DIALOG_LIBEDIT_DIMENSIONS()
|
||||
{
|
||||
}
|
||||
|
||||
void DIALOG_LIBEDIT_DIMENSIONS::initDialog()
|
||||
{
|
||||
SetFocus( );
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#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 )
|
||||
{
|
||||
m_Parent = aParent;
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
class DIALOG_EDIT_COMPONENT_IN_LIBRARY: public DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE
|
||||
{
|
||||
public:
|
||||
WinEDA_LibeditFrame * m_Parent;
|
||||
LIB_EDIT_FRAME* m_Parent;
|
||||
bool m_RecreateToolbar;
|
||||
int m_AliasLocation;
|
||||
|
||||
public:
|
||||
/// Constructors
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* parent);
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* parent);
|
||||
~DIALOG_EDIT_COMPONENT_IN_LIBRARY();
|
||||
|
||||
private:
|
||||
|
|
|
@ -31,16 +31,15 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB : public DIALOG_EDIT_LIBENTRY_FIELDS_IN
|
|||
/*****************************************************************************************/
|
||||
{
|
||||
private:
|
||||
WinEDA_LibeditFrame* m_Parent;
|
||||
LIB_COMPONENT* m_LibEntry;
|
||||
bool m_skipCopyFromPanel;
|
||||
LIB_EDIT_FRAME* m_Parent;
|
||||
LIB_COMPONENT* m_LibEntry;
|
||||
bool m_skipCopyFromPanel;
|
||||
|
||||
/// a copy of the edited component's LIB_FIELDs
|
||||
std::vector <LIB_FIELD> m_FieldsBuf;
|
||||
|
||||
public:
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( WinEDA_LibeditFrame* aParent,
|
||||
LIB_COMPONENT* aLibEntry );
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( LIB_EDIT_FRAME* aParent, LIB_COMPONENT* aLibEntry );
|
||||
~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB();
|
||||
|
||||
private:
|
||||
|
@ -104,7 +103,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event )
|
||||
void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
|
||||
{
|
||||
if( m_component == NULL )
|
||||
return;
|
||||
|
@ -127,8 +126,8 @@ void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event )
|
|||
|
||||
/***********************************************************************/
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB(
|
||||
WinEDA_LibeditFrame* aParent,
|
||||
LIB_COMPONENT* aLibEntry ) :
|
||||
LIB_EDIT_FRAME* aParent,
|
||||
LIB_COMPONENT* aLibEntry ) :
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( aParent )
|
||||
/***********************************************************************/
|
||||
{
|
||||
|
|
|
@ -22,65 +22,16 @@
|
|||
|
||||
#include <wx/tokenzr.h>
|
||||
|
||||
#include "dialog_eeschema_config_fbp.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 );
|
||||
#include "dialog_eeschema_config.h"
|
||||
|
||||
|
||||
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* parent,
|
||||
WinEDA_DrawFrame * activeWindow )
|
||||
: DIALOG_EESCHEMA_CONFIG_FBP( activeWindow )
|
||||
/*******************************************************************************/
|
||||
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* aSchFrame,
|
||||
WinEDA_DrawFrame* aParent )
|
||||
: DIALOG_EESCHEMA_CONFIG_FBP( aParent )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
m_Parent = parent;
|
||||
m_Parent = aSchFrame;
|
||||
|
||||
Init();
|
||||
|
||||
|
@ -92,9 +43,7 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent,
|
|||
}
|
||||
|
||||
|
||||
/***********************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::Init()
|
||||
/***********************************/
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -104,7 +53,6 @@ void DIALOG_EESCHEMA_CONFIG::Init()
|
|||
m_LibPathChanged = false;
|
||||
m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath;
|
||||
|
||||
|
||||
m_ListLibr->InsertItems( m_Parent->m_ComponentLibFiles, 0 );
|
||||
|
||||
// Load user libs paths:
|
||||
|
@ -112,30 +60,33 @@ void DIALOG_EESCHEMA_CONFIG::Init()
|
|||
while( Token.HasMoreTokens() )
|
||||
{
|
||||
wxString path = Token.GetNextToken();
|
||||
|
||||
if( wxFileName::DirExists( path ) )
|
||||
m_listUserPaths->Append(path);
|
||||
m_listUserPaths->Append( path );
|
||||
}
|
||||
|
||||
// Display actual libraries paths:
|
||||
wxPathList libpaths = wxGetApp().GetLibraryPathList();
|
||||
|
||||
for( unsigned ii = 0; ii < libpaths.GetCount(); 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 )
|
||||
m_DefaultLibraryPathslistBox->Select( 1 );
|
||||
|
||||
m_sdbSizer1OK->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
|
||||
/********************************************************************/
|
||||
{
|
||||
wxArrayInt selections;
|
||||
|
||||
m_ListLibr->GetSelections(selections);
|
||||
m_ListLibr->GetSelections( selections );
|
||||
|
||||
if ( selections.GetCount() <= 0 ) // No selection.
|
||||
return;
|
||||
|
||||
|
@ -149,6 +100,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
|
|||
int jj = selections[ii];
|
||||
EXCHG( libnames[jj], libnames[jj-1]);
|
||||
}
|
||||
|
||||
m_ListLibr->Set(libnames);
|
||||
|
||||
// Reselect previously selected names
|
||||
|
@ -162,13 +114,12 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonUpClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
|
||||
/*********************************************************************/
|
||||
{
|
||||
wxArrayInt selections;
|
||||
|
||||
m_ListLibr->GetSelections(selections);
|
||||
|
||||
if ( selections.GetCount() <= 0 ) // No selection.
|
||||
return;
|
||||
|
||||
|
@ -183,6 +134,7 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
|
|||
int jj = selections[ii];
|
||||
EXCHG( libnames[jj], libnames[jj+1]);
|
||||
}
|
||||
|
||||
m_ListLibr->Set(libnames);
|
||||
|
||||
// Reselect previously selected names
|
||||
|
@ -191,19 +143,18 @@ void DIALOG_EESCHEMA_CONFIG::OnButtonDownClick( wxCommandEvent& event )
|
|||
int jj = selections[ii];
|
||||
m_ListLibr->SetSelection(jj+1);
|
||||
}
|
||||
|
||||
m_LibListChanged = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
|
||||
/******************************************************************/
|
||||
{
|
||||
// Recreate the user lib path
|
||||
if ( m_LibPathChanged )
|
||||
{
|
||||
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ )
|
||||
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ;
|
||||
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
|
||||
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii) );
|
||||
wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1);
|
||||
}
|
||||
|
||||
|
@ -211,19 +162,19 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
|
||||
/**************************************************************/
|
||||
{
|
||||
// Recreate the user lib path
|
||||
if ( m_LibPathChanged )
|
||||
{
|
||||
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 )
|
||||
m_Parent->m_UserLibraryPath << wxT(";");
|
||||
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString(ii);
|
||||
m_Parent->m_UserLibraryPath << wxT( ";" );
|
||||
|
||||
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString( ii );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -234,42 +185,41 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
|
|||
{
|
||||
// Recreate lib list
|
||||
m_Parent->m_ComponentLibFiles.Clear();
|
||||
|
||||
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
|
||||
m_Parent->LoadLibraries();
|
||||
|
||||
// Clear (if needed) the current active library in libedit because it could be
|
||||
// removed from memory
|
||||
WinEDA_LibeditFrame::EnsureActiveLibExists();
|
||||
LIB_EDIT_FRAME::EnsureActiveLibExists();
|
||||
}
|
||||
|
||||
m_Parent->SaveProjectFile( this, false );
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event )
|
||||
/**************************************************************/
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
||||
/*********************************************************************/
|
||||
/* 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;
|
||||
|
||||
m_ListLibr->GetSelections(selections);
|
||||
m_ListLibr->GetSelections( selections );
|
||||
|
||||
for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
|
||||
{
|
||||
m_ListLibr->Delete(selections[ii] );
|
||||
m_ListLibr->Delete( selections[ii] );
|
||||
m_LibListChanged = TRUE;
|
||||
}
|
||||
|
||||
|
@ -277,32 +227,32 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
|||
if( m_ListLibr->GetCount() > 0 && selections.GetCount() > 0 )
|
||||
{
|
||||
int pos = selections[selections.GetCount()-1];
|
||||
|
||||
if( pos == (int)m_ListLibr->GetCount() )
|
||||
pos = m_ListLibr->GetCount() - 1;
|
||||
|
||||
m_ListLibr->SetSelection( pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
||||
/**************************************************************************/
|
||||
|
||||
/* Insert or add a library to the library list:
|
||||
* The new library is put in list before (insert button) the selection,
|
||||
* or added (add button) to end of list
|
||||
* 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;
|
||||
wxString libfilename;
|
||||
wxFileName fn;
|
||||
|
||||
wxArrayInt selections;
|
||||
m_ListLibr->GetSelections(selections);
|
||||
|
||||
m_ListLibr->GetSelections( selections );
|
||||
|
||||
ii = selections.GetCount();
|
||||
|
||||
if( ii > 0 )
|
||||
ii = selections[0];
|
||||
else
|
||||
|
@ -310,6 +260,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
|||
|
||||
wxString libpath;
|
||||
libpath = m_DefaultLibraryPathslistBox->GetStringSelection();
|
||||
|
||||
if ( libpath.IsEmpty() )
|
||||
libpath = wxGetApp().ReturnLastVisitedLibraryPath();
|
||||
|
||||
|
@ -323,9 +274,10 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
|||
wxArrayString Filenames;
|
||||
FilesDialog.GetPaths( Filenames );
|
||||
|
||||
for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
|
||||
for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
|
||||
{
|
||||
fn = Filenames[jj];
|
||||
|
||||
if ( jj == 0 )
|
||||
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
|
||||
|
||||
|
@ -337,6 +289,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
|||
* is a sub path of these default paths
|
||||
*/
|
||||
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
|
||||
|
||||
// Remove extension:
|
||||
fn = libfilename;
|
||||
fn.SetExt(wxEmptyString);
|
||||
|
@ -362,9 +315,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
|||
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
||||
/***********************************************************************/
|
||||
{
|
||||
wxString path = wxGetApp().ReturnLastVisitedLibraryPath();
|
||||
|
||||
|
@ -375,26 +326,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
|||
if( !select )
|
||||
return;
|
||||
|
||||
if( ! wxFileName::DirExists( path ) ) // Should not occurs
|
||||
if( !wxFileName::DirExists( path ) ) // Should not occurs
|
||||
return;
|
||||
|
||||
// Add or insert path if not already in list
|
||||
if( m_listUserPaths->FindString( path ) == wxNOT_FOUND )
|
||||
{
|
||||
int ipos = m_listUserPaths->GetCount();
|
||||
|
||||
if ( event.GetId() == wxID_INSERT_PATH )
|
||||
{
|
||||
if ( ipos ) ipos--;
|
||||
if ( ipos )
|
||||
ipos--;
|
||||
|
||||
int jj = m_listUserPaths->GetSelection();
|
||||
|
||||
if ( jj >= 0 )
|
||||
ipos = jj;
|
||||
}
|
||||
|
||||
// Ask the user if this is a relative path
|
||||
int diag = wxMessageBox(
|
||||
_( "Use a relative path?" ),
|
||||
_( "Path type" ),
|
||||
wxYES_NO | wxICON_QUESTION, this );
|
||||
int diag = wxMessageBox( _( "Use a relative path?" ), _( "Path type" ),
|
||||
wxYES_NO | wxICON_QUESTION, this );
|
||||
|
||||
if( diag == wxYES )
|
||||
{ // Make it relative
|
||||
|
@ -410,26 +363,28 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
|||
// Display actual libraries paths:
|
||||
wxPathList libpaths = wxGetApp().GetLibraryPathList();
|
||||
m_DefaultLibraryPathslistBox->Clear();
|
||||
|
||||
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
|
||||
{
|
||||
m_DefaultLibraryPathslistBox->Append( libpaths[ii]);
|
||||
}
|
||||
}
|
||||
else
|
||||
DisplayError(this, _("Path already in use") );
|
||||
{
|
||||
DisplayError( this, _("Path already in use") );
|
||||
}
|
||||
|
||||
wxGetApp().SaveLastVisitedLibraryPath( path );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
||||
/***********************************************************************/
|
||||
{
|
||||
int ii = m_listUserPaths->GetSelection();
|
||||
|
||||
if ( ii < 0 )
|
||||
ii = m_listUserPaths->GetCount()-1;
|
||||
|
||||
if ( ii >= 0 )
|
||||
{
|
||||
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() );
|
||||
|
@ -440,8 +395,9 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
|||
// Display actual libraries paths:
|
||||
wxPathList libpaths = wxGetApp().GetLibraryPathList();
|
||||
m_DefaultLibraryPathslistBox->Clear();
|
||||
|
||||
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
|
||||
{
|
||||
m_DefaultLibraryPathslistBox->Append( libpaths[ii]);
|
||||
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
#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 ) :
|
|||
DIALOG_EESCHEMA_OPTIONS_BASE( parent )
|
||||
{
|
||||
m_choiceUnits->SetFocus();
|
||||
m_sdbSizer1OK->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,8 +22,7 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GridArray& grid_sizes,
|
||||
int grid_id )
|
||||
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GridArray& grid_sizes, int grid_id )
|
||||
{
|
||||
wxASSERT( grid_sizes.GetCount() > 0 );
|
||||
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
|
||||
/** 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 */
|
||||
wxString GetFieldName( int aNdx );
|
|
@ -17,7 +17,7 @@
|
|||
#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 )
|
||||
{
|
||||
m_Parent = aParent;
|
||||
|
@ -34,8 +34,8 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( )
|
|||
|
||||
if ( m_GraphicText )
|
||||
{
|
||||
msg = ReturnStringFromValue(g_UserUnit, m_GraphicText->m_Size.x,
|
||||
m_Parent->m_InternalUnits);
|
||||
msg = ReturnStringFromValue( g_UserUnit, m_GraphicText->m_Size.x,
|
||||
m_Parent->m_InternalUnits );
|
||||
m_TextSize->SetValue( msg );
|
||||
m_TextValue->SetValue( m_GraphicText->m_Text );
|
||||
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
#include "dialog_lib_edit_text_base.h"
|
||||
|
||||
|
||||
class WinEDA_LibeditFrame;
|
||||
class LIB_EDIT_FRAME;
|
||||
class LIB_TEXT;
|
||||
|
||||
|
||||
class DIALOG_LIB_EDIT_TEXT : public DIALOG_LIB_EDIT_TEXT_BASE
|
||||
{
|
||||
private:
|
||||
WinEDA_LibeditFrame* m_Parent;
|
||||
LIB_EDIT_FRAME* m_Parent;
|
||||
LIB_TEXT* m_GraphicText;
|
||||
|
||||
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() {};
|
||||
|
||||
private:
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* dialog_libedit_dimensions.cpp
|
||||
* Handles the dialog so set current texts and pins sizes in LibEdit
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "general.h"
|
||||
#include "libeditframe.h"
|
||||
|
||||
#include "dialog_libedit_dimensions.h"
|
||||
|
||||
|
||||
DIALOG_LIBEDIT_DIMENSIONS::DIALOG_LIBEDIT_DIMENSIONS( LIB_EDIT_FRAME* parent )
|
||||
: DIALOG_LIBEDIT_DIMENSIONS_BASE( parent )
|
||||
{
|
||||
GetSizer()->SetSizeHints( this );
|
||||
Centre( wxBOTH );
|
||||
}
|
||||
|
||||
|
||||
DIALOG_LIBEDIT_DIMENSIONS::~DIALOG_LIBEDIT_DIMENSIONS()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIBEDIT_DIMENSIONS::initDialog()
|
||||
{
|
||||
SetFocus();
|
||||
}
|
|
@ -20,9 +20,11 @@
|
|||
#include "hotkeys.h"
|
||||
#include "sch_sheet.h"
|
||||
|
||||
#include "dialog_eeschema_options.h"
|
||||
#include "dialog_hotkeys_editor.h"
|
||||
|
||||
#include "dialogs/dialog_eeschema_config.h"
|
||||
#include "dialogs/dialog_eeschema_options.h"
|
||||
|
||||
#include <wx/fdrepdlg.h>
|
||||
|
||||
|
||||
|
@ -30,7 +32,16 @@
|
|||
|
||||
#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();
|
||||
wxPoint pos;
|
||||
|
@ -87,11 +98,18 @@ void WinEDA_LibeditFrame::Process_Config( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
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 )
|
||||
{
|
||||
|
|
|
@ -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
|
||||
// removed from memory
|
||||
WinEDA_LibeditFrame::EnsureActiveLibExists();
|
||||
LIB_EDIT_FRAME::EnsureActiveLibExists();
|
||||
|
||||
// Delete old caches.
|
||||
CMP_LIBRARY::RemoveCacheLibrary();
|
||||
|
|
|
@ -837,7 +837,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
* under the mouse cursor
|
||||
* 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 toolCmd( wxEVT_COMMAND_TOOL_CLICKED );
|
||||
|
|
|
@ -31,7 +31,7 @@ extern int ExportPartId;
|
|||
* Or 1 component if there are several.
|
||||
* 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;
|
||||
wxFileName fn;
|
||||
|
@ -90,7 +90,7 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event )
|
|||
*
|
||||
* 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;
|
||||
wxString msg, title;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
/* 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: " );
|
||||
|
||||
|
@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::DisplayLibInfos()
|
|||
|
||||
|
||||
/* Function to select the current library (working library) */
|
||||
void WinEDA_LibeditFrame::SelectActiveLibrary()
|
||||
void LIB_EDIT_FRAME::SelectActiveLibrary()
|
||||
{
|
||||
CMP_LIBRARY* Lib;
|
||||
|
||||
|
@ -59,7 +59,7 @@ void WinEDA_LibeditFrame::SelectActiveLibrary()
|
|||
* If there is no current selected library,
|
||||
* 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;
|
||||
wxString msg;
|
||||
|
@ -127,7 +127,7 @@ void WinEDA_LibeditFrame::LoadOneLibraryPart( wxCommandEvent& event )
|
|||
* 1 if error
|
||||
* 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;
|
||||
LIB_COMPONENT* component;
|
||||
|
@ -194,7 +194,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY*
|
|||
|
||||
|
||||
/* 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 )
|
||||
return;
|
||||
|
@ -233,7 +233,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
* Save (on disk) the current library
|
||||
* if exists the old file is renamed (.bak)
|
||||
*/
|
||||
void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
|
||||
void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn;
|
||||
wxString msg;
|
||||
|
@ -306,7 +306,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
|
|||
*
|
||||
* Used when displaying the list of library components.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::DisplayCmpDoc()
|
||||
void LIB_EDIT_FRAME::DisplayCmpDoc()
|
||||
{
|
||||
wxString msg;
|
||||
LIB_ALIAS* alias;
|
||||
|
@ -369,7 +369,7 @@ void WinEDA_LibeditFrame::DisplayCmpDoc()
|
|||
* Otherwise the alias becomes the new component name, and the other
|
||||
* aliases become dependent on newly named component.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::DeleteOnePart( wxCommandEvent& event )
|
||||
void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
|
||||
{
|
||||
wxString CmpName;
|
||||
LIB_ALIAS* LibEntry;
|
||||
|
@ -467,7 +467,7 @@ All changes will be lost. Discard changes?" ) ) )
|
|||
*
|
||||
* 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;
|
||||
|
||||
|
@ -570,7 +570,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
|
|||
* The routine deletes the old component (and / or aliases) to replace
|
||||
* 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* Component;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#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;
|
||||
|
||||
|
@ -129,7 +129,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
|||
break;
|
||||
|
||||
default:
|
||||
DisplayError( this, wxT( "WinEDA_LibeditFrame::OnLeftClick error" ) );
|
||||
DisplayError( this, wxT( "LIB_EDIT_FRAME::OnLeftClick error" ) );
|
||||
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
||||
break;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
|||
* If an editable item (field, pin, graphic):
|
||||
* 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();
|
||||
|
||||
|
@ -222,7 +222,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
|||
|
||||
default:
|
||||
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() );
|
||||
DisplayError( this, msg );
|
||||
break;
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
|
||||
|
||||
/* functions to add commands and submenus depending on the item */
|
||||
static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame );
|
||||
static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, WinEDA_LibeditFrame* frame );
|
||||
static void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* 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();
|
||||
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE );
|
||||
|
@ -262,9 +262,8 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
|
|||
|
||||
default:
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "WinEDA_LibeditFrame::OnRightClick Error: unknown \
|
||||
StructType %d" ),
|
||||
DrawEntry->Type() );
|
||||
msg.Printf( wxT( "LIB_EDIT_FRAME::OnRightClick Error: unknown StructType %d" ),
|
||||
DrawEntry->Type() );
|
||||
DisplayError( this, msg );
|
||||
m_drawItem = NULL;
|
||||
break;
|
||||
|
@ -275,9 +274,7 @@ StructType %d" ),
|
|||
}
|
||||
|
||||
|
||||
void AddMenusForPin( wxMenu* PopMenu,
|
||||
LIB_PIN* Pin,
|
||||
WinEDA_LibeditFrame* frame )
|
||||
void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
|
||||
{
|
||||
bool selected = (Pin->m_Selected & IS_SELECTED) != 0;
|
||||
bool not_in_move = (Pin->m_Flags == 0);
|
||||
|
@ -325,7 +322,7 @@ void AddMenusForPin( wxMenu* PopMenu,
|
|||
|
||||
/* 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,
|
||||
_( "Cancel Block" ), cancel_xpm );
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* Function OnPlotCurrentComponent
|
||||
* 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();
|
||||
wxString FullFileName;
|
||||
|
@ -98,7 +98,7 @@ void WinEDA_LibeditFrame::OnPlotCurrentComponent( wxCommandEvent& event )
|
|||
* @param aFileName = the full filename
|
||||
* @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();
|
||||
|
||||
|
@ -112,9 +112,7 @@ void WinEDA_LibeditFrame::CreatePNGorJPEGFile( const wxString& aFileName, bool a
|
|||
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
|
||||
if( !image.SaveFile( aFileName,
|
||||
aFmt_jpeg ? wxBITMAP_TYPE_JPEG :
|
||||
wxBITMAP_TYPE_PNG ) )
|
||||
if( !image.SaveFile( aFileName, aFmt_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Can't save file <%s>" ), GetChars( aFileName ) );
|
||||
|
@ -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 aData = a pointer on an auxiliary data (not used here)
|
||||
*/
|
||||
void WinEDA_LibeditFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
|
||||
int aPrintMask, bool aPrintMirrorMode,
|
||||
void * aData)
|
||||
void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMask,
|
||||
bool aPrintMirrorMode, void* aData)
|
||||
{
|
||||
if( ! m_component )
|
||||
return;
|
||||
|
||||
wxSize pagesize = GetScreen()->ReturnPageSize( );
|
||||
wxSize pagesize = GetScreen()->ReturnPageSize();
|
||||
/* Plot item centered to the page
|
||||
* In libedit, the component is centered at 0,0 coordinates.
|
||||
* So we must plot it with an offset = pagesize/2.
|
||||
|
@ -149,8 +146,7 @@ void WinEDA_LibeditFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
|
|||
plot_offset.x = pagesize.x/2;
|
||||
plot_offset.y = pagesize.y/2;
|
||||
|
||||
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit,
|
||||
m_convert, GR_DEFAULT_DRAWMODE );
|
||||
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#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;
|
||||
PICKED_ITEMS_LIST* lastcmd;
|
||||
|
@ -39,7 +39,7 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int un
|
|||
* - Place the current edited library component in undo list
|
||||
* - 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 )
|
||||
return;
|
||||
|
@ -75,7 +75,7 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event)
|
|||
* - Place the current edited library component in Redo list
|
||||
* - 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 )
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* EESchema - libeditframe.cpp
|
||||
* class WinEDA_LibeditFrame: the component editor frame
|
||||
* class LIB_EDIT_FRAME: the component editor frame
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialogs/dialog_lib_edit_text.h"
|
||||
#include "dialogs/dialog_SVG_print.h"
|
||||
#include "dialogs/dialog_edit_component_in_lib.h"
|
||||
#include "dialogs/dialog_libedit_dimensions.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
|
@ -52,115 +53,115 @@ int CreateNewLibAndSavePartId = ::wxNewId();
|
|||
* that was being edited will be displayed. These members are protected
|
||||
* making it necessary to use the class access methods.
|
||||
*/
|
||||
LIB_COMPONENT* WinEDA_LibeditFrame::m_component = NULL;
|
||||
CMP_LIBRARY* WinEDA_LibeditFrame:: m_library = NULL;
|
||||
LIB_COMPONENT* LIB_EDIT_FRAME::m_component = NULL;
|
||||
CMP_LIBRARY* LIB_EDIT_FRAME:: m_library = NULL;
|
||||
|
||||
wxString WinEDA_LibeditFrame:: m_aliasName;
|
||||
int WinEDA_LibeditFrame:: m_unit = 1;
|
||||
int WinEDA_LibeditFrame:: m_convert = 1;
|
||||
LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_lastDrawItem = NULL;
|
||||
LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_drawItem = NULL;
|
||||
bool WinEDA_LibeditFrame:: m_showDeMorgan = false;
|
||||
wxSize WinEDA_LibeditFrame:: m_clientSize = wxSize( -1, -1 );
|
||||
int WinEDA_LibeditFrame:: m_textSize = DEFAULT_SIZE_TEXT;
|
||||
int WinEDA_LibeditFrame:: m_textOrientation = TEXT_ORIENT_HORIZ;
|
||||
int WinEDA_LibeditFrame:: m_drawLineWidth = 0;
|
||||
FILL_T WinEDA_LibeditFrame:: m_drawFillStyle = NO_FILL;
|
||||
wxString LIB_EDIT_FRAME:: m_aliasName;
|
||||
int LIB_EDIT_FRAME:: m_unit = 1;
|
||||
int LIB_EDIT_FRAME:: m_convert = 1;
|
||||
LIB_DRAW_ITEM* LIB_EDIT_FRAME::m_lastDrawItem = NULL;
|
||||
LIB_DRAW_ITEM* LIB_EDIT_FRAME::m_drawItem = NULL;
|
||||
bool LIB_EDIT_FRAME:: m_showDeMorgan = false;
|
||||
wxSize LIB_EDIT_FRAME:: m_clientSize = wxSize( -1, -1 );
|
||||
int LIB_EDIT_FRAME:: m_textSize = DEFAULT_SIZE_TEXT;
|
||||
int LIB_EDIT_FRAME:: m_textOrientation = TEXT_ORIENT_HORIZ;
|
||||
int LIB_EDIT_FRAME:: m_drawLineWidth = 0;
|
||||
FILL_T LIB_EDIT_FRAME:: m_drawFillStyle = NO_FILL;
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* class WinEDA_LibeditFrame */
|
||||
/*****************************/
|
||||
BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
|
||||
EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow )
|
||||
EVT_SIZE( WinEDA_LibeditFrame::OnSize )
|
||||
EVT_ACTIVATE( WinEDA_LibeditFrame::OnActivate )
|
||||
/************************/
|
||||
/* class LIB_EDIT_FRAME */
|
||||
/************************/
|
||||
BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, WinEDA_DrawFrame )
|
||||
EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
|
||||
EVT_SIZE( LIB_EDIT_FRAME::OnSize )
|
||||
EVT_ACTIVATE( LIB_EDIT_FRAME::OnActivate )
|
||||
|
||||
/* Main horizontal toolbar. */
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_LibeditFrame::OnZoom )
|
||||
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, WinEDA_LibeditFrame::SaveActiveLibrary )
|
||||
EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, WinEDA_LibeditFrame::Process_Special_Functions )
|
||||
EVT_TOOL( ID_LIBEDIT_DELETE_PART, WinEDA_LibeditFrame::DeleteOnePart )
|
||||
EVT_TOOL( ID_LIBEDIT_NEW_PART, WinEDA_LibeditFrame::CreateNewLibraryPart )
|
||||
EVT_TOOL( ID_LIBEDIT_SELECT_PART, WinEDA_LibeditFrame::LoadOneLibraryPart )
|
||||
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, WinEDA_LibeditFrame::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_UNDO, WinEDA_LibeditFrame::GetComponentFromUndoList )
|
||||
EVT_TOOL( wxID_REDO, WinEDA_LibeditFrame::GetComponentFromRedoList )
|
||||
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, WinEDA_LibeditFrame::OnEditComponentProperties )
|
||||
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, WinEDA_LibeditFrame::InstallFieldsEditorDialog )
|
||||
EVT_TOOL( ID_LIBEDIT_CHECK_PART, WinEDA_LibeditFrame::OnCheckComponent )
|
||||
EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, WinEDA_LibeditFrame::OnSelectBodyStyle )
|
||||
EVT_TOOL( ID_DE_MORGAN_CONVERT_BUTT, WinEDA_LibeditFrame::OnSelectBodyStyle )
|
||||
EVT_TOOL( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnViewEntryDoc )
|
||||
EVT_TOOL( ID_LIBEDIT_EDIT_PIN_BY_PIN, WinEDA_LibeditFrame::Process_Special_Functions )
|
||||
EVT_TOOL( ExportPartId, WinEDA_LibeditFrame::OnExportPart )
|
||||
EVT_TOOL( CreateNewLibAndSavePartId, WinEDA_LibeditFrame::OnExportPart )
|
||||
EVT_TOOL( ImportPartId, WinEDA_LibeditFrame::OnImportPart )
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, LIB_EDIT_FRAME::OnZoom )
|
||||
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::SaveActiveLibrary )
|
||||
EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, LIB_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_LIBEDIT_DELETE_PART, LIB_EDIT_FRAME::DeleteOnePart )
|
||||
EVT_TOOL( ID_LIBEDIT_NEW_PART, LIB_EDIT_FRAME::CreateNewLibraryPart )
|
||||
EVT_TOOL( ID_LIBEDIT_SELECT_PART, LIB_EDIT_FRAME::LoadOneLibraryPart )
|
||||
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, LIB_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_UNDO, LIB_EDIT_FRAME::GetComponentFromUndoList )
|
||||
EVT_TOOL( wxID_REDO, LIB_EDIT_FRAME::GetComponentFromRedoList )
|
||||
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnEditComponentProperties )
|
||||
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::InstallFieldsEditorDialog )
|
||||
EVT_TOOL( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnCheckComponent )
|
||||
EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
|
||||
EVT_TOOL( ID_DE_MORGAN_CONVERT_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
|
||||
EVT_TOOL( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnViewEntryDoc )
|
||||
EVT_TOOL( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ExportPartId, LIB_EDIT_FRAME::OnExportPart )
|
||||
EVT_TOOL( CreateNewLibAndSavePartId, LIB_EDIT_FRAME::OnExportPart )
|
||||
EVT_TOOL( ImportPartId, LIB_EDIT_FRAME::OnImportPart )
|
||||
|
||||
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER, WinEDA_LibeditFrame::OnSelectPart )
|
||||
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS, WinEDA_LibeditFrame::OnSelectAlias )
|
||||
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnSelectPart )
|
||||
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnSelectAlias )
|
||||
|
||||
/* 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,
|
||||
WinEDA_LibeditFrame::Process_Special_Functions )
|
||||
LIB_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
/* menubar commands */
|
||||
EVT_MENU( wxID_EXIT, WinEDA_LibeditFrame::CloseWindow )
|
||||
EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, WinEDA_LibeditFrame::SaveActiveLibrary )
|
||||
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, WinEDA_LibeditFrame::OnPlotCurrentComponent )
|
||||
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, WinEDA_LibeditFrame::OnPlotCurrentComponent )
|
||||
EVT_MENU( wxID_EXIT, LIB_EDIT_FRAME::CloseWindow )
|
||||
EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, LIB_EDIT_FRAME::SaveActiveLibrary )
|
||||
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
|
||||
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
|
||||
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
|
||||
|
||||
EVT_MENU( ID_CONFIG_REQ, WinEDA_LibeditFrame::InstallConfigFrame )
|
||||
EVT_MENU( ID_CONFIG_SAVE, WinEDA_LibeditFrame::Process_Config )
|
||||
EVT_MENU( ID_CONFIG_READ, WinEDA_LibeditFrame::Process_Config )
|
||||
EVT_MENU( ID_COLORS_SETUP, WinEDA_LibeditFrame::Process_Config )
|
||||
EVT_MENU( ID_LIBEDIT_DIMENSIONS, WinEDA_LibeditFrame::InstallDimensionsDialog )
|
||||
EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
|
||||
EVT_MENU( ID_CONFIG_SAVE, LIB_EDIT_FRAME::Process_Config )
|
||||
EVT_MENU( ID_CONFIG_READ, LIB_EDIT_FRAME::Process_Config )
|
||||
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::Process_Config )
|
||||
EVT_MENU( ID_LIBEDIT_DIMENSIONS, LIB_EDIT_FRAME::InstallDimensionsDialog )
|
||||
|
||||
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START,
|
||||
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. */
|
||||
EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin )
|
||||
EVT_MENU( ID_LIBEDIT_ROTATE_PIN, WinEDA_LibeditFrame::OnRotatePin )
|
||||
EVT_MENU( ID_LIBEDIT_EDIT_PIN, LIB_EDIT_FRAME::OnEditPin )
|
||||
EVT_MENU( ID_LIBEDIT_ROTATE_PIN, LIB_EDIT_FRAME::OnRotatePin )
|
||||
|
||||
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
|
||||
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,
|
||||
WinEDA_LibeditFrame::Process_Special_Functions )
|
||||
LIB_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
/* Update user interface elements. */
|
||||
EVT_UPDATE_UI( ExportPartId, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( CreateNewLibAndSavePartId, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_PART, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_PART, WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( wxID_UNDO, WinEDA_LibeditFrame::OnUpdateUndo )
|
||||
EVT_UPDATE_UI( wxID_REDO, WinEDA_LibeditFrame::OnUpdateRedo )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, WinEDA_LibeditFrame::OnUpdateSaveCurrentLib )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnUpdateViewDoc )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_PIN, WinEDA_LibeditFrame::OnUpdatePinByPin )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_PART_NUMBER, WinEDA_LibeditFrame::OnUpdatePartNumber )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_ALIAS, WinEDA_LibeditFrame::OnUpdateSelectAlias )
|
||||
EVT_UPDATE_UI( ID_DE_MORGAN_NORMAL_BUTT, WinEDA_LibeditFrame::OnUpdateDeMorganNormal )
|
||||
EVT_UPDATE_UI( ID_DE_MORGAN_CONVERT_BUTT, WinEDA_LibeditFrame::OnUpdateDeMorganConvert )
|
||||
EVT_UPDATE_UI( ExportPartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( CreateNewLibAndSavePartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
EVT_UPDATE_UI( wxID_UNDO, LIB_EDIT_FRAME::OnUpdateUndo )
|
||||
EVT_UPDATE_UI( wxID_REDO, LIB_EDIT_FRAME::OnUpdateRedo )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::OnUpdateSaveCurrentLib )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnUpdateViewDoc )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::OnUpdatePinByPin )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnUpdatePartNumber )
|
||||
EVT_UPDATE_UI( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnUpdateSelectAlias )
|
||||
EVT_UPDATE_UI( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnUpdateDeMorganNormal )
|
||||
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,
|
||||
WinEDA_LibeditFrame::OnUpdateEditingPart )
|
||||
LIB_EDIT_FRAME::OnUpdateEditingPart )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
WinEDA_LibeditFrame::WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style ) :
|
||||
LIB_EDIT_FRAME::LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style ) :
|
||||
WinEDA_DrawFrame( aParent, LIBEDITOR_FRAME, title, pos, size, style )
|
||||
{
|
||||
wxASSERT( 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();
|
||||
|
||||
|
@ -256,7 +257,7 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
|
|||
* Don't forget to call this base method from any derived classes or the
|
||||
* settings will not get loaded.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::LoadSettings()
|
||||
void LIB_EDIT_FRAME::LoadSettings()
|
||||
{
|
||||
wxConfig* cfg;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
* settings will not get saved.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::SaveSettings()
|
||||
void LIB_EDIT_FRAME::SaveSettings()
|
||||
{
|
||||
wxConfig* cfg;
|
||||
|
||||
|
@ -296,7 +297,7 @@ void WinEDA_LibeditFrame::SaveSettings()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||
void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
if( GetScreen()->IsModify() )
|
||||
{
|
||||
|
@ -329,7 +330,7 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
|
|||
}
|
||||
|
||||
|
||||
int WinEDA_LibeditFrame::BestZoom()
|
||||
int LIB_EDIT_FRAME::BestZoom()
|
||||
{
|
||||
int dx, dy, ii, jj;
|
||||
wxSize size;
|
||||
|
@ -379,7 +380,7 @@ int WinEDA_LibeditFrame::BestZoom()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::UpdateAliasSelectList()
|
||||
void LIB_EDIT_FRAME::UpdateAliasSelectList()
|
||||
{
|
||||
if( m_SelAliasBox == NULL )
|
||||
return;
|
||||
|
@ -399,7 +400,7 @@ void WinEDA_LibeditFrame::UpdateAliasSelectList()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::UpdatePartSelectList()
|
||||
void LIB_EDIT_FRAME::UpdatePartSelectList()
|
||||
{
|
||||
if( m_SelpartBox == NULL )
|
||||
return;
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::OnUpdateNotEditingPart( wxUpdateUIEvent& event )
|
||||
void LIB_EDIT_FRAME::OnUpdateNotEditingPart( wxUpdateUIEvent& event )
|
||||
{
|
||||
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
|
||||
&& GetScreen()->GetUndoCommandCount() != 0 && !IsEditingDrawItem() );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::OnUpdateRedo( wxUpdateUIEvent& event )
|
||||
void LIB_EDIT_FRAME::OnUpdateRedo( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_component != NULL && GetScreen() != NULL
|
||||
&& 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() ) );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event )
|
||||
void LIB_EDIT_FRAME::OnUpdateViewDoc( wxUpdateUIEvent& event )
|
||||
{
|
||||
bool enable = false;
|
||||
|
||||
|
@ -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 )
|
||||
&& ( ( m_component->GetPartCount() > 1 ) || m_showDeMorgan ) );
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -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
|
||||
|| m_SelAliasBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0 )
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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();
|
||||
wxPoint pos;
|
||||
|
@ -914,7 +915,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
default:
|
||||
DisplayError( this, wxT( "WinEDA_LibeditFrame::Process_Special_Functions error" ) );
|
||||
DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Special_Functions error" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -935,7 +936,7 @@ void WinEDA_LibeditFrame::OnActivate( wxActivateEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::EnsureActiveLibExists()
|
||||
void LIB_EDIT_FRAME::EnsureActiveLibExists()
|
||||
{
|
||||
if( m_library == NULL )
|
||||
return;
|
||||
|
@ -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_SchematicFrame *parent = (WinEDA_SchematicFrame *)GetParent();
|
||||
|
@ -961,7 +962,7 @@ void WinEDA_LibeditFrame::SetLanguage( wxCommandEvent& event )
|
|||
* create a temporary copy of the current edited 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 )
|
||||
delete m_tempCopyComponent;
|
||||
|
@ -975,7 +976,7 @@ void WinEDA_LibeditFrame::TempCopyComponent()
|
|||
* Restore the current edited component from its temporary copy.
|
||||
* Used to abort a command
|
||||
*/
|
||||
void WinEDA_LibeditFrame::RestoreComponent()
|
||||
void LIB_EDIT_FRAME::RestoreComponent()
|
||||
{
|
||||
if( m_tempCopyComponent == NULL )
|
||||
return;
|
||||
|
@ -989,7 +990,7 @@ void WinEDA_LibeditFrame::RestoreComponent()
|
|||
* Function ClearTempCopyComponent
|
||||
* delete temporary copy of the current component and clear pointer
|
||||
*/
|
||||
void WinEDA_LibeditFrame::ClearTempCopyComponent()
|
||||
void LIB_EDIT_FRAME::ClearTempCopyComponent()
|
||||
{
|
||||
delete m_tempCopyComponent;
|
||||
m_tempCopyComponent = NULL;
|
||||
|
@ -998,13 +999,13 @@ void WinEDA_LibeditFrame::ClearTempCopyComponent()
|
|||
|
||||
/* 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() );
|
||||
}
|
||||
|
||||
|
||||
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 ) )
|
||||
return;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -1048,3 +1049,10 @@ void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event )
|
|||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void LIB_EDIT_FRAME::InstallDimensionsDialog( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_LIBEDIT_DIMENSIONS dlg( this );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*****************************/
|
||||
/* class WinEDA_LibeditFrame */
|
||||
/*****************************/
|
||||
|
||||
/************************/
|
||||
/* class LIB_EDIT_FRAME */
|
||||
/************************/
|
||||
|
||||
#ifndef __LIBEDITFRM_H__
|
||||
#define __LIBEDITFRM_H__
|
||||
|
@ -22,7 +23,7 @@ class DIALOG_LIB_EDIT_TEXT;
|
|||
/**
|
||||
* 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.
|
||||
wxString m_oldRootName; ///< The actual pointer of the component loaded from
|
||||
|
@ -34,12 +35,11 @@ public:
|
|||
WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any)
|
||||
|
||||
public:
|
||||
WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent,
|
||||
const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||
LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent, const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||
|
||||
~WinEDA_LibeditFrame();
|
||||
~LIB_EDIT_FRAME();
|
||||
|
||||
void ReCreateMenuBar();
|
||||
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
* triggers the wxCloseEvent, which is handled by the function given
|
||||
* to EVT_CLOSE() macro:
|
||||
* <p>
|
||||
* EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow )
|
||||
* EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
|
||||
*/
|
||||
void CloseWindow( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#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 title;
|
||||
|
@ -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 )
|
||||
return NULL;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
/**
|
||||
* @brief Create or update the menubar for the Component Editor frame
|
||||
*/
|
||||
void WinEDA_LibeditFrame::ReCreateMenuBar()
|
||||
void LIB_EDIT_FRAME::ReCreateMenuBar()
|
||||
{
|
||||
wxString text;
|
||||
wxMenuItem *item;
|
||||
|
@ -72,8 +72,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
|
|||
*/
|
||||
#if !defined(__WXMAC__)
|
||||
filesMenu->AppendSeparator();
|
||||
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||
_( "Quit Library Editor" ) );
|
||||
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit Library Editor" ) );
|
||||
item->SetBitmap( exit_xpm );
|
||||
filesMenu->Append( item );
|
||||
#endif
|
||||
|
@ -86,8 +85,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
|
|||
/* Undo */
|
||||
text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO);
|
||||
|
||||
item = new wxMenuItem( editMenu, wxID_UNDO, text,
|
||||
_( "Undo last edition" ), wxITEM_NORMAL );
|
||||
item = new wxMenuItem( editMenu, wxID_UNDO, text, _( "Undo last edition" ), wxITEM_NORMAL );
|
||||
item->SetBitmap( undo_xpm );
|
||||
editMenu->Append( item );
|
||||
|
||||
|
@ -126,35 +124,29 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
|
|||
*/
|
||||
/* Zoom in */
|
||||
text =_( "Zoom In" );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
|
||||
wxITEM_NORMAL );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
|
||||
item->SetBitmap( zoom_in_xpm );
|
||||
viewMenu->Append( item );
|
||||
|
||||
/* Zoom out */
|
||||
text = _( "Zoom Out" );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
|
||||
wxITEM_NORMAL );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
|
||||
item->SetBitmap( zoom_out_xpm );
|
||||
viewMenu->Append( item );
|
||||
|
||||
/* Fit on screen */
|
||||
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ZOOM_AUTO );
|
||||
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
|
||||
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
|
||||
HELP_ZOOM_FIT, wxITEM_NORMAL );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
|
||||
item->SetBitmap( zoom_auto_xpm );
|
||||
viewMenu->Append( item );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
|
||||
/* Redraw view */
|
||||
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ZOOM_REDRAW );
|
||||
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
||||
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
|
||||
HELP_ZOOM_REDRAW, wxITEM_NORMAL );
|
||||
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, wxITEM_NORMAL );
|
||||
item->SetBitmap( zoom_redraw_xpm );
|
||||
viewMenu->Append( item );
|
||||
|
||||
|
|
|
@ -38,7 +38,9 @@ static bool LastPinCommonConvert = false;
|
|||
static bool LastPinCommonUnit = false;
|
||||
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
|
||||
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
|
||||
|
@ -72,7 +74,7 @@ void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){
|
|||
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 )
|
||||
return;
|
||||
|
@ -176,7 +178,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
|
|||
*/
|
||||
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 )
|
||||
return;
|
||||
|
@ -203,7 +205,7 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
/**
|
||||
* 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* CurrentPin = (LIB_PIN*) m_drawItem;
|
||||
|
@ -214,7 +216,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC )
|
|||
// Some tests
|
||||
if( (CurrentPin == NULL) || (CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE) )
|
||||
{
|
||||
wxMessageBox( wxT("WinEDA_LibeditFrame::PlacePin() error") );
|
||||
wxMessageBox( wxT("LIB_EDIT_FRAME::PlacePin() error") );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -291,7 +293,7 @@ another pin. Continue?" ) );
|
|||
* Locate the pin pointed to by the cursor, and set the cursor management
|
||||
* function move the pin.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
||||
void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
|
||||
{
|
||||
LIB_PIN* Pin;
|
||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
||||
|
@ -333,7 +335,7 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
|||
* cursor management code. */
|
||||
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 )
|
||||
return;
|
||||
|
@ -374,9 +376,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
* All pins at the same position will be erased.
|
||||
* Otherwise only the pin of the current unit and convert will be erased.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
||||
LIB_COMPONENT* LibEntry,
|
||||
LIB_PIN* Pin )
|
||||
void LIB_EDIT_FRAME::DeletePin( wxDC* DC, LIB_COMPONENT* LibEntry, LIB_PIN* Pin )
|
||||
{
|
||||
LIB_PIN* tmp;
|
||||
wxPoint PinPos;
|
||||
|
@ -410,7 +410,7 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
|||
/*
|
||||
* Create a new pin.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::CreatePin( wxDC* DC )
|
||||
void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
|
||||
{
|
||||
LIB_PIN* pin;
|
||||
bool showPinText = true;
|
||||
|
@ -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
|
||||
* 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;
|
||||
|
@ -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. */
|
||||
void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||
void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||
{
|
||||
LIB_PIN* Pin;
|
||||
wxString msg;
|
||||
|
@ -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
|
||||
* 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
|
||||
int dup_error;
|
||||
|
|
|
@ -13,7 +13,7 @@ class EDA_BaseStruct;
|
|||
class WinEDA_DrawPanel;
|
||||
class WinEDA_DrawFrame;
|
||||
class WinEDA_SchematicFrame;
|
||||
class WinEDA_LibeditFrame;
|
||||
class LIB_EDIT_FRAME;
|
||||
class CMP_LIBRARY;
|
||||
class LIB_COMPONENT;
|
||||
class LIB_DRAW_ITEM;
|
||||
|
@ -229,7 +229,7 @@ void DeleteAllMarkers( int type );
|
|||
/**************/
|
||||
/* 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 )
|
|||
}
|
||||
else
|
||||
{
|
||||
m_LibeditFrame = new WinEDA_LibeditFrame( this,
|
||||
wxT( "Library Editor" ),
|
||||
wxPoint( -1, -1 ),
|
||||
wxSize( 600, 400 ) );
|
||||
m_LibeditFrame = new LIB_EDIT_FRAME( this,
|
||||
wxT( "Library Editor" ),
|
||||
wxPoint( -1, -1 ),
|
||||
wxSize( 600, 400 ) );
|
||||
ActiveScreen = GetBaseScreen();
|
||||
m_LibeditFrame->AdjustScrollBars();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
|
|||
/*
|
||||
* 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 )
|
||||
return;
|
||||
|
@ -99,8 +99,8 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
|
|||
|
||||
static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
|
||||
{
|
||||
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) Panel->GetParent();
|
||||
LIB_DRAW_ITEM* item = parent->GetDrawItem();
|
||||
LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) Panel->GetParent();
|
||||
LIB_DRAW_ITEM* item = parent->GetDrawItem();
|
||||
|
||||
if( item == NULL )
|
||||
return;
|
||||
|
@ -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->ForceCloseManageCurseur = AbortSymbolTraceOn;
|
||||
|
@ -176,7 +176,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry,
|
|||
break;
|
||||
}
|
||||
default:
|
||||
DisplayError( this, wxT( "WinEDA_LibeditFrame::CreateGraphicItem() error" ) );
|
||||
DisplayError( this, wxT( "LIB_EDIT_FRAME::CreateGraphicItem() error" ) );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry,
|
|||
|
||||
/* Create new library component graphic object.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC )
|
||||
void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
|
||||
{
|
||||
if( m_drawItem == NULL )
|
||||
return;
|
||||
|
@ -234,7 +234,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
|
|||
{
|
||||
LIB_DRAW_ITEM* item;
|
||||
|
||||
item = ( (WinEDA_LibeditFrame*) panel->GetParent() )->GetDrawItem();
|
||||
item = ( (LIB_EDIT_FRAME*) panel->GetParent() )->GetDrawItem();
|
||||
|
||||
if( item == NULL )
|
||||
return;
|
||||
|
@ -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 )
|
||||
return;
|
||||
|
@ -266,7 +266,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
|
|||
|
||||
|
||||
// @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 )
|
||||
return;
|
||||
|
@ -283,7 +283,7 @@ void WinEDA_LibeditFrame::StartModifyDrawSymbol( wxDC* DC )
|
|||
static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||
{
|
||||
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 )
|
||||
return;
|
||||
|
@ -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,
|
||||
* 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 )
|
||||
return;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* A symbol file *.sym has the same format as a library, and contains only
|
||||
* one symbol
|
||||
*/
|
||||
void WinEDA_LibeditFrame::LoadOneSymbol( void )
|
||||
void LIB_EDIT_FRAME::LoadOneSymbol( void )
|
||||
{
|
||||
LIB_COMPONENT* Component;
|
||||
wxString msg, err;
|
||||
|
@ -122,7 +122,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
|
|||
*
|
||||
* Invisible pins are not saved
|
||||
*/
|
||||
void WinEDA_LibeditFrame::SaveOneSymbol()
|
||||
void LIB_EDIT_FRAME::SaveOneSymbol()
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -223,7 +223,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
|
|||
*
|
||||
* All coordinates of the object are offset to the cursor position.
|
||||
*/
|
||||
void WinEDA_LibeditFrame::PlaceAncre()
|
||||
void LIB_EDIT_FRAME::PlaceAncre()
|
||||
{
|
||||
if( m_component == NULL )
|
||||
return;
|
||||
|
|
|
@ -26,7 +26,7 @@ extern int ImportPartId;
|
|||
extern int CreateNewLibAndSavePartId;
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::ReCreateVToolbar()
|
||||
void LIB_EDIT_FRAME::ReCreateVToolbar()
|
||||
{
|
||||
if( m_VToolBar != NULL )
|
||||
return;
|
||||
|
@ -86,7 +86,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_LibeditFrame::ReCreateHToolbar()
|
||||
void LIB_EDIT_FRAME::ReCreateHToolbar()
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "template_fieldnames.h"
|
||||
|
||||
|
||||
class WinEDA_LibeditFrame;
|
||||
class LIB_EDIT_FRAME;
|
||||
class WinEDA_ViewlibFrame;
|
||||
class SCH_SCREEN;
|
||||
class DRAWSEGMENT;
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
int m_NetlistFormat;
|
||||
bool m_ShowAllPins;
|
||||
wxPoint m_OldPos;
|
||||
WinEDA_LibeditFrame* m_LibeditFrame;
|
||||
LIB_EDIT_FRAME* m_LibeditFrame;
|
||||
WinEDA_ViewlibFrame* m_ViewlibFrame;
|
||||
wxString m_UserLibraryPath;
|
||||
wxArrayString m_ComponentLibFiles;
|
||||
|
|
Loading…
Reference in New Issue