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 )
/***********************************************************************/ /***********************************************************************/
{ {
......
#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;
......
This diff is collapsed.
/*****************************/
/* 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