Add user write permission tests to PCBNew and other minor fixes.
* Check user write permissions before saving project, board, and footprint library files. * Append read only to file name and path in title bar when the user does not have write privileges. * Rename class WinEDA_ModuleEditFrame to FOOTPRINT_EDIT_FRAME. * Lot's of Doxygen comment and coding style policy fixes.
This commit is contained in:
parent
5fd409f826
commit
0d57d670b6
|
@ -22,7 +22,7 @@
|
||||||
/* Forward declarations of classes. */
|
/* Forward declarations of classes. */
|
||||||
class WinEDA_CvpcbFrame;
|
class WinEDA_CvpcbFrame;
|
||||||
class PCB_EDIT_FRAME;
|
class PCB_EDIT_FRAME;
|
||||||
class WinEDA_ModuleEditFrame;
|
class FOOTPRINT_EDIT_FRAME;
|
||||||
class BOARD;
|
class BOARD;
|
||||||
class TEXTE_PCB;
|
class TEXTE_PCB;
|
||||||
class MODULE;
|
class MODULE;
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
wxRealPoint m_UserGridSize;
|
wxRealPoint m_UserGridSize;
|
||||||
|
|
||||||
EDA_3D_FRAME* m_Draw3DFrame;
|
EDA_3D_FRAME* m_Draw3DFrame;
|
||||||
WinEDA_ModuleEditFrame* m_ModuleEditFrame;
|
FOOTPRINT_EDIT_FRAME* m_ModuleEditFrame;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BOARD* m_Pcb;
|
BOARD* m_Pcb;
|
||||||
|
@ -172,7 +172,6 @@ public:
|
||||||
*/
|
*/
|
||||||
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide();
|
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function CursorGoto
|
* Function CursorGoto
|
||||||
* positions the cursor at a given coordinate and reframes the drawing if
|
* positions the cursor at a given coordinate and reframes the drawing if
|
||||||
|
@ -182,7 +181,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void CursorGoto( const wxPoint& aPos );
|
void CursorGoto( const wxPoint& aPos );
|
||||||
|
|
||||||
|
|
||||||
void place_marqueur( wxDC* DC,
|
void place_marqueur( wxDC* DC,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
char* pt_bitmap,
|
char* pt_bitmap,
|
||||||
|
@ -208,8 +206,14 @@ public:
|
||||||
bool aOverwrite,
|
bool aOverwrite,
|
||||||
bool aDisplayDialog );
|
bool aDisplayDialog );
|
||||||
|
|
||||||
void Archive_Modules( const wxString& LibName,
|
/**
|
||||||
bool NewModulesOnly );
|
* Function Archive_Modules
|
||||||
|
* Save in the library:
|
||||||
|
* All new modules (ie modules not found in this lib) (if NewModulesOnly == true)
|
||||||
|
* all modules (if NewModulesOnly == false)
|
||||||
|
*/
|
||||||
|
void Archive_Modules( const wxString& LibName, bool NewModulesOnly );
|
||||||
|
|
||||||
MODULE* GetModuleByName();
|
MODULE* GetModuleByName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -276,15 +280,17 @@ public:
|
||||||
wxDC* DC );
|
wxDC* DC );
|
||||||
|
|
||||||
void AddPad( MODULE* Module, bool draw );
|
void AddPad( MODULE* Module, bool draw );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DeletePad
|
* Function DeletePad
|
||||||
* Delete the pad aPad.
|
* Delete the pad aPad.
|
||||||
* Refresh the modified screen area
|
* Refresh the modified screen area
|
||||||
* Refresh modified parameters of the parent module (bounding box, last date)
|
* Refresh modified parameters of the parent module (bounding box, last date)
|
||||||
* @param aPad = the pad to delete
|
* @param aPad = the pad to delete
|
||||||
* @param aQuery = true to promt for confirmation, false to delete silently
|
* @param aQuery = true to prompt for confirmation, false to delete silently
|
||||||
*/
|
*/
|
||||||
void DeletePad( D_PAD* aPad, bool aQuery = true );
|
void DeletePad( D_PAD* aPad, bool aQuery = true );
|
||||||
|
|
||||||
void StartMovePad( D_PAD* Pad, wxDC* DC );
|
void StartMovePad( D_PAD* Pad, wxDC* DC );
|
||||||
void RotatePad( D_PAD* Pad, wxDC* DC );
|
void RotatePad( D_PAD* Pad, wxDC* DC );
|
||||||
void PlacePad( D_PAD* Pad, wxDC* DC );
|
void PlacePad( D_PAD* Pad, wxDC* DC );
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
/* Forward declarations of classes. */
|
/* Forward declarations of classes. */
|
||||||
class PCB_SCREEN;
|
class PCB_SCREEN;
|
||||||
class WinEDA_ModuleEditFrame;
|
|
||||||
class BOARD;
|
class BOARD;
|
||||||
class TEXTE_PCB;
|
class TEXTE_PCB;
|
||||||
class MODULE;
|
class MODULE;
|
||||||
|
@ -106,7 +105,7 @@ protected:
|
||||||
* here and we do not want to do that.
|
* here and we do not want to do that.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
void syncLayerWidget( );
|
void syncLayerWidget();
|
||||||
|
|
||||||
virtual void unitsChangeRefresh();
|
virtual void unitsChangeRefresh();
|
||||||
|
|
||||||
|
@ -141,6 +140,10 @@ public:
|
||||||
*/
|
*/
|
||||||
void ToPrinter( wxCommandEvent& event );
|
void ToPrinter( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SVG_Print
|
||||||
|
* shows the print SVG file dialog.
|
||||||
|
*/
|
||||||
void SVG_Print( wxCommandEvent& event );
|
void SVG_Print( wxCommandEvent& event );
|
||||||
|
|
||||||
// User interface update command event handlers.
|
// User interface update command event handlers.
|
||||||
|
@ -204,7 +207,7 @@ public:
|
||||||
virtual void SetGridColor(int aColor);
|
virtual void SetGridColor(int aColor);
|
||||||
|
|
||||||
// Configurations:
|
// Configurations:
|
||||||
void InstallConfigFrame( );
|
void InstallConfigFrame();
|
||||||
void Process_Config( wxCommandEvent& event );
|
void Process_Config( wxCommandEvent& event );
|
||||||
|
|
||||||
PARAM_CFG_ARRAY& GetProjectFileParameters();
|
PARAM_CFG_ARRAY& GetProjectFileParameters();
|
||||||
|
@ -341,13 +344,14 @@ public:
|
||||||
void ReCreateMenuBar();
|
void ReCreateMenuBar();
|
||||||
LAYER_BOX_SELECTOR* ReCreateLayerBox( EDA_TOOLBAR* parent );
|
LAYER_BOX_SELECTOR* ReCreateLayerBox( EDA_TOOLBAR* parent );
|
||||||
|
|
||||||
/** Virtual Function OnModify()
|
/**
|
||||||
* Must be called after a board change
|
* Function OnModify
|
||||||
* in order to set the "modify" flag of the current screen
|
* must be called after a board change to set the modified flag.
|
||||||
* and prepare, if needed the refresh of the 3D frame showing the footprint
|
* <p>
|
||||||
* do not forget to call the basic OnModify function to update auxiliary info
|
* Reloads the 3D view if required and calls the base PCB_BASE_FRAME::OnModify function
|
||||||
|
* to update auxiliary information.
|
||||||
*/
|
*/
|
||||||
virtual void OnModify( );
|
virtual void OnModify();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsElementVisible
|
* Function IsElementVisible
|
||||||
|
@ -375,7 +379,7 @@ public:
|
||||||
* Function SetVisibleAlls
|
* Function SetVisibleAlls
|
||||||
* Set the status of all visible element categories and layers to VISIBLE
|
* Set the status of all visible element categories and layers to VISIBLE
|
||||||
*/
|
*/
|
||||||
void SetVisibleAlls( );
|
void SetVisibleAlls();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ReFillLayerWidget
|
* Function ReFillLayerWidget
|
||||||
|
@ -384,12 +388,16 @@ public:
|
||||||
*/
|
*/
|
||||||
void ReFillLayerWidget();
|
void ReFillLayerWidget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Show3D_Frame
|
||||||
|
* displays the 3D view of current printed circuit board.
|
||||||
|
*/
|
||||||
void Show3D_Frame( wxCommandEvent& event );
|
void Show3D_Frame( wxCommandEvent& event );
|
||||||
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ShowDesignRulesEditor
|
* Function ShowDesignRulesEditor
|
||||||
* Display the Design Rules Editor.
|
* displays the Design Rules Editor.
|
||||||
*/
|
*/
|
||||||
void ShowDesignRulesEditor( wxCommandEvent& event );
|
void ShowDesignRulesEditor( wxCommandEvent& event );
|
||||||
|
|
||||||
|
@ -484,7 +492,7 @@ public:
|
||||||
virtual int ReturnBlockCommand( int aKey );
|
virtual int ReturnBlockCommand( int aKey );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HandleBlockPlace( )
|
* Function HandleBlockPlace()
|
||||||
* Called after HandleBlockEnd, when a block command needs to be
|
* Called after HandleBlockEnd, when a block command needs to be
|
||||||
* executed after the block is moved to its new place
|
* executed after the block is moved to its new place
|
||||||
* (bloc move, drag, copy .. )
|
* (bloc move, drag, copy .. )
|
||||||
|
@ -493,7 +501,7 @@ public:
|
||||||
virtual void HandleBlockPlace( wxDC* DC );
|
virtual void HandleBlockPlace( wxDC* DC );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HandleBlockEnd( )
|
* Function HandleBlockEnd()
|
||||||
* Handle the "end" of a block command,
|
* Handle the "end" of a block command,
|
||||||
* i.e. is called at the end of the definition of the area of a block.
|
* i.e. is called at the end of the definition of the area of a block.
|
||||||
* depending on the current block command, this command is executed
|
* depending on the current block command, this command is executed
|
||||||
|
@ -567,11 +575,16 @@ public:
|
||||||
void ToPostProcess( wxCommandEvent& event );
|
void ToPostProcess( wxCommandEvent& event );
|
||||||
|
|
||||||
void OnFileHistory( wxCommandEvent& event );
|
void OnFileHistory( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Files_io
|
||||||
|
* is the command event handler for read and write file commands.
|
||||||
|
*/
|
||||||
void Files_io( wxCommandEvent& event );
|
void Files_io( wxCommandEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LoadOnePcbFile
|
* Function LoadOnePcbFile
|
||||||
* Load a Kicad board (.brd) file.
|
* loads a Kicad board (.brd) from \a aFileName.
|
||||||
*
|
*
|
||||||
* @param aFileName - File name including path. If empty, a file dialog will
|
* @param aFileName - File name including path. If empty, a file dialog will
|
||||||
* be displayed.
|
* be displayed.
|
||||||
|
@ -595,7 +608,16 @@ public:
|
||||||
*/
|
*/
|
||||||
int ReadPcbFile( LINE_READER* aReader, bool Append );
|
int ReadPcbFile( LINE_READER* aReader, bool Append );
|
||||||
|
|
||||||
bool SavePcbFile( const wxString& FileName );
|
/**
|
||||||
|
* Function SavePcbFile
|
||||||
|
* writes the board data structures to \a a aFileName
|
||||||
|
*
|
||||||
|
* @param aFileName The file name to write or wxEmptyString to prompt user for
|
||||||
|
* file name.
|
||||||
|
* @return True if file was saved successfully.
|
||||||
|
*/
|
||||||
|
bool SavePcbFile( const wxString& aFileName );
|
||||||
|
|
||||||
int SavePcbFormatAscii( FILE* File );
|
int SavePcbFormatAscii( FILE* File );
|
||||||
bool WriteGeneralDescrPcb( FILE* File );
|
bool WriteGeneralDescrPcb( FILE* File );
|
||||||
|
|
||||||
|
@ -643,7 +665,7 @@ public:
|
||||||
* @param aFullFileName = the full filename of the file to create
|
* @param aFullFileName = the full filename of the file to create
|
||||||
* @param aScale = the general scaling factor. 1.0 to export in inches
|
* @param aScale = the general scaling factor. 1.0 to export in inches
|
||||||
* @param aExport3DFiles = true to copy 3D shapes in the subir a3D_Subdir
|
* @param aExport3DFiles = true to copy 3D shapes in the subir a3D_Subdir
|
||||||
* @param a3D_Subdir = sub directory where 3D sahpes files are copied
|
* @param a3D_Subdir = sub directory where 3D shapes files are copied
|
||||||
* used only when aExport3DFiles == true
|
* used only when aExport3DFiles == true
|
||||||
* @return true if Ok.
|
* @return true if Ok.
|
||||||
*/
|
*/
|
||||||
|
@ -761,11 +783,15 @@ public:
|
||||||
// Track and via edition:
|
// Track and via edition:
|
||||||
void Via_Edit_Control( wxCommandEvent& event );
|
void Via_Edit_Control( wxCommandEvent& event );
|
||||||
|
|
||||||
/* Return true if a microvia can be put on board
|
/**
|
||||||
|
* Function IsMicroViaAcceptable
|
||||||
|
* return true if a microvia can be placed on the board.
|
||||||
|
* <p>
|
||||||
* A microvia is a small via restricted to 2 near neighbor layers
|
* A microvia is a small via restricted to 2 near neighbor layers
|
||||||
* because its is hole is made by laser which can penetrate only one layer
|
* because its is hole is made by laser which can penetrate only one layer
|
||||||
* It is mainly used to connect BGA to the first inner layer
|
* It is mainly used to connect BGA to the first inner layer
|
||||||
* And it is allowed from an external layer to the first inner layer
|
* And it is allowed from an external layer to the first inner layer
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
bool IsMicroViaAcceptable( void );
|
bool IsMicroViaAcceptable( void );
|
||||||
|
|
||||||
|
@ -1158,6 +1184,17 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void SetLanguage( wxCommandEvent& event );
|
virtual void SetLanguage( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function UpdateTitle
|
||||||
|
* sets the main window title bar text.
|
||||||
|
* <p>
|
||||||
|
* If file name defined by PCB_SCREEN::m_FileName is not set, the title is set to the
|
||||||
|
* application name appended with no file. Otherwise, the title is set to the full path
|
||||||
|
* and file name and read only is appended to the title if the user does not have write
|
||||||
|
* access to the file.
|
||||||
|
*/
|
||||||
|
void UpdateTitle();
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,7 @@ static void RotateMarkedItems( MODULE* module, wxPoint offset );
|
||||||
static void DeleteMarkedItems( MODULE* module );
|
static void DeleteMarkedItems( MODULE* module );
|
||||||
|
|
||||||
|
|
||||||
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
|
int FOOTPRINT_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||||
* the key (ALT, SHIFT ALT ..) pressed when dragging mouse and left or
|
|
||||||
* middle button pressed
|
|
||||||
*/
|
|
||||||
int WinEDA_ModuleEditFrame::ReturnBlockCommand( int key )
|
|
||||||
{
|
{
|
||||||
int cmd;
|
int cmd;
|
||||||
|
|
||||||
|
@ -83,17 +79,7 @@ int WinEDA_ModuleEditFrame::ReturnBlockCommand( int key )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
* Function HandleBlockEnd( )
|
|
||||||
* Handle the "end" of a block command,
|
|
||||||
* i.e. is called at the end of the definition of the area of a block.
|
|
||||||
* depending on the current block command, this command is executed
|
|
||||||
* or parameters are initialized to prepare a call to HandleBlockPlace
|
|
||||||
* in GetScreen()->m_BlockLocate
|
|
||||||
* @return false if no item selected, or command finished,
|
|
||||||
* true if some items found and HandleBlockPlace must be called later
|
|
||||||
*/
|
|
||||||
bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
|
||||||
{
|
{
|
||||||
int itemsCount = 0;
|
int itemsCount = 0;
|
||||||
bool nextcmd = false;
|
bool nextcmd = false;
|
||||||
|
@ -121,8 +107,8 @@ bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
case BLOCK_MOVE: /* Move */
|
case BLOCK_MOVE: /* Move */
|
||||||
case BLOCK_COPY: /* Copy */
|
case BLOCK_COPY: /* Copy */
|
||||||
itemsCount = MarkItemsInBloc( currentModule,
|
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
||||||
GetScreen()->m_BlockLocate );
|
|
||||||
if( itemsCount )
|
if( itemsCount )
|
||||||
{
|
{
|
||||||
nextcmd = true;
|
nextcmd = true;
|
||||||
|
@ -147,8 +133,10 @@ bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
||||||
|
|
||||||
case BLOCK_DELETE: /* Delete */
|
case BLOCK_DELETE: /* Delete */
|
||||||
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
||||||
|
|
||||||
if( itemsCount )
|
if( itemsCount )
|
||||||
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
||||||
|
|
||||||
DeleteMarkedItems( currentModule );
|
DeleteMarkedItems( currentModule );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -158,8 +146,10 @@ bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
||||||
|
|
||||||
case BLOCK_ROTATE:
|
case BLOCK_ROTATE:
|
||||||
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
||||||
|
|
||||||
if( itemsCount )
|
if( itemsCount )
|
||||||
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
||||||
|
|
||||||
RotateMarkedItems( currentModule, GetScreen()->m_BlockLocate.Centre() );
|
RotateMarkedItems( currentModule, GetScreen()->m_BlockLocate.Centre() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -168,8 +158,10 @@ bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
||||||
case BLOCK_MIRROR_Y:
|
case BLOCK_MIRROR_Y:
|
||||||
case BLOCK_FLIP: /* mirror */
|
case BLOCK_FLIP: /* mirror */
|
||||||
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate );
|
||||||
|
|
||||||
if( itemsCount )
|
if( itemsCount )
|
||||||
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
||||||
|
|
||||||
MirrorMarkedItems( currentModule, GetScreen()->m_BlockLocate.Centre() );
|
MirrorMarkedItems( currentModule, GetScreen()->m_BlockLocate.Centre() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -202,15 +194,7 @@ bool WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
void WinEDA_ModuleEditFrame::HandleBlockPlace( wxDC* DC )
|
|
||||||
/******************************************************/
|
|
||||||
|
|
||||||
/* Routine to handle the BLOCK PLACE command
|
|
||||||
* Last routine for block operation for:
|
|
||||||
* - block move & drag
|
|
||||||
* - block copy & paste
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
MODULE* currentModule = GetBoard()->m_Modules;
|
MODULE* currentModule = GetBoard()->m_Modules;
|
||||||
|
|
||||||
|
@ -326,6 +310,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
{
|
{
|
||||||
if( pad->m_Selected == 0 )
|
if( pad->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pad->Draw( aPanel, aDC, g_XorMode, move_offset );
|
pad->Draw( aPanel, aDC, g_XorMode, move_offset );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,15 +419,18 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D_PAD* pad = module->m_Pads;
|
D_PAD* pad = module->m_Pads;
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->m_Selected == 0 )
|
if( pad->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pad->SetPosition( pad->GetPosition() + offset );
|
pad->SetPosition( pad->GetPosition() + offset );
|
||||||
pad->m_Pos0 += offset;
|
pad->m_Pos0 += offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( item->m_Selected == 0 )
|
if( item->m_Selected == 0 )
|
||||||
|
@ -485,20 +473,26 @@ void DeleteMarkedItems( MODULE* module )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pad = module->m_Pads;
|
pad = module->m_Pads;
|
||||||
|
|
||||||
for( ; pad != NULL; pad = next_pad )
|
for( ; pad != NULL; pad = next_pad )
|
||||||
{
|
{
|
||||||
next_pad = pad->Next();
|
next_pad = pad->Next();
|
||||||
|
|
||||||
if( pad->m_Selected == 0 )
|
if( pad->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pad->DeleteStructure();
|
pad->DeleteStructure();
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = next_item )
|
for( ; item != NULL; item = next_item )
|
||||||
{
|
{
|
||||||
next_item = item->Next();
|
next_item = item->Next();
|
||||||
|
|
||||||
if( item->m_Selected == 0 )
|
if( item->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
item->DeleteStructure();
|
item->DeleteStructure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,10 +509,12 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D_PAD* pad = module->m_Pads;
|
D_PAD* pad = module->m_Pads;
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->m_Selected == 0 )
|
if( pad->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SETMIRROR( pad->GetPosition().x );
|
SETMIRROR( pad->GetPosition().x );
|
||||||
pad->m_Pos0.x = pad->GetPosition().x;
|
pad->m_Pos0.x = pad->GetPosition().x;
|
||||||
NEGATE( pad->m_Offset.x );
|
NEGATE( pad->m_Offset.x );
|
||||||
|
@ -528,6 +524,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( item->m_Selected == 0 )
|
if( item->m_Selected == 0 )
|
||||||
|
@ -536,7 +533,8 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
case TYPE_EDGE_MODULE:
|
case TYPE_EDGE_MODULE:
|
||||||
{ EDGE_MODULE * edge = (EDGE_MODULE*) item;
|
{
|
||||||
|
EDGE_MODULE * edge = (EDGE_MODULE*) item;
|
||||||
SETMIRROR( edge->m_Start.x );
|
SETMIRROR( edge->m_Start.x );
|
||||||
edge->m_Start0.x = edge->m_Start.x;
|
edge->m_Start0.x = edge->m_Start.x;
|
||||||
SETMIRROR( edge->m_End.x );
|
SETMIRROR( edge->m_End.x );
|
||||||
|
@ -547,8 +545,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
|
||||||
|
|
||||||
case TYPE_TEXTE_MODULE:
|
case TYPE_TEXTE_MODULE:
|
||||||
SETMIRROR( ( (TEXTE_MODULE*) item )->GetPosition().x );
|
SETMIRROR( ( (TEXTE_MODULE*) item )->GetPosition().x );
|
||||||
( (TEXTE_MODULE*) item )->m_Pos0.x =
|
( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->GetPosition().x;
|
||||||
( (TEXTE_MODULE*) item )->GetPosition().x;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -572,10 +569,12 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D_PAD* pad = module->m_Pads;
|
D_PAD* pad = module->m_Pads;
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->m_Selected == 0 )
|
if( pad->m_Selected == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ROTATE( pad->GetPosition() );
|
ROTATE( pad->GetPosition() );
|
||||||
pad->m_Pos0 = pad->GetPosition();
|
pad->m_Pos0 = pad->GetPosition();
|
||||||
pad->m_Orient += 900;
|
pad->m_Orient += 900;
|
||||||
|
@ -583,6 +582,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( item->m_Selected == 0 )
|
if( item->m_Selected == 0 )
|
||||||
|
@ -592,16 +592,14 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
|
||||||
{
|
{
|
||||||
case TYPE_EDGE_MODULE:
|
case TYPE_EDGE_MODULE:
|
||||||
ROTATE( ( (EDGE_MODULE*) item )->m_Start );
|
ROTATE( ( (EDGE_MODULE*) item )->m_Start );
|
||||||
( (EDGE_MODULE*) item )->m_Start0 =
|
( (EDGE_MODULE*) item )->m_Start0 = ( (EDGE_MODULE*) item )->m_Start;
|
||||||
( (EDGE_MODULE*) item )->m_Start;
|
|
||||||
ROTATE( ( (EDGE_MODULE*) item )->m_End );
|
ROTATE( ( (EDGE_MODULE*) item )->m_End );
|
||||||
( (EDGE_MODULE*) item )->m_End0 = ( (EDGE_MODULE*) item )->m_End;
|
( (EDGE_MODULE*) item )->m_End0 = ( (EDGE_MODULE*) item )->m_End;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_TEXTE_MODULE:
|
case TYPE_TEXTE_MODULE:
|
||||||
ROTATE( ( (TEXTE_MODULE*) item )->GetPosition() );
|
ROTATE( ( (TEXTE_MODULE*) item )->GetPosition() );
|
||||||
( (TEXTE_MODULE*) item )->m_Pos0 =
|
( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->GetPosition();
|
||||||
( (TEXTE_MODULE*) item )->GetPosition();
|
|
||||||
( (TEXTE_MODULE*) item )->m_Orient += 900;
|
( (TEXTE_MODULE*) item )->m_Orient += 900;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -622,10 +620,12 @@ void ClearMarkItems( MODULE* module )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
item->m_Flags = item->m_Selected = 0;
|
item->m_Flags = item->m_Selected = 0;
|
||||||
|
|
||||||
item = module->m_Pads;
|
item = module->m_Pads;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
item->m_Flags = item->m_Selected = 0;
|
item->m_Flags = item->m_Selected = 0;
|
||||||
}
|
}
|
||||||
|
@ -645,10 +645,12 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pad = module->m_Pads;
|
pad = module->m_Pads;
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
pad->m_Selected = 0;
|
pad->m_Selected = 0;
|
||||||
pos = pad->GetPosition();
|
pos = pad->GetPosition();
|
||||||
|
|
||||||
if( Rect.Contains( pos ) )
|
if( Rect.Contains( pos ) )
|
||||||
{
|
{
|
||||||
pad->m_Selected = IS_SELECTED;
|
pad->m_Selected = IS_SELECTED;
|
||||||
|
@ -657,6 +659,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->m_Drawings;
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
item->m_Selected = 0;
|
item->m_Selected = 0;
|
||||||
|
@ -669,15 +672,18 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
item->m_Selected = IS_SELECTED;
|
item->m_Selected = IS_SELECTED;
|
||||||
ItemsCount++;
|
ItemsCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_TEXTE_MODULE:
|
case TYPE_TEXTE_MODULE:
|
||||||
pos = ( (TEXTE_MODULE*) item )->GetPosition();
|
pos = ( (TEXTE_MODULE*) item )->GetPosition();
|
||||||
|
|
||||||
if( Rect.Contains( pos ) )
|
if( Rect.Contains( pos ) )
|
||||||
{
|
{
|
||||||
item->m_Selected = IS_SELECTED;
|
item->m_Selected = IS_SELECTED;
|
||||||
ItemsCount++;
|
ItemsCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -24,22 +24,19 @@
|
||||||
|
|
||||||
FOOTPRINT_LIBRARY::FOOTPRINT_LIBRARY( FILE * aFile, FILTER_READER * aReader )
|
FOOTPRINT_LIBRARY::FOOTPRINT_LIBRARY( FILE * aFile, FILTER_READER * aReader )
|
||||||
{
|
{
|
||||||
wxASSERT( m_reader || m_file );
|
wxASSERT( aFile != NULL );
|
||||||
|
|
||||||
m_file = aFile;
|
m_file = aFile;
|
||||||
m_reader = aReader;
|
m_reader = aReader;
|
||||||
m_LineNum = 0;
|
m_LineNum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* function IsLibrary
|
|
||||||
* Read the library file Header
|
|
||||||
* return > 0 if this file is a footprint lib
|
|
||||||
* (currentlu return 1 but could be a value > 1 for future file formats
|
|
||||||
*/
|
|
||||||
int FOOTPRINT_LIBRARY::IsLibrary( )
|
int FOOTPRINT_LIBRARY::IsLibrary( )
|
||||||
{
|
{
|
||||||
char *line;
|
char *line;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
|
|
||||||
if( m_reader )
|
if( m_reader )
|
||||||
{
|
{
|
||||||
m_reader->ReadLine();
|
m_reader->ReadLine();
|
||||||
|
@ -52,6 +49,7 @@ int FOOTPRINT_LIBRARY::IsLibrary( )
|
||||||
}
|
}
|
||||||
|
|
||||||
StrPurge( line );
|
StrPurge( line );
|
||||||
|
|
||||||
if( strnicmp( line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) == 0 )
|
if( strnicmp( line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) == 0 )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -59,11 +57,6 @@ int FOOTPRINT_LIBRARY::IsLibrary( )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* function RebuildIndex
|
|
||||||
* Read the full library file and build the list od footprints found
|
|
||||||
* and do not use the $INDEX ... $EndINDEX section
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::RebuildIndex()
|
bool FOOTPRINT_LIBRARY::RebuildIndex()
|
||||||
{
|
{
|
||||||
m_List.Clear();
|
m_List.Clear();
|
||||||
|
@ -76,6 +69,7 @@ bool FOOTPRINT_LIBRARY::RebuildIndex()
|
||||||
{
|
{
|
||||||
char * line = m_reader->Line();
|
char * line = m_reader->Line();
|
||||||
StrPurge( line );
|
StrPurge( line );
|
||||||
|
|
||||||
if( strnicmp( line, "$MODULE", 7 ) == 0 )
|
if( strnicmp( line, "$MODULE", 7 ) == 0 )
|
||||||
{
|
{
|
||||||
sscanf( line + 7, " %s", name );
|
sscanf( line + 7, " %s", name );
|
||||||
|
@ -86,6 +80,7 @@ bool FOOTPRINT_LIBRARY::RebuildIndex()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char line[1024];
|
char line[1024];
|
||||||
|
|
||||||
while( GetLine( m_file, line, &m_LineNum ) )
|
while( GetLine( m_file, line, &m_LineNum ) )
|
||||||
{
|
{
|
||||||
if( strnicmp( line, "$MODULE", 7 ) == 0 )
|
if( strnicmp( line, "$MODULE", 7 ) == 0 )
|
||||||
|
@ -99,29 +94,30 @@ bool FOOTPRINT_LIBRARY::RebuildIndex()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* function ReadSectionIndex
|
|
||||||
* Read the $INDEX ... $EndINDEX section
|
|
||||||
* list of footprints is stored in m_List
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::ReadSectionIndex()
|
bool FOOTPRINT_LIBRARY::ReadSectionIndex()
|
||||||
{
|
{
|
||||||
// Some broken INDEX sections have more than one section
|
// Some broken INDEX sections have more than one section
|
||||||
// So we must read the next line after $EndINDEX tag,
|
// So we must read the next line after $EndINDEX tag,
|
||||||
// to see if this is not a new $INDEX tag.
|
// to see if this is not a new $INDEX tag.
|
||||||
bool exit = false;
|
bool exit = false;
|
||||||
|
|
||||||
if( m_reader )
|
if( m_reader )
|
||||||
{
|
{
|
||||||
while( m_reader->ReadLine() )
|
while( m_reader->ReadLine() )
|
||||||
{
|
{
|
||||||
char * line = m_reader->Line();
|
char * line = m_reader->Line();
|
||||||
StrPurge( line );
|
StrPurge( line );
|
||||||
|
|
||||||
if( strnicmp( line, "$INDEX", 6 ) == 0 )
|
if( strnicmp( line, "$INDEX", 6 ) == 0 )
|
||||||
{
|
{
|
||||||
exit = false;
|
exit = false;
|
||||||
|
|
||||||
while( m_reader->ReadLine() )
|
while( m_reader->ReadLine() )
|
||||||
{
|
{
|
||||||
StrPurge( line );
|
StrPurge( line );
|
||||||
m_List.Add( FROM_UTF8( line ) );
|
m_List.Add( FROM_UTF8( line ) );
|
||||||
|
|
||||||
if( strnicmp( line, "$EndINDEX", 9 ) == 0 )
|
if( strnicmp( line, "$EndINDEX", 9 ) == 0 )
|
||||||
{
|
{
|
||||||
exit = true;
|
exit = true;
|
||||||
|
@ -136,15 +132,18 @@ bool FOOTPRINT_LIBRARY::ReadSectionIndex()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char line[1024];
|
char line[1024];
|
||||||
|
|
||||||
while( GetLine( m_file, line, &m_LineNum ) )
|
while( GetLine( m_file, line, &m_LineNum ) )
|
||||||
{
|
{
|
||||||
if( strnicmp( line, "$INDEX", 6 ) == 0 )
|
if( strnicmp( line, "$INDEX", 6 ) == 0 )
|
||||||
{
|
{
|
||||||
exit = false;
|
exit = false;
|
||||||
|
|
||||||
while( GetLine( m_file, line, &m_LineNum ) )
|
while( GetLine( m_file, line, &m_LineNum ) )
|
||||||
{
|
{
|
||||||
StrPurge( line );
|
StrPurge( line );
|
||||||
m_List.Add( FROM_UTF8( line ) );
|
m_List.Add( FROM_UTF8( line ) );
|
||||||
|
|
||||||
if( strnicmp( line, "$EndINDEX", 9 ) == 0 )
|
if( strnicmp( line, "$EndINDEX", 9 ) == 0 )
|
||||||
{
|
{
|
||||||
exit = true;
|
exit = true;
|
||||||
|
@ -153,16 +152,16 @@ bool FOOTPRINT_LIBRARY::ReadSectionIndex()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( exit )
|
else if( exit )
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function WriteHeader
|
|
||||||
* Write the library header
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::WriteHeader()
|
bool FOOTPRINT_LIBRARY::WriteHeader()
|
||||||
{
|
{
|
||||||
char line[256];
|
char line[256];
|
||||||
|
@ -171,34 +170,28 @@ bool FOOTPRINT_LIBRARY::WriteHeader()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function WriteSectionIndex
|
|
||||||
* Write the $INDEX ... $EndINDEX section.
|
|
||||||
* This section is filled by names in m_List
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::WriteSectionIndex()
|
bool FOOTPRINT_LIBRARY::WriteSectionIndex()
|
||||||
{
|
{
|
||||||
fputs( "$INDEX\n", m_file );
|
fputs( "$INDEX\n", m_file );
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
fprintf( m_file, "%s\n", TO_UTF8( m_List[ii] ) );
|
fprintf( m_file, "%s\n", TO_UTF8( m_List[ii] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
fputs( "$EndINDEX\n", m_file );
|
fputs( "$EndINDEX\n", m_file );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function WriteEndOfFile
|
|
||||||
* Write the last line section.
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::WriteEndOfFile()
|
bool FOOTPRINT_LIBRARY::WriteEndOfFile()
|
||||||
{
|
{
|
||||||
fputs( "$EndLIBRARY\n", m_file );
|
fputs( "$EndLIBRARY\n", m_file );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Function FindInList
|
|
||||||
* Search for aName int m_List and return true if found
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::FindInList( const wxString & aName )
|
bool FOOTPRINT_LIBRARY::FindInList( const wxString & aName )
|
||||||
{
|
{
|
||||||
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
||||||
|
@ -210,11 +203,7 @@ bool FOOTPRINT_LIBRARY::FindInList( const wxString & aName )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Function RemoveFromList
|
|
||||||
* Search for aName int m_List and remove it
|
|
||||||
* @return true if found and removed
|
|
||||||
*/
|
|
||||||
bool FOOTPRINT_LIBRARY::RemoveFromList( const wxString & aName )
|
bool FOOTPRINT_LIBRARY::RemoveFromList( const wxString & aName )
|
||||||
{
|
{
|
||||||
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
for( unsigned ii = 0; ii < m_List.GetCount(); ii++ )
|
||||||
|
@ -229,10 +218,7 @@ bool FOOTPRINT_LIBRARY::RemoveFromList( const wxString & aName )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SortList
|
|
||||||
* Sort m_List in alphabetic order
|
|
||||||
*/
|
|
||||||
void FOOTPRINT_LIBRARY::SortList()
|
void FOOTPRINT_LIBRARY::SortList()
|
||||||
{
|
{
|
||||||
m_List.Sort();
|
m_List.Sort();
|
||||||
|
|
|
@ -14,7 +14,7 @@ public:
|
||||||
int m_LineNum; // the line count
|
int m_LineNum; // the line count
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILTER_READER * m_reader; // FILTER_READER to read file. id NULL, use m_file
|
FILTER_READER * m_reader; // FILTER_READER to read file. If NULL, use m_file
|
||||||
FILE * m_file; // footprint file to read/write.
|
FILE * m_file; // footprint file to read/write.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -23,7 +23,7 @@ public:
|
||||||
* @param aFile = a FILE * pointer used for write operations,
|
* @param aFile = a FILE * pointer used for write operations,
|
||||||
* and read operations when aReader = NULL
|
* and read operations when aReader = NULL
|
||||||
* @param aReader = a FILTER_READER pointer used for read operations
|
* @param aReader = a FILTER_READER pointer used for read operations
|
||||||
* If NULL, a direct aFILE read is used
|
* If NULL, a direct aFile read is used
|
||||||
*/
|
*/
|
||||||
FOOTPRINT_LIBRARY( FILE * aFile, FILTER_READER * aReader = NULL );
|
FOOTPRINT_LIBRARY( FILE * aFile, FILTER_READER * aReader = NULL );
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function RebuildIndex
|
* function RebuildIndex
|
||||||
* Read the full library file and build the list od footprints found
|
* Read the full library file and build the list of footprints found
|
||||||
* Do not use the $INDEX ... $EndINDEX section
|
* Do not use the $INDEX ... $EndINDEX section
|
||||||
*/
|
*/
|
||||||
bool RebuildIndex();
|
bool RebuildIndex();
|
||||||
|
|
|
@ -143,7 +143,9 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
|
||||||
ii--;
|
ii--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
timestampzone = item->m_TimeStamp;
|
timestampzone = item->m_TimeStamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_Collector->GetCount() <= 1 )
|
if( m_Collector->GetCount() <= 1 )
|
||||||
|
@ -152,7 +154,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the count is 2, and first item is a pad or moduletext, and the 2nd item is its
|
// If the count is 2, and first item is a pad or module text, and the 2nd item is its
|
||||||
// parent module:
|
// parent module:
|
||||||
else if( m_Collector->GetCount() == 2
|
else if( m_Collector->GetCount() == 2
|
||||||
&& ( (*m_Collector)[0]->Type() == TYPE_PAD || (*m_Collector)[0]->Type() ==
|
&& ( (*m_Collector)[0]->Type() == TYPE_PAD || (*m_Collector)[0]->Type() ==
|
||||||
|
@ -259,7 +261,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->SetFileName( tmpFileName );
|
GetScreen()->SetFileName( tmpFileName );
|
||||||
SetTitle( GetScreen()->GetFileName() );
|
UpdateTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
oldpos = GetScreen()->GetCrossHairPosition();
|
oldpos = GetScreen()->GetCrossHairPosition();
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "dialog_edit_module_for_Modedit.h"
|
#include "dialog_edit_module_for_Modedit.h"
|
||||||
|
|
||||||
|
|
||||||
DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( WinEDA_ModuleEditFrame* aParent,
|
DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( FOOTPRINT_EDIT_FRAME* aParent,
|
||||||
MODULE* aModule ) :
|
MODULE* aModule ) :
|
||||||
DIALOG_MODULE_MODULE_EDITOR_BASE( aParent )
|
DIALOG_MODULE_MODULE_EDITOR_BASE( aParent )
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ class DIALOG_MODULE_MODULE_EDITOR : public DIALOG_MODULE_MODULE_EDITOR_BASE
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
WinEDA_ModuleEditFrame* m_Parent;
|
FOOTPRINT_EDIT_FRAME* m_Parent;
|
||||||
MODULE* m_CurrentModule;
|
MODULE* m_CurrentModule;
|
||||||
TEXTE_MODULE* m_ReferenceCopy;
|
TEXTE_MODULE* m_ReferenceCopy;
|
||||||
TEXTE_MODULE* m_ValueCopy;
|
TEXTE_MODULE* m_ValueCopy;
|
||||||
|
@ -30,7 +30,7 @@ private:
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructor and destructor
|
// Constructor and destructor
|
||||||
DIALOG_MODULE_MODULE_EDITOR( WinEDA_ModuleEditFrame* aParent, MODULE* aModule );
|
DIALOG_MODULE_MODULE_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, MODULE* aModule );
|
||||||
~DIALOG_MODULE_MODULE_EDITOR();
|
~DIALOG_MODULE_MODULE_EDITOR();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -25,7 +25,7 @@ void PCB_EDIT_FRAME::OnConfigurePcbOptions( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos )
|
void FOOTPRINT_EDIT_FRAME::InstallOptionsFrame( const wxPoint& pos )
|
||||||
{
|
{
|
||||||
DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this );
|
DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this );
|
||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
|
|
|
@ -56,7 +56,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************/
|
/*************************************************************/
|
||||||
void WinEDA_ModuleEditFrame::ToPrinter( wxCommandEvent& event )
|
void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event )
|
||||||
/*************************************************************/
|
/*************************************************************/
|
||||||
/* Virtual function:
|
/* Virtual function:
|
||||||
* Display the print dialog
|
* Display the print dialog
|
||||||
|
|
|
@ -20,21 +20,17 @@
|
||||||
|
|
||||||
|
|
||||||
static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
||||||
bool erase );
|
bool erase );
|
||||||
static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC );
|
static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC );
|
||||||
static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||||
bool aErase );
|
const wxPoint& aPosition, bool aErase );
|
||||||
|
|
||||||
int ArcValue = 900;
|
int ArcValue = 900;
|
||||||
static wxPoint MoveVector; // Move vector for move edge
|
static wxPoint MoveVector; // Move vector for move edge
|
||||||
static wxPoint CursorInitialPosition; // Mouse cursor inital position for
|
static wxPoint CursorInitialPosition; // Mouse cursor initial position for move command
|
||||||
// move command
|
|
||||||
|
|
||||||
|
|
||||||
/* Function to initialise the move function params of a graphic item type
|
void FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
|
||||||
* DRAWSEGMENT
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
|
|
||||||
{
|
{
|
||||||
if( Edge == NULL )
|
if( Edge == NULL )
|
||||||
return;
|
return;
|
||||||
|
@ -49,10 +45,7 @@ void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
void FOOTPRINT_EDIT_FRAME::Place_EdgeMod( EDGE_MODULE* Edge )
|
||||||
* Function to place a graphic item type EDGE_MODULE currently moved
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge )
|
|
||||||
{
|
{
|
||||||
if( Edge == NULL )
|
if( Edge == NULL )
|
||||||
return;
|
return;
|
||||||
|
@ -75,7 +68,8 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge )
|
||||||
/* Redraw the current moved graphic item when mouse is moving
|
/* Redraw the current moved graphic item when mouse is moving
|
||||||
* Use this function to show an existing outline, in move command
|
* Use this function to show an existing outline, in move command
|
||||||
*/
|
*/
|
||||||
static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase )
|
static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||||
|
const wxPoint& aPosition, bool aErase )
|
||||||
{
|
{
|
||||||
BASE_SCREEN* screen = aPanel->GetScreen();
|
BASE_SCREEN* screen = aPanel->GetScreen();
|
||||||
EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem();
|
EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem();
|
||||||
|
@ -102,7 +96,7 @@ static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC, co
|
||||||
* Use this function to show a new outline, in begin command
|
* Use this function to show a new outline, in begin command
|
||||||
*/
|
*/
|
||||||
static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
||||||
bool aErase )
|
bool aErase )
|
||||||
{
|
{
|
||||||
BASE_SCREEN* screen = aPanel->GetScreen();
|
BASE_SCREEN* screen = aPanel->GetScreen();
|
||||||
EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem();
|
EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem();
|
||||||
|
@ -129,14 +123,7 @@ static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
* Function Edit_Edge_Width
|
|
||||||
* changes the width of module perimeter lines, EDGE_MODULEs.
|
|
||||||
* param ModuleSegmentWidth (global) = new width
|
|
||||||
* @param aEdge = edge to edit, or NULL. If aEdge == NULL change
|
|
||||||
* the width of all footprint's edges
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* aEdge )
|
|
||||||
{
|
{
|
||||||
MODULE* Module = GetBoard()->m_Modules;
|
MODULE* Module = GetBoard()->m_Modules;
|
||||||
|
|
||||||
|
@ -161,12 +148,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Change the EDGE_MODULE Edge layer, (The new layer will be asked)
|
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* Edge )
|
||||||
* if Edge == NULL change the layer of the entire footprint edges
|
|
||||||
* @param Edge = edge to edit, or NULL
|
|
||||||
* @param DC = current Device Context
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
|
|
||||||
{
|
{
|
||||||
MODULE* Module = GetBoard()->m_Modules;
|
MODULE* Module = GetBoard()->m_Modules;
|
||||||
int new_layer = SILKSCREEN_N_FRONT;
|
int new_layer = SILKSCREEN_N_FRONT;
|
||||||
|
@ -176,9 +158,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
|
||||||
|
|
||||||
|
|
||||||
/* Ask for the new layer */
|
/* Ask for the new layer */
|
||||||
new_layer = SelectLayer( new_layer,
|
new_layer = SelectLayer( new_layer, FIRST_COPPER_LAYER, LAST_NO_COPPER_LAYER );
|
||||||
FIRST_COPPER_LAYER,
|
|
||||||
LAST_NO_COPPER_LAYER );
|
|
||||||
if( new_layer < 0 )
|
if( new_layer < 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -196,15 +176,19 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
|
||||||
if( Edge == NULL )
|
if( Edge == NULL )
|
||||||
{
|
{
|
||||||
Edge = (EDGE_MODULE*) (BOARD_ITEM*) Module->m_Drawings;
|
Edge = (EDGE_MODULE*) (BOARD_ITEM*) Module->m_Drawings;
|
||||||
|
|
||||||
for( ; Edge != NULL; Edge = Edge->Next() )
|
for( ; Edge != NULL; Edge = Edge->Next() )
|
||||||
{
|
{
|
||||||
if( Edge->Type() != TYPE_EDGE_MODULE )
|
if( Edge->Type() != TYPE_EDGE_MODULE )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Edge->SetLayer( new_layer );
|
Edge->SetLayer( new_layer );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Edge->SetLayer( new_layer );
|
Edge->SetLayer( new_layer );
|
||||||
|
}
|
||||||
|
|
||||||
OnModify();
|
OnModify();
|
||||||
Module->Set_Rectangle_Encadrement();
|
Module->Set_Rectangle_Encadrement();
|
||||||
|
@ -212,23 +196,16 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::Enter_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
* Function Enter_Edge_Width
|
|
||||||
* Edition of width of module outlines
|
|
||||||
* Ask for a new width.
|
|
||||||
* Change the width of EDGE_MODULE aEdge if aEdge != NULL
|
|
||||||
* @param aEdge = edge to edit, or NULL
|
|
||||||
* changes g_ModuleSegmentWidth (global) = new width
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* aEdge )
|
|
||||||
{
|
{
|
||||||
wxString buffer;
|
wxString buffer;
|
||||||
|
|
||||||
buffer = ReturnStringFromValue( g_UserUnit, g_ModuleSegmentWidth,
|
buffer = ReturnStringFromValue( g_UserUnit, g_ModuleSegmentWidth,
|
||||||
GetScreen()->GetInternalUnits() );
|
GetScreen()->GetInternalUnits() );
|
||||||
wxTextEntryDialog dlg( this, _( "New Width:" ), _( "Edge Width" ), buffer );
|
wxTextEntryDialog dlg( this, _( "New Width:" ), _( "Edge Width" ), buffer );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return; // cancelled by user
|
return; // canceled by user
|
||||||
|
|
||||||
buffer = dlg.GetValue( );
|
buffer = dlg.GetValue( );
|
||||||
g_ModuleSegmentWidth = ReturnValueFromString( g_UserUnit, buffer,
|
g_ModuleSegmentWidth = ReturnValueFromString( g_UserUnit, buffer,
|
||||||
|
@ -244,19 +221,14 @@ void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module( EDGE_MODULE* Edge )
|
||||||
* Function Delete_Edge_Module
|
|
||||||
* delete EDGE_MODULE Edge
|
|
||||||
* @param Edge = edge to delete
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge )
|
|
||||||
{
|
{
|
||||||
if( Edge == NULL )
|
if( Edge == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( Edge->Type() != TYPE_EDGE_MODULE )
|
if( Edge->Type() != TYPE_EDGE_MODULE )
|
||||||
{
|
{
|
||||||
DisplayError( this,
|
DisplayError( this, wxT( "StructType error: TYPE_EDGE_MODULE expected" ) );
|
||||||
wxT( "StructType error: TYPE_EDGE_MODULE expected" ) );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,16 +271,9 @@ static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Create a new edge item (line, arc ..).
|
EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* Edge,
|
||||||
* @param Edge = if NULL: create new edge else terminate edge and create a
|
wxDC* DC,
|
||||||
* new edge
|
int type_edge )
|
||||||
* @param DC = current Device Context
|
|
||||||
* @param type_edge = S_SEGMENT,S_ARC ..
|
|
||||||
* @return the new created edge.
|
|
||||||
*/
|
|
||||||
EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
|
|
||||||
wxDC* DC,
|
|
||||||
int type_edge )
|
|
||||||
{
|
{
|
||||||
MODULE* module = GetBoard()->m_Modules;
|
MODULE* module = GetBoard()->m_Modules;
|
||||||
int angle = 0;
|
int angle = 0;
|
||||||
|
@ -339,16 +304,17 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
|
||||||
|
|
||||||
if( module->GetLayer() == LAYER_N_FRONT )
|
if( module->GetLayer() == LAYER_N_FRONT )
|
||||||
Edge->SetLayer( SILKSCREEN_N_FRONT );
|
Edge->SetLayer( SILKSCREEN_N_FRONT );
|
||||||
|
|
||||||
if( module->GetLayer() == LAYER_N_BACK )
|
if( module->GetLayer() == LAYER_N_BACK )
|
||||||
Edge->SetLayer( SILKSCREEN_N_BACK );
|
Edge->SetLayer( SILKSCREEN_N_BACK );
|
||||||
|
|
||||||
/* Initialise the starting point of the new segment or arc */
|
/* Initialize the starting point of the new segment or arc */
|
||||||
Edge->m_Start = GetScreen()->GetCrossHairPosition();
|
Edge->m_Start = GetScreen()->GetCrossHairPosition();
|
||||||
|
|
||||||
/* Initialise the ending point of the new segment or arc */
|
/* Initialize the ending point of the new segment or arc */
|
||||||
Edge->m_End = Edge->m_Start;
|
Edge->m_End = Edge->m_Start;
|
||||||
|
|
||||||
/* Initialise the relative coordinates */
|
/* Initialize the relative coordinates */
|
||||||
Edge->m_Start0 = Edge->m_Start - module->m_Pos;
|
Edge->m_Start0 = Edge->m_Start - module->m_Pos;
|
||||||
|
|
||||||
RotatePoint( &Edge->m_Start0, -module->m_Orient );
|
RotatePoint( &Edge->m_Start0, -module->m_Orient );
|
||||||
|
@ -360,7 +326,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
|
||||||
/* Segment creation in progress.
|
/* Segment creation in progress.
|
||||||
* The ending coordinate is updated by the function
|
* The ending coordinate is updated by the function
|
||||||
* ShowNewEdgeModule() called on move mouse event
|
* ShowNewEdgeModule() called on move mouse event
|
||||||
* during the segment craetion
|
* during the segment creation
|
||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -373,8 +339,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
|
||||||
EDGE_MODULE* newedge = new EDGE_MODULE( module );
|
EDGE_MODULE* newedge = new EDGE_MODULE( module );
|
||||||
newedge->Copy( Edge );
|
newedge->Copy( Edge );
|
||||||
|
|
||||||
// insert _after_ Edge, which is the same as inserting _before_
|
// insert _after_ Edge, which is the same as inserting before Edge->Next()
|
||||||
// Edge->Next()
|
|
||||||
module->m_Drawings.Insert( newedge, Edge->Next() );
|
module->m_Drawings.Insert( newedge, Edge->Next() );
|
||||||
Edge->m_Flags = 0;
|
Edge->m_Flags = 0;
|
||||||
|
|
||||||
|
@ -398,25 +363,28 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
wxMessageBox( wxT( "Begin_Edge() error" ) );
|
wxMessageBox( wxT( "Begin_Edge() error" ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Edge;
|
return Edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Terminate a move or create edge function
|
void FOOTPRINT_EDIT_FRAME::End_Edge_Module( EDGE_MODULE* Edge )
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::End_Edge_Module( EDGE_MODULE* Edge )
|
|
||||||
{
|
{
|
||||||
MODULE* Module = GetBoard()->m_Modules;
|
MODULE* Module = GetBoard()->m_Modules;
|
||||||
|
|
||||||
if( Edge )
|
if( Edge )
|
||||||
{
|
{
|
||||||
Edge->m_Flags = 0;
|
Edge->m_Flags = 0;
|
||||||
|
|
||||||
/* If last segment length is 0: remove it */
|
/* If last segment length is 0: remove it */
|
||||||
if( Edge->m_Start == Edge->m_End )
|
if( Edge->m_Start == Edge->m_End )
|
||||||
Edge->DeleteStructure();
|
Edge->DeleteStructure();
|
||||||
}
|
}
|
||||||
|
|
||||||
Module->Set_Rectangle_Encadrement();
|
Module->Set_Rectangle_Encadrement();
|
||||||
Module->m_LastEdit_Time = time( NULL );
|
Module->m_LastEdit_Time = time( NULL );
|
||||||
OnModify();
|
OnModify();
|
||||||
|
|
104
pcbnew/edit.cpp
104
pcbnew/edit.cpp
|
@ -158,11 +158,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_OPEN_MODULE_EDITOR:
|
case ID_OPEN_MODULE_EDITOR:
|
||||||
if( m_ModuleEditFrame == NULL )
|
if( m_ModuleEditFrame == NULL )
|
||||||
{
|
{
|
||||||
m_ModuleEditFrame =
|
m_ModuleEditFrame = new FOOTPRINT_EDIT_FRAME( this,
|
||||||
new WinEDA_ModuleEditFrame( this,
|
_( "Module Editor" ),
|
||||||
_( "Module Editor" ),
|
wxPoint( -1, -1 ),
|
||||||
wxPoint( -1, -1 ),
|
wxSize( 600, 400 ) );
|
||||||
wxSize( 600, 400 ) );
|
|
||||||
m_ModuleEditFrame->Show( true );
|
m_ModuleEditFrame->Show( true );
|
||||||
m_ModuleEditFrame->Zoom_Automatique( false );
|
m_ModuleEditFrame->Zoom_Automatique( false );
|
||||||
}
|
}
|
||||||
|
@ -170,6 +169,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( m_ModuleEditFrame->IsIconized() )
|
if( m_ModuleEditFrame->IsIconized() )
|
||||||
m_ModuleEditFrame->Iconize( false );
|
m_ModuleEditFrame->Iconize( false );
|
||||||
|
|
||||||
m_ModuleEditFrame->Raise();
|
m_ModuleEditFrame->Raise();
|
||||||
|
|
||||||
// Raising the window does not set the focus on Linux. This should work on
|
// Raising the window does not set the focus on Linux. This should work on
|
||||||
|
@ -273,12 +273,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
{
|
{
|
||||||
int type = GetCurItem()->Type();
|
int type = GetCurItem()->Type();
|
||||||
|
|
||||||
if( type == TYPE_TRACK || type == TYPE_VIA )
|
if( type == TYPE_TRACK || type == TYPE_VIA )
|
||||||
{
|
{
|
||||||
BOARD_CONNECTED_ITEM*item = (BOARD_CONNECTED_ITEM*) GetCurItem();
|
BOARD_CONNECTED_ITEM*item = (BOARD_CONNECTED_ITEM*) GetCurItem();
|
||||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS dlg( this, item->GetNet() );
|
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS dlg( this, item->GetNet() );
|
||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
break;
|
break;
|
||||||
|
@ -314,6 +316,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_PCB_PLACE_MICROVIA:
|
case ID_POPUP_PCB_PLACE_MICROVIA:
|
||||||
if( !IsMicroViaAcceptable() )
|
if( !IsMicroViaAcceptable() )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_PLACE_VIA:
|
case ID_POPUP_PCB_PLACE_VIA:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
if( GetCurItem()->m_Flags & IS_DRAGGED )
|
if( GetCurItem()->m_Flags & IS_DRAGGED )
|
||||||
|
@ -325,6 +328,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
int v_type = GetBoard()->GetBoardDesignSettings()->m_CurrentViaType;
|
int v_type = GetBoard()->GetBoardDesignSettings()->m_CurrentViaType;
|
||||||
if( id == ID_POPUP_PCB_PLACE_MICROVIA )
|
if( id == ID_POPUP_PCB_PLACE_MICROVIA )
|
||||||
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = VIA_MICROVIA; // place micro via and switch layer
|
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = VIA_MICROVIA; // place micro via and switch layer
|
||||||
|
|
||||||
Other_Layer_Route( (TRACK*) GetCurItem(), &dc );
|
Other_Layer_Route( (TRACK*) GetCurItem(), &dc );
|
||||||
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = v_type;
|
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = v_type;
|
||||||
|
|
||||||
|
@ -336,6 +340,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_PCB_DELETE_TRACKSEG:
|
case ID_POPUP_PCB_DELETE_TRACKSEG:
|
||||||
if( GetCurItem() == NULL )
|
if( GetCurItem() == NULL )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
SetCurItem( Delete_Segment( &dc, (TRACK*) GetCurItem() ) );
|
SetCurItem( Delete_Segment( &dc, (TRACK*) GetCurItem() ) );
|
||||||
OnModify();
|
OnModify();
|
||||||
|
@ -386,8 +391,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_DELETE_ZONE:
|
case ID_POPUP_PCB_DELETE_ZONE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( GetCurItem() == NULL )
|
if( GetCurItem() == NULL )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
{
|
||||||
SEGZONE* zsegm = (SEGZONE*) GetCurItem();
|
SEGZONE* zsegm = (SEGZONE*) GetCurItem();
|
||||||
int netcode = zsegm->GetNet();
|
int netcode = zsegm->GetNet();
|
||||||
|
@ -476,8 +483,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
* and start move the new corner
|
* and start move the new corner
|
||||||
*/
|
*/
|
||||||
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
|
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
|
||||||
zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection,
|
zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y );
|
||||||
pos.x, pos.y );
|
|
||||||
zone_cont->m_CornerSelection++;
|
zone_cont->m_CornerSelection++;
|
||||||
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
|
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
|
||||||
DrawPanel->m_AutoPAN_Request = true;
|
DrawPanel->m_AutoPAN_Request = true;
|
||||||
|
@ -519,6 +525,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones :
|
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones :
|
||||||
GetBoard()->m_Zone.DeleteAll(); // remove zone segments used to fill zones.
|
GetBoard()->m_Zone.DeleteAll(); // remove zone segments used to fill zones.
|
||||||
|
|
||||||
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
|
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
|
||||||
{
|
{
|
||||||
// Remove filled areas in zone
|
// Remove filled areas in zone
|
||||||
|
@ -526,9 +533,9 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
zone_container->m_FilledPolysList.clear();
|
zone_container->m_FilledPolysList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer
|
SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer
|
||||||
test_connexions( NULL );
|
test_connexions( NULL );
|
||||||
Tst_Ratsnest( NULL, 0 ); // Recalculate the active ratsnest, i.e. the unconnected links */
|
Tst_Ratsnest( NULL, 0 ); // Recalculate the active ratsnest, i.e. the unconnected links
|
||||||
OnModify();
|
OnModify();
|
||||||
GetBoard()->DisplayInfo( this );
|
GetBoard()->DisplayInfo( this );
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
|
@ -556,12 +563,15 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
// If the current Item is a pad, text module ...: Get its parent
|
// If the current Item is a pad, text module ...: Get its parent
|
||||||
if( GetCurItem()->Type() != TYPE_MODULE )
|
if( GetCurItem()->Type() != TYPE_MODULE )
|
||||||
SetCurItem( GetCurItem()->GetParent() );
|
SetCurItem( GetCurItem()->GetParent() );
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
{
|
{
|
||||||
g_Drag_Pistes_On = false;
|
g_Drag_Pistes_On = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -570,6 +580,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->SetCrossHairPosition( ((MODULE*) GetCurItem())->m_Pos );
|
GetScreen()->SetCrossHairPosition( ((MODULE*) GetCurItem())->m_Pos );
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
StartMove_Module( (MODULE*) GetCurItem(), &dc );
|
StartMove_Module( (MODULE*) GetCurItem(), &dc );
|
||||||
|
@ -578,8 +589,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: /* get module by name and move it */
|
case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: /* get module by name and move it */
|
||||||
SetCurItem( GetModuleByName() );
|
SetCurItem( GetModuleByName() );
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -588,6 +601,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
StartMove_Module( module, &dc );
|
StartMove_Module( module, &dc );
|
||||||
break;
|
break;
|
||||||
|
@ -601,7 +615,9 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -610,10 +626,12 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Delete_Module( (MODULE*) GetCurItem(), &dc, true ) )
|
if( Delete_Module( (MODULE*) GetCurItem(), &dc, true ) )
|
||||||
{
|
{
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
|
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
|
||||||
|
@ -625,7 +643,9 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -634,8 +654,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple rotation, no other edition in progress */
|
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple rotation, no other edition in progress */
|
||||||
SaveCopyInUndoList(GetCurItem(), UR_ROTATED, ((MODULE*)GetCurItem())->m_Pos);
|
SaveCopyInUndoList(GetCurItem(), UR_ROTATED, ((MODULE*)GetCurItem())->m_Pos);
|
||||||
|
|
||||||
Rotate_Module( &dc, (MODULE*) GetCurItem(), 900, true );
|
Rotate_Module( &dc, (MODULE*) GetCurItem(), 900, true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -648,7 +670,9 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -657,8 +681,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple rotation, no other edition in progress */
|
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple rotation, no other edition in progress */
|
||||||
SaveCopyInUndoList(GetCurItem(), UR_ROTATED_CLOCKWISE, ((MODULE*)GetCurItem())->m_Pos);
|
SaveCopyInUndoList(GetCurItem(), UR_ROTATED_CLOCKWISE, ((MODULE*)GetCurItem())->m_Pos);
|
||||||
|
|
||||||
Rotate_Module( &dc, (MODULE*) GetCurItem(), -900, true );
|
Rotate_Module( &dc, (MODULE*) GetCurItem(), -900, true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -668,9 +694,12 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
// If the current Item is a pad, text module ...: Get its parent
|
// If the current Item is a pad, text module ...: Get its parent
|
||||||
if( GetCurItem()->Type() != TYPE_MODULE )
|
if( GetCurItem()->Type() != TYPE_MODULE )
|
||||||
SetCurItem( GetCurItem()->GetParent() );
|
SetCurItem( GetCurItem()->GetParent() );
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
module = (MODULE*) GetCurItem();
|
module = (MODULE*) GetCurItem();
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -679,8 +708,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple flip, no other edition in progress */
|
if( !(GetCurItem()->m_Flags & IS_MOVED) ) /* This is a simple flip, no other edition in progress */
|
||||||
SaveCopyInUndoList(GetCurItem(), UR_FLIPPED, ((MODULE*)GetCurItem())->m_Pos);
|
SaveCopyInUndoList(GetCurItem(), UR_FLIPPED, ((MODULE*)GetCurItem())->m_Pos);
|
||||||
|
|
||||||
Change_Side_Module( (MODULE*) GetCurItem(), &dc );
|
Change_Side_Module( (MODULE*) GetCurItem(), &dc );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -689,16 +720,20 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
// If the current Item is a pad, text module ...: Get its parent
|
// If the current Item is a pad, text module ...: Get its parent
|
||||||
if( GetCurItem()->Type() != TYPE_MODULE )
|
if( GetCurItem()->Type() != TYPE_MODULE )
|
||||||
SetCurItem( GetCurItem()->GetParent() );
|
SetCurItem( GetCurItem()->GetParent() );
|
||||||
|
|
||||||
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
InstallModuleOptionsFrame( (MODULE*) GetCurItem(), &dc );
|
InstallModuleOptionsFrame( (MODULE*) GetCurItem(), &dc );
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DRAG_PAD_REQUEST:
|
case ID_POPUP_PCB_DRAG_PAD_REQUEST:
|
||||||
module = (MODULE*) GetCurItem()->GetParent();
|
module = (MODULE*) GetCurItem()->GetParent();
|
||||||
|
|
||||||
if( !module || module->Type() != TYPE_MODULE )
|
if( !module || module->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -707,6 +742,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Drag_Pistes_On = true;
|
g_Drag_Pistes_On = true;
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
StartMovePad( (D_PAD*) GetCurItem(), &dc );
|
StartMovePad( (D_PAD*) GetCurItem(), &dc );
|
||||||
|
@ -714,8 +750,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_MOVE_PAD_REQUEST:
|
case ID_POPUP_PCB_MOVE_PAD_REQUEST:
|
||||||
module = (MODULE*) GetCurItem()->GetParent();
|
module = (MODULE*) GetCurItem()->GetParent();
|
||||||
|
|
||||||
if( !module || module->Type() != TYPE_MODULE )
|
if( !module || module->Type() != TYPE_MODULE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( module->IsLocked() )
|
if( module->IsLocked() )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -724,6 +762,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Drag_Pistes_On = false;
|
g_Drag_Pistes_On = false;
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
StartMovePad( (D_PAD*) GetCurItem(), &dc );
|
StartMovePad( (D_PAD*) GetCurItem(), &dc );
|
||||||
|
@ -785,8 +824,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_SELECT_LAYER:
|
case ID_POPUP_PCB_SELECT_LAYER:
|
||||||
itmp = SelectLayer( getActiveLayer(), -1, -1 );
|
itmp = SelectLayer( getActiveLayer(), -1, -1 );
|
||||||
|
|
||||||
if( itmp >= 0 )
|
if( itmp >= 0 )
|
||||||
setActiveLayer( itmp );
|
setActiveLayer( itmp );
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -796,15 +837,19 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
|
case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
|
||||||
itmp = SelectLayer( getActiveLayer(), FIRST_NO_COPPER_LAYER, -1 );
|
itmp = SelectLayer( getActiveLayer(), FIRST_NO_COPPER_LAYER, -1 );
|
||||||
|
|
||||||
if( itmp >= 0 )
|
if( itmp >= 0 )
|
||||||
setActiveLayer( itmp );
|
setActiveLayer( itmp );
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_SELECT_CU_LAYER:
|
case ID_POPUP_PCB_SELECT_CU_LAYER:
|
||||||
itmp = SelectLayer( getActiveLayer(), -1, LAST_COPPER_LAYER );
|
itmp = SelectLayer( getActiveLayer(), -1, LAST_COPPER_LAYER );
|
||||||
|
|
||||||
if( itmp >= 0 )
|
if( itmp >= 0 )
|
||||||
setActiveLayer( itmp );
|
setActiveLayer( itmp );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_SELECT_LAYER_PAIR:
|
case ID_POPUP_PCB_SELECT_LAYER_PAIR:
|
||||||
|
@ -814,8 +859,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_TOOLBARH_PCB_SELECT_LAYER:
|
case ID_TOOLBARH_PCB_SELECT_LAYER:
|
||||||
setActiveLayer( (size_t) m_SelLayerBox->GetLayerSelection());
|
setActiveLayer( (size_t) m_SelLayerBox->GetLayerSelection());
|
||||||
|
|
||||||
if( DisplayOpt.ContrastModeDisplay )
|
if( DisplayOpt.ContrastModeDisplay )
|
||||||
DrawPanel->Refresh( true );
|
DrawPanel->Refresh( true );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_TEXTEPCB:
|
case ID_POPUP_PCB_EDIT_TEXTEPCB:
|
||||||
|
@ -873,12 +920,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_PCB_GETINFO_MARKER:
|
case ID_POPUP_PCB_GETINFO_MARKER:
|
||||||
if( GetCurItem() && GetCurItem()->Type() == TYPE_MARKER_PCB )
|
if( GetCurItem() && GetCurItem()->Type() == TYPE_MARKER_PCB )
|
||||||
( (MARKER_PCB*) GetCurItem() )->DisplayMarkerInfo( this );
|
( (MARKER_PCB*) GetCurItem() )->DisplayMarkerInfo( this );
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DELETE_DRAWING_LAYER:
|
case ID_POPUP_PCB_DELETE_DRAWING_LAYER:
|
||||||
if( GetCurItem()->m_Flags != 0 )
|
if( GetCurItem()->m_Flags != 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Delete_Drawings_All_Layer( GetCurItem()->GetLayer() );
|
Delete_Drawings_All_Layer( GetCurItem()->GetLayer() );
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
@ -897,50 +946,53 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
|
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
||||||
{
|
{
|
||||||
End_Edge( (DRAWSEGMENT*) GetCurItem(), &dc );
|
End_Edge( (DRAWSEGMENT*) GetCurItem(), &dc );
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
|
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
||||||
{
|
{
|
||||||
if( End_Zone( &dc ) )
|
if( End_Zone( &dc ) )
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawPanel->m_AutoPAN_Request = false;
|
DrawPanel->m_AutoPAN_Request = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
|
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
if( GetCurItem() && (GetCurItem()->IsNew()) )
|
||||||
{
|
{
|
||||||
if( Delete_LastCreatedCorner( &dc ) == 0 ) // No more segment in outline,
|
if( Delete_LastCreatedCorner( &dc ) == 0 ) // No more segment in outline,
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case ID_POPUP_PCB_MOVE_TRACK_SEGMENT:
|
case ID_POPUP_PCB_MOVE_TRACK_SEGMENT:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Start_MoveOneNodeOrSegment( (TRACK*) GetScreen()->GetCurItem(),
|
Start_MoveOneNodeOrSegment( (TRACK*) GetScreen()->GetCurItem(), &dc, id );
|
||||||
&dc, id );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT:
|
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT:
|
||||||
case ID_POPUP_PCB_MOVE_TRACK_NODE:
|
case ID_POPUP_PCB_MOVE_TRACK_NODE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Start_MoveOneNodeOrSegment( (TRACK*) GetScreen()->GetCurItem(),
|
Start_MoveOneNodeOrSegment( (TRACK*) GetScreen()->GetCurItem(), &dc, id );
|
||||||
&dc, id );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE:
|
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Start_DragTrackSegmentAndKeepSlope( (TRACK*) GetScreen()->GetCurItem(),
|
Start_DragTrackSegmentAndKeepSlope( (TRACK*) GetScreen()->GetCurItem(), &dc );
|
||||||
&dc );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_BREAK_TRACK:
|
case ID_POPUP_PCB_BREAK_TRACK:
|
||||||
|
@ -950,11 +1002,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
wxPoint pos = GetScreen()->GetCrossHairPosition();
|
wxPoint pos = GetScreen()->GetCrossHairPosition();
|
||||||
track->Draw( DrawPanel, &dc, GR_XOR );
|
track->Draw( DrawPanel, &dc, GR_XOR );
|
||||||
PICKED_ITEMS_LIST itemsListPicker;
|
PICKED_ITEMS_LIST itemsListPicker;
|
||||||
TRACK* newtrack = CreateLockPoint( GetBoard(), pos, track, &itemsListPicker);
|
TRACK* newtrack = CreateLockPoint( GetBoard(), pos, track, &itemsListPicker );
|
||||||
SaveCopyInUndoList(itemsListPicker,UR_UNSPECIFIED);
|
SaveCopyInUndoList( itemsListPicker, UR_UNSPECIFIED );
|
||||||
track->Draw( DrawPanel, &dc, GR_XOR );
|
track->Draw( DrawPanel, &dc, GR_XOR );
|
||||||
newtrack->Draw( DrawPanel, &dc, GR_XOR );
|
newtrack->Draw( DrawPanel, &dc, GR_XOR );
|
||||||
/* compute the new rastnest, because connectivity could change */
|
/* compute the new ratsnest, because connectivity could change */
|
||||||
test_1_net_connexion( &dc, track->GetNet() );
|
test_1_net_connexion( &dc, track->GetNet() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -997,11 +1049,9 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf(
|
msg.Printf( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() id %d error" ),
|
||||||
wxT( "PCB_EDIT_FRAME::Process_Special_Functions() id %d error" ),
|
DrawStruct->Type() );
|
||||||
DrawStruct->Type() );
|
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1023,9 +1073,8 @@ static void Process_Move_Item( PCB_EDIT_FRAME* frame, EDA_ITEM* DrawStruct, wxDC
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf(
|
msg.Printf( wxT( "PCB_EDIT_FRAME::Move_Item Error: Bad DrawType %d" ),
|
||||||
wxT( "PCB_EDIT_FRAME::Move_Item Error: Bad DrawType %d" ),
|
DrawStruct->Type() );
|
||||||
DrawStruct->Type() );
|
|
||||||
DisplayError( frame, msg );
|
DisplayError( frame, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1089,6 +1138,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
|
||||||
case TYPE_MARKER_PCB:
|
case TYPE_MARKER_PCB:
|
||||||
if( Item == GetCurItem() )
|
if( Item == GetCurItem() )
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
|
|
||||||
( (MARKER_PCB*) Item )->Draw( DrawPanel, DC, GR_XOR );
|
( (MARKER_PCB*) Item )->Draw( DrawPanel, DC, GR_XOR );
|
||||||
|
|
||||||
// delete the marker, and free memory. Don't use undo stack.
|
// delete the marker, and free memory. Don't use undo stack.
|
||||||
|
@ -1105,8 +1155,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
wxString Line;
|
wxString Line;
|
||||||
Line.Printf( wxT( "Remove: item type %d unknown." ),
|
Line.Printf( wxT( "Remove: item type %d unknown." ), Item->Type() );
|
||||||
Item->Type() );
|
|
||||||
DisplayError( this, Line );
|
DisplayError( this, Line );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1179,6 +1228,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, int layer )
|
||||||
if( DisplayOpt.ContrastModeDisplay )
|
if( DisplayOpt.ContrastModeDisplay )
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the via was allowed by DRC, then the layer swap has already
|
// if the via was allowed by DRC, then the layer swap has already
|
||||||
// been done by Other_Layer_Route(). if via not allowed, then
|
// been done by Other_Layer_Route(). if via not allowed, then
|
||||||
// return now so assignment to setActiveLayer() below doesn't happen.
|
// return now so assignment to setActiveLayer() below doesn't happen.
|
||||||
|
|
|
@ -39,10 +39,10 @@ void PCB_EDIT_FRAME::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
|
||||||
{
|
{
|
||||||
if( m_ModuleEditFrame == NULL )
|
if( m_ModuleEditFrame == NULL )
|
||||||
{
|
{
|
||||||
m_ModuleEditFrame = new WinEDA_ModuleEditFrame( this,
|
m_ModuleEditFrame = new FOOTPRINT_EDIT_FRAME( this,
|
||||||
_( "Module Editor" ),
|
_( "Module Editor" ),
|
||||||
wxPoint( -1, -1 ),
|
wxPoint( -1, -1 ),
|
||||||
wxSize( 600, 400 ) );
|
wxSize( 600, 400 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ModuleEditFrame->Load_Module_From_BOARD( Module );
|
m_ModuleEditFrame->Load_Module_From_BOARD( Module );
|
||||||
|
@ -57,7 +57,7 @@ void PCB_EDIT_FRAME::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
|
||||||
/*
|
/*
|
||||||
* Position anchor under the cursor.
|
* Position anchor under the cursor.
|
||||||
*/
|
*/
|
||||||
void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
|
void FOOTPRINT_EDIT_FRAME::Place_Ancre( MODULE* pt_mod )
|
||||||
{
|
{
|
||||||
wxPoint moveVector;
|
wxPoint moveVector;
|
||||||
EDA_ITEM* PtStruct;
|
EDA_ITEM* PtStruct;
|
||||||
|
@ -112,7 +112,7 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::RemoveStruct( EDA_ITEM* Item )
|
void FOOTPRINT_EDIT_FRAME::RemoveStruct( EDA_ITEM* Item )
|
||||||
{
|
{
|
||||||
if( Item == NULL )
|
if( Item == NULL )
|
||||||
return;
|
return;
|
||||||
|
@ -151,8 +151,7 @@ void WinEDA_ModuleEditFrame::RemoveStruct( EDA_ITEM* Item )
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
wxString Line;
|
wxString Line;
|
||||||
Line.Printf( wxT( " Remove: draw item type %d unknown." ),
|
Line.Printf( wxT( " Remove: draw item type %d unknown." ), Item->Type() );
|
||||||
Item->Type() );
|
|
||||||
DisplayError( this, Line );
|
DisplayError( this, Line );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -34,8 +34,6 @@ void PCB_EDIT_FRAME::OnFileHistory( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Handle the read/write file commands
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
@ -78,6 +76,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = _( "OK to load recovery file " ) + fn.GetFullPath();
|
msg = _( "OK to load recovery file " ) + fn.GetFullPath();
|
||||||
|
|
||||||
if( !IsOK( this, msg ) )
|
if( !IsOK( this, msg ) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +84,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
LoadOnePcbFile( fn.GetFullPath(), false );
|
LoadOnePcbFile( fn.GetFullPath(), false );
|
||||||
fn.SetExt( PcbFileExtension );
|
fn.SetExt( PcbFileExtension );
|
||||||
GetScreen()->SetFileName( fn.GetFullPath() );
|
GetScreen()->SetFileName( fn.GetFullPath() );
|
||||||
SetTitle( GetScreen()->GetFileName() );
|
UpdateTitle();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +97,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
GetScreen()->GetFileName().Printf( wxT( "%s%cnoname%s" ),
|
GetScreen()->GetFileName().Printf( wxT( "%s%cnoname%s" ),
|
||||||
GetChars( wxGetCwd() ), DIR_SEP,
|
GetChars( wxGetCwd() ), DIR_SEP,
|
||||||
GetChars( PcbFileExtension ) );
|
GetChars( PcbFileExtension ) );
|
||||||
SetTitle( GetScreen()->GetFileName() );
|
UpdateTitle();
|
||||||
ReCreateLayerBox( NULL );
|
ReCreateLayerBox( NULL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -116,19 +115,6 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function LoadOnePcbFile
|
|
||||||
* Load a Kicad board (.brd) file.
|
|
||||||
*
|
|
||||||
* @param aFileName - File name including path. If empty, a file dialog will
|
|
||||||
* be displayed.
|
|
||||||
* @param aAppend - Append board file aFileName to the currently loaded file if true.
|
|
||||||
* Default = false.
|
|
||||||
* @param aForceFileDialog - Display the file open dialog even if aFullFileName is
|
|
||||||
* valid if true; Default = false.
|
|
||||||
*
|
|
||||||
* @return False if file load fails or is cancelled by the user, otherwise true.
|
|
||||||
*/
|
|
||||||
bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
|
bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
|
||||||
bool aForceFileDialog )
|
bool aForceFileDialog )
|
||||||
{
|
{
|
||||||
|
@ -183,6 +169,7 @@ the changes?" ) ) )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
source = wxFopen( GetScreen()->GetFileName(), wxT( "rt" ) );
|
source = wxFopen( GetScreen()->GetFileName(), wxT( "rt" ) );
|
||||||
|
|
||||||
if( source == NULL )
|
if( source == NULL )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "File <%s> not found" ), GetChars( GetScreen()->GetFileName() ) );
|
msg.Printf( _( "File <%s> not found" ), GetChars( GetScreen()->GetFileName() ) );
|
||||||
|
@ -196,6 +183,7 @@ the changes?" ) ) )
|
||||||
|
|
||||||
/* Read header and TEST if it is a PCB file format */
|
/* Read header and TEST if it is a PCB file format */
|
||||||
reader.ReadLine();
|
reader.ReadLine();
|
||||||
|
|
||||||
if( strncmp( reader.Line(), "PCBNEW-BOARD", 12 ) != 0 )
|
if( strncmp( reader.Line(), "PCBNEW-BOARD", 12 ) != 0 )
|
||||||
{
|
{
|
||||||
DisplayError( this, wxT( "Unknown file type" ) );
|
DisplayError( this, wxT( "Unknown file type" ) );
|
||||||
|
@ -204,6 +192,7 @@ the changes?" ) ) )
|
||||||
|
|
||||||
int ver;
|
int ver;
|
||||||
sscanf( reader.Line() , "PCBNEW-BOARD Version %d date", &ver );
|
sscanf( reader.Line() , "PCBNEW-BOARD Version %d date", &ver );
|
||||||
|
|
||||||
if ( ver > g_CurrentVersionPCB )
|
if ( ver > g_CurrentVersionPCB )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( this, _( "This file was created by a more recent \
|
DisplayInfoMessage( this, _( "This file was created by a more recent \
|
||||||
|
@ -220,7 +209,9 @@ this file again." ) );
|
||||||
wxSetWorkingDirectory( wxPathOnly( GetScreen()->GetFileName() ) );
|
wxSetWorkingDirectory( wxPathOnly( GetScreen()->GetFileName() ) );
|
||||||
|
|
||||||
if( aAppend )
|
if( aAppend )
|
||||||
|
{
|
||||||
ReadPcbFile( &reader, true );
|
ReadPcbFile( &reader, true );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Update the option toolbar
|
// Update the option toolbar
|
||||||
|
@ -252,7 +243,7 @@ this file again." ) );
|
||||||
|
|
||||||
GetScreen()->GetFileName().Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
|
GetScreen()->GetFileName().Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
|
||||||
|
|
||||||
SetTitle( GetScreen()->GetFileName() );
|
UpdateTitle();
|
||||||
UpdateFileHistory( GetScreen()->GetFileName() );
|
UpdateFileHistory( GetScreen()->GetFileName() );
|
||||||
|
|
||||||
/* Rebuild the new pad list (for drc and ratsnet control ...) */
|
/* Rebuild the new pad list (for drc and ratsnet control ...) */
|
||||||
|
@ -309,9 +300,7 @@ this file again." ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Write the board file
|
bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName )
|
||||||
*/
|
|
||||||
bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
|
||||||
{
|
{
|
||||||
wxFileName backupFileName;
|
wxFileName backupFileName;
|
||||||
wxFileName pcbFileName;
|
wxFileName pcbFileName;
|
||||||
|
@ -322,7 +311,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
bool saveok = true;
|
bool saveok = true;
|
||||||
FILE* dest;
|
FILE* dest;
|
||||||
|
|
||||||
if( FileName == wxEmptyString )
|
if( aFileName == wxEmptyString )
|
||||||
{
|
{
|
||||||
wxFileDialog dlg( this, _( "Save Board File" ), wxEmptyString,
|
wxFileDialog dlg( this, _( "Save Board File" ), wxEmptyString,
|
||||||
GetScreen()->GetFileName(), PcbFileWildcard,
|
GetScreen()->GetFileName(), PcbFileWildcard,
|
||||||
|
@ -334,7 +323,9 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
GetScreen()->SetFileName( dlg.GetPath() );
|
GetScreen()->SetFileName( dlg.GetPath() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GetScreen()->SetFileName( FileName );
|
{
|
||||||
|
GetScreen()->SetFileName( aFileName );
|
||||||
|
}
|
||||||
|
|
||||||
/* If changes are made, update the board date */
|
/* If changes are made, update the board date */
|
||||||
if( GetScreen()->IsModify() )
|
if( GetScreen()->IsModify() )
|
||||||
|
@ -344,6 +335,9 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
|
|
||||||
pcbFileName = GetScreen()->GetFileName();
|
pcbFileName = GetScreen()->GetFileName();
|
||||||
|
|
||||||
|
if( !IsWritable( pcbFileName ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Get the backup file name */
|
/* Get the backup file name */
|
||||||
backupFileName = pcbFileName;
|
backupFileName = pcbFileName;
|
||||||
backupFileName.SetExt( BACKUP_FILE_EXT );
|
backupFileName.SetExt( BACKUP_FILE_EXT );
|
||||||
|
@ -356,10 +350,11 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
/* rename the "old" file" from xxx.brd to xxx.000 */
|
/* rename the "old" file" from xxx.brd to xxx.000 */
|
||||||
if( backupFileName.FileExists() ) /* Remove the old file xxx.000 (if exists) */
|
if( backupFileName.FileExists() ) /* Remove the old file xxx.000 (if exists) */
|
||||||
wxRemoveFile( backupFileName.GetFullPath() );
|
wxRemoveFile( backupFileName.GetFullPath() );
|
||||||
|
|
||||||
if( !wxRenameFile( pcbFileName.GetFullPath(), backupFileName.GetFullPath() ) )
|
if( !wxRenameFile( pcbFileName.GetFullPath(), backupFileName.GetFullPath() ) )
|
||||||
{
|
{
|
||||||
msg = _( "Warning: unable to create backup file " ) + backupFileName.GetFullPath();
|
msg = _( "Warning: unable to create backup file " ) + backupFileName.GetFullPath();
|
||||||
DisplayError( this, msg, 15 );
|
DisplayError( this, msg );
|
||||||
saveok = false;
|
saveok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +377,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
if( dest )
|
if( dest )
|
||||||
{
|
{
|
||||||
GetScreen()->SetFileName( pcbFileName.GetFullPath() );
|
GetScreen()->SetFileName( pcbFileName.GetFullPath() );
|
||||||
SetTitle( GetScreen()->GetFileName() );
|
UpdateTitle();
|
||||||
|
|
||||||
SavePcbFormatAscii( dest );
|
SavePcbFormatAscii( dest );
|
||||||
fclose( dest );
|
fclose( dest );
|
||||||
|
@ -400,6 +395,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
|
||||||
lowerTxt = _( "Wrote board file: " );
|
lowerTxt = _( "Wrote board file: " );
|
||||||
else
|
else
|
||||||
lowerTxt = _( "Failed to create " );
|
lowerTxt = _( "Failed to create " );
|
||||||
|
|
||||||
lowerTxt += pcbFileName.GetFullPath();
|
lowerTxt += pcbFileName.GetFullPath();
|
||||||
|
|
||||||
ClearMsgPanel();
|
ClearMsgPanel();
|
||||||
|
|
|
@ -20,11 +20,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Hot keys. Some commands are relative to the item under the mouse cursor
|
void FOOTPRINT_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
* Commands are case insensitive
|
EDA_ITEM* aItem )
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
|
||||||
EDA_ITEM* aItem )
|
|
||||||
{
|
{
|
||||||
if( aHotKey == 0 )
|
if( aHotKey == 0 )
|
||||||
return;
|
return;
|
||||||
|
@ -35,7 +32,8 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aP
|
||||||
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||||
cmd.SetEventObject( this );
|
cmd.SetEventObject( this );
|
||||||
|
|
||||||
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */
|
/* Convert lower to upper case (the usual toupper function has problem with non ascii
|
||||||
|
* codes like function keys */
|
||||||
if( (aHotKey >= 'a') && (aHotKey <= 'z') )
|
if( (aHotKey >= 'a') && (aHotKey <= 'z') )
|
||||||
aHotKey += 'A' - 'a';
|
aHotKey += 'A' - 'a';
|
||||||
|
|
||||||
|
@ -90,8 +88,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aP
|
||||||
case HK_REDO:
|
case HK_REDO:
|
||||||
if( ItemFree && !blockActive )
|
if( ItemFree && !blockActive )
|
||||||
{
|
{
|
||||||
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
|
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
|
||||||
HK_Descr->m_IdMenuEvent );
|
|
||||||
wxPostEvent( this, event );
|
wxPostEvent( this, event );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -120,7 +117,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
|
bool FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
bool itemCurrentlyEdited = item && item->m_Flags;
|
bool itemCurrentlyEdited = item && item->m_Flags;
|
||||||
|
@ -136,7 +133,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
|
||||||
|
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
|
|
||||||
int evt_type = 0; //Used to post a wxCommandEvent on demand
|
int evt_type = 0; // Used to post a wxCommandEvent on demand
|
||||||
|
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
@ -172,7 +169,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
|
bool FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem( int aIdCommand )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
bool itemCurrentlyEdited = item && item->m_Flags;
|
bool itemCurrentlyEdited = item && item->m_Flags;
|
||||||
|
@ -188,7 +185,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
|
||||||
|
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
|
|
||||||
int evt_type = 0; //Used to post a wxCommandEvent on demand
|
int evt_type = 0; // Used to post a wxCommandEvent on demand
|
||||||
|
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
@ -224,7 +221,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
|
bool FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
bool itemCurrentlyEdited = item && item->m_Flags;
|
bool itemCurrentlyEdited = item && item->m_Flags;
|
||||||
|
@ -240,7 +237,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
|
||||||
|
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
|
|
||||||
int evt_type = 0; //Used to post a wxCommandEvent on demand
|
int evt_type = 0; // Used to post a wxCommandEvent on demand
|
||||||
|
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
@ -276,7 +273,7 @@ bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WinEDA_ModuleEditFrame::OnHotkeyRotateItem( int aIdCommand )
|
bool FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
bool itemCurrentlyEdited = item && item->m_Flags;
|
bool itemCurrentlyEdited = item && item->m_Flags;
|
||||||
|
|
|
@ -72,12 +72,7 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery )
|
||||||
* Function Clear_Pcb
|
|
||||||
* delete all and reinitialize the current board
|
|
||||||
* @param aQuery = true to prompt user for confirmation, false to initialize silently
|
|
||||||
*/
|
|
||||||
bool WinEDA_ModuleEditFrame::Clear_Pcb( bool aQuery )
|
|
||||||
{
|
{
|
||||||
if( GetBoard() == NULL )
|
if( GetBoard() == NULL )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -32,20 +32,10 @@
|
||||||
|
|
||||||
const wxString ModExportFileExtension( wxT( "emp" ) );
|
const wxString ModExportFileExtension( wxT( "emp" ) );
|
||||||
|
|
||||||
static const wxString ModExportFileWildcard(
|
static const wxString ModExportFileWildcard( _( "Kicad foot print export files (*.emp)|*.emp" ) );
|
||||||
_( "Kicad foot print export files (*.emp)|*.emp" ) );
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
MODULE* FOOTPRINT_EDIT_FRAME::Import_Module()
|
||||||
* Function Import_Module
|
|
||||||
* Read a file containing only one footprint.
|
|
||||||
* Used to import (after exporting) a footprint
|
|
||||||
* Exported files have the standard ext .emp
|
|
||||||
* This is the same format as .mod files but restricted to only one footprint
|
|
||||||
* The import function can also read gpcb footprint file, in Newlib format
|
|
||||||
* (One footprint per file, Newlib files have no special ext.)
|
|
||||||
*/
|
|
||||||
MODULE* WinEDA_ModuleEditFrame::Import_Module( )
|
|
||||||
{
|
{
|
||||||
char* Line;
|
char* Line;
|
||||||
FILE* file;
|
FILE* file;
|
||||||
|
@ -85,17 +75,19 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( )
|
||||||
Config->Write( EXPORT_IMPORT_LASTPATH_KEY, LastOpenedPathForLoading );
|
Config->Write( EXPORT_IMPORT_LASTPATH_KEY, LastOpenedPathForLoading );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch the locale to standard C (needed to print floating point numbers
|
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
||||||
// like 1.3)
|
|
||||||
SetLocaleTo_C_standard();
|
SetLocaleTo_C_standard();
|
||||||
|
|
||||||
/* Read header and test file type */
|
/* Read header and test file type */
|
||||||
reader.ReadLine();
|
reader.ReadLine();
|
||||||
Line = reader.Line();
|
Line = reader.Line();
|
||||||
|
|
||||||
if( strnicmp( Line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) != 0 )
|
if( strnicmp( Line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) != 0 )
|
||||||
{
|
{
|
||||||
if( strnicmp( Line, "Element", 7 ) == 0 )
|
if( strnicmp( Line, "Element", 7 ) == 0 )
|
||||||
|
{
|
||||||
Footprint_Is_GPCB_Format = true;
|
Footprint_Is_GPCB_Format = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Not a module file" ) );
|
DisplayError( this, _( "Not a module file" ) );
|
||||||
|
@ -123,6 +115,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( )
|
||||||
{
|
{
|
||||||
module->ReadDescr( &reader );
|
module->ReadDescr( &reader );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLocaleTo_Default(); // revert to the current locale
|
SetLocaleTo_Default(); // revert to the current locale
|
||||||
|
|
||||||
/* Insert footprint in list*/
|
/* Insert footprint in list*/
|
||||||
|
@ -138,19 +131,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
|
||||||
* Function Export_Module
|
|
||||||
* Create a file containing only one footprint.
|
|
||||||
* Used to export a footprint
|
|
||||||
* Exported files have the standard ext .emp
|
|
||||||
* This is the same format as .mod files but restricted to only one footprint
|
|
||||||
* So Create a new lib (which will contains one module) and export a footprint
|
|
||||||
* is basically the same thing
|
|
||||||
* @param aModule = the module to export
|
|
||||||
* @param aCreateSysLib : true = use default lib path to create lib
|
|
||||||
* false = use current path or last used path to export the footprint
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Export_Module( MODULE* aModule, bool aCreateSysLib )
|
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
FILE* file;
|
FILE* file;
|
||||||
|
@ -192,8 +173,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* aModule, bool aCreateSysLib
|
||||||
Config->Write( EXPORT_IMPORT_LASTPATH_KEY, fn.GetPath() );
|
Config->Write( EXPORT_IMPORT_LASTPATH_KEY, fn.GetPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch the locale to standard C (needed to read/write floating point numbers
|
// Switch the locale to standard C (needed to read/write floating point numbers like 1.3)
|
||||||
// like 1.3)
|
|
||||||
SetLocaleTo_C_standard();
|
SetLocaleTo_C_standard();
|
||||||
|
|
||||||
FOOTPRINT_LIBRARY libexport( file );
|
FOOTPRINT_LIBRARY libexport( file );
|
||||||
|
@ -208,13 +188,12 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* aModule, bool aCreateSysLib
|
||||||
|
|
||||||
SetLocaleTo_Default(); // revert to the current locale
|
SetLocaleTo_Default(); // revert to the current locale
|
||||||
|
|
||||||
msg.Printf( _( "Module exported in file <%s>" ),
|
msg.Printf( _( "Module exported in file <%s>" ), GetChars( fn.GetFullPath() ) );
|
||||||
GetChars( fn.GetFullPath() ) );
|
|
||||||
DisplayInfoMessage( this, msg );
|
DisplayInfoMessage( this, msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname )
|
void FOOTPRINT_EDIT_FRAME::Delete_Module_In_Library( const wxString& aLibname )
|
||||||
{
|
{
|
||||||
wxFileName newFileName;
|
wxFileName newFileName;
|
||||||
wxFileName oldFileName;
|
wxFileName oldFileName;
|
||||||
|
@ -223,27 +202,24 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
FILE* out_file, * lib_module;
|
FILE* out_file, * lib_module;
|
||||||
wxString CmpName, msg;
|
wxString CmpName, msg;
|
||||||
|
|
||||||
CmpName = Select_1_Module_From_List( this,
|
CmpName = Select_1_Module_From_List( this, aLibname, wxEmptyString, wxEmptyString );
|
||||||
aLibname,
|
|
||||||
wxEmptyString,
|
|
||||||
wxEmptyString );
|
|
||||||
if( CmpName == wxEmptyString )
|
if( CmpName == wxEmptyString )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Confirmation */
|
/* Confirmation */
|
||||||
msg.Printf( _( "Ok to delete module %s in library %s" ),
|
msg.Printf( _( "Ok to delete module %s in library %s" ),
|
||||||
GetChars( CmpName ), GetChars( aLibname ) );
|
GetChars( CmpName ), GetChars( aLibname ) );
|
||||||
|
|
||||||
if( !IsOK( this, msg ) )
|
if( !IsOK( this, msg ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
oldFileName = aLibname;
|
oldFileName = aLibname;
|
||||||
|
|
||||||
if( ( lib_module = wxFopen( oldFileName.GetFullPath(),
|
if( ( lib_module = wxFopen( oldFileName.GetFullPath(), wxT( "rt" ) ) ) == NULL )
|
||||||
wxT( "rt" ) ) ) == NULL )
|
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _( "Library %s not found" ), GetChars(oldFileName.GetFullPath()) );
|
msg.Printf( _( "Library %s not found" ), GetChars(oldFileName.GetFullPath() ) );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -264,6 +240,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
/* Read module names. */
|
/* Read module names. */
|
||||||
input_lib.RebuildIndex();
|
input_lib.RebuildIndex();
|
||||||
bool found = input_lib.FindInList( CmpName );
|
bool found = input_lib.FindInList( CmpName );
|
||||||
|
|
||||||
if( !found )
|
if( !found )
|
||||||
{
|
{
|
||||||
fclose( lib_module );
|
fclose( lib_module );
|
||||||
|
@ -291,22 +268,25 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
output_lib.m_List = input_lib.m_List;
|
output_lib.m_List = input_lib.m_List;
|
||||||
|
|
||||||
output_lib.WriteHeader();
|
output_lib.WriteHeader();
|
||||||
output_lib.RemoveFromList(CmpName);
|
output_lib.RemoveFromList( CmpName );
|
||||||
output_lib.SortList();
|
output_lib.SortList();
|
||||||
output_lib.WriteSectionIndex();
|
output_lib.WriteSectionIndex();
|
||||||
|
|
||||||
/* Copy modules. */
|
/* Copy modules. */
|
||||||
rewind( lib_module );
|
rewind( lib_module );
|
||||||
LineNum = input_lib.m_LineNum;
|
LineNum = input_lib.m_LineNum;
|
||||||
|
|
||||||
bool copylines = false;
|
bool copylines = false;
|
||||||
while( GetLine( lib_module, Line, &LineNum ) )
|
while( GetLine( lib_module, Line, &LineNum ) )
|
||||||
{
|
{
|
||||||
StrPurge( Line );
|
StrPurge( Line );
|
||||||
|
|
||||||
if( strnicmp( Line, "$MODULE", 7 ) == 0 )
|
if( strnicmp( Line, "$MODULE", 7 ) == 0 )
|
||||||
{
|
{
|
||||||
copylines = true;
|
copylines = true;
|
||||||
sscanf( Line + 7, " %s", Name );
|
sscanf( Line + 7, " %s", Name );
|
||||||
msg = FROM_UTF8( Name );
|
msg = FROM_UTF8( Name );
|
||||||
|
|
||||||
if( msg.CmpNoCase( CmpName ) == 0 )
|
if( msg.CmpNoCase( CmpName ) == 0 )
|
||||||
{
|
{
|
||||||
/* Delete old module (i.e. do not copy description to out_file). */
|
/* Delete old module (i.e. do not copy description to out_file). */
|
||||||
|
@ -319,6 +299,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( copylines )
|
if( copylines )
|
||||||
fprintf( out_file, "%s\n", Line );
|
fprintf( out_file, "%s\n", Line );
|
||||||
}
|
}
|
||||||
|
@ -335,8 +316,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
if( backupFileName.FileExists() )
|
if( backupFileName.FileExists() )
|
||||||
wxRemoveFile( backupFileName.GetFullPath() );
|
wxRemoveFile( backupFileName.GetFullPath() );
|
||||||
|
|
||||||
if( !wxRenameFile( oldFileName.GetFullPath(),
|
if( !wxRenameFile( oldFileName.GetFullPath(), backupFileName.GetFullPath() ) )
|
||||||
backupFileName.GetFullPath() ) )
|
|
||||||
{
|
{
|
||||||
DisplayError( this, wxT( "Librairi.cpp: rename .bak err" ) );
|
DisplayError( this, wxT( "Librairi.cpp: rename .bak err" ) );
|
||||||
return;
|
return;
|
||||||
|
@ -350,17 +330,11 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.Printf( _( "Component %s deleted in library %s" ), GetChars( CmpName ),
|
msg.Printf( _( "Component %s deleted in library %s" ), GetChars( CmpName ),
|
||||||
GetChars( oldFileName.GetFullPath() ) );
|
GetChars( oldFileName.GetFullPath() ) );
|
||||||
SetStatusText( msg );
|
SetStatusText( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Archive_Modules
|
|
||||||
* Save in the library:
|
|
||||||
* All new modules (ie modules not found in this lib) (if NewModulesOnly == true)
|
|
||||||
* all modules (if NewModulesOnly == false)
|
|
||||||
*/
|
|
||||||
void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOnly )
|
void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOnly )
|
||||||
{
|
{
|
||||||
int ii, NbModules = 0;
|
int ii, NbModules = 0;
|
||||||
|
@ -374,6 +348,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
}
|
}
|
||||||
|
|
||||||
path = wxGetApp().ReturnLastVisitedLibraryPath();
|
path = wxGetApp().ReturnLastVisitedLibraryPath();
|
||||||
|
|
||||||
if( LibName.IsEmpty() )
|
if( LibName.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxFileDialog dlg( this, _( "Library" ), path,
|
wxFileDialog dlg( this, _( "Library" ), path,
|
||||||
|
@ -393,8 +368,8 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
if( !NewModulesOnly && file_exists )
|
if( !NewModulesOnly && file_exists )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _( "File %s exists, OK to replace ?" ),
|
msg.Printf( _( "File %s exists, OK to replace ?" ), GetChars( fileName ) );
|
||||||
GetChars( fileName ) );
|
|
||||||
if( !IsOK( this, msg ) )
|
if( !IsOK( this, msg ) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -405,12 +380,14 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
if( !NewModulesOnly || !file_exists )
|
if( !NewModulesOnly || !file_exists )
|
||||||
{
|
{
|
||||||
FILE* lib_module;
|
FILE* lib_module;
|
||||||
|
|
||||||
if( ( lib_module = wxFopen( fileName, wxT( "w+t" ) ) ) == NULL )
|
if( ( lib_module = wxFopen( fileName, wxT( "w+t" ) ) ) == NULL )
|
||||||
{
|
{
|
||||||
wxString msg = _( "Unable to create " ) + fileName;
|
wxString msg = _( "Unable to create " ) + fileName;
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOOTPRINT_LIBRARY new_lib( lib_module );
|
FOOTPRINT_LIBRARY new_lib( lib_module );
|
||||||
new_lib.WriteHeader();
|
new_lib.WriteHeader();
|
||||||
new_lib.WriteSectionIndex();
|
new_lib.WriteSectionIndex();
|
||||||
|
@ -420,6 +397,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
|
|
||||||
/* Calculate the number of modules. */
|
/* Calculate the number of modules. */
|
||||||
Module = (MODULE*) GetBoard()->m_Modules;
|
Module = (MODULE*) GetBoard()->m_Modules;
|
||||||
|
|
||||||
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
|
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
|
||||||
NbModules++;
|
NbModules++;
|
||||||
|
|
||||||
|
@ -427,6 +405,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
DisplayActivity( 0, wxEmptyString );
|
DisplayActivity( 0, wxEmptyString );
|
||||||
|
|
||||||
Module = (MODULE*) GetBoard()->m_Modules;
|
Module = (MODULE*) GetBoard()->m_Modules;
|
||||||
|
|
||||||
for( ii = 1; Module != NULL; ii++, Module = (MODULE*) Module->Next() )
|
for( ii = 1; Module != NULL; ii++, Module = (MODULE*) Module->Next() )
|
||||||
{
|
{
|
||||||
if( Save_Module_In_Library( fileName, Module,
|
if( Save_Module_In_Library( fileName, Module,
|
||||||
|
@ -434,6 +413,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
false ) == 0 )
|
false ) == 0 )
|
||||||
break;
|
break;
|
||||||
DisplayActivity( (int) ( ii * step ), wxEmptyString );
|
DisplayActivity( (int) ( ii * step ), wxEmptyString );
|
||||||
|
|
||||||
/* Check for request to stop backup (ESCAPE key actuated) */
|
/* Check for request to stop backup (ESCAPE key actuated) */
|
||||||
if( DrawPanel->m_AbortRequest )
|
if( DrawPanel->m_AbortRequest )
|
||||||
break;
|
break;
|
||||||
|
@ -441,17 +421,6 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Save_Module_In_Library
|
|
||||||
* Save in an existing library a given footprint
|
|
||||||
* @param aLibName = name of the library to use
|
|
||||||
* @param aModule = the given footprint
|
|
||||||
* @param aOverwrite = true to overwrite an existing footprint, false to abort
|
|
||||||
* an existing footprint is found
|
|
||||||
* @param aDisplayDialog = true to display a dialog to enter or confirm the
|
|
||||||
* footprint name
|
|
||||||
* @return : true if OK, false if abort
|
|
||||||
*/
|
|
||||||
bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
MODULE* aModule,
|
MODULE* aModule,
|
||||||
bool aOverwrite,
|
bool aOverwrite,
|
||||||
|
@ -470,26 +439,35 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
|
|
||||||
aModule->DisplayInfo( this );
|
aModule->DisplayInfo( this );
|
||||||
|
|
||||||
if( !wxFileExists( aLibName ) )
|
newFileName = aLibName;
|
||||||
|
|
||||||
|
if( !newFileName.FileExists( aLibName ) )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Library %s not found" ), GetChars( aLibName ) );
|
msg.Printf( _( "Library %s not found." ), GetChars( aLibName ) );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !IsWritable( newFileName ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Ask for the footprint name in lib */
|
/* Ask for the footprint name in lib */
|
||||||
Name_Cmp = aModule->m_LibRef;
|
Name_Cmp = aModule->m_LibRef;
|
||||||
|
|
||||||
if( aDisplayDialog )
|
if( aDisplayDialog )
|
||||||
{
|
{
|
||||||
wxTextEntryDialog dlg( this, _( "Name:" ), _( "Save module" ), Name_Cmp );
|
wxTextEntryDialog dlg( this, _( "Name:" ), _( "Save module" ), Name_Cmp );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return false; // cancelled by user
|
return false; // cancelled by user
|
||||||
|
|
||||||
Name_Cmp = dlg.GetValue();
|
Name_Cmp = dlg.GetValue();
|
||||||
Name_Cmp.Trim( true );
|
Name_Cmp.Trim( true );
|
||||||
Name_Cmp.Trim( false );
|
Name_Cmp.Trim( false );
|
||||||
|
|
||||||
if( Name_Cmp.IsEmpty() )
|
if( Name_Cmp.IsEmpty() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
aModule->m_LibRef = Name_Cmp;
|
aModule->m_LibRef = Name_Cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,8 +491,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
if( ! input_lib.IsLibrary() )
|
if( ! input_lib.IsLibrary() )
|
||||||
{
|
{
|
||||||
fclose( lib_module );
|
fclose( lib_module );
|
||||||
msg.Printf( _( "File %s is not a eeschema library" ),
|
msg.Printf( _( "File %s is not a eeschema library" ), GetChars( aLibName ) );
|
||||||
GetChars( aLibName ) );
|
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -522,6 +499,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
/* Read footprints in lib: - search for an existing footprint */
|
/* Read footprints in lib: - search for an existing footprint */
|
||||||
input_lib.RebuildIndex();
|
input_lib.RebuildIndex();
|
||||||
bool module_exists = input_lib.FindInList( Name_Cmp );
|
bool module_exists = input_lib.FindInList( Name_Cmp );
|
||||||
|
|
||||||
if( module_exists )
|
if( module_exists )
|
||||||
{
|
{
|
||||||
// an existing footprint is found in current lib
|
// an existing footprint is found in current lib
|
||||||
|
@ -531,6 +509,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
msg << LineNum;
|
msg << LineNum;
|
||||||
SetStatusText( msg );
|
SetStatusText( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !aOverwrite ) // Do not save the given footprint: an old one exists
|
if( !aOverwrite ) // Do not save the given footprint: an old one exists
|
||||||
{
|
{
|
||||||
fclose( lib_module );
|
fclose( lib_module );
|
||||||
|
@ -540,7 +519,6 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
|
|
||||||
/* Creates the new library */
|
/* Creates the new library */
|
||||||
|
|
||||||
newFileName = aLibName;
|
|
||||||
newFileName.SetExt( FILETMP_EXT );
|
newFileName.SetExt( FILETMP_EXT );
|
||||||
|
|
||||||
if( ( dest = wxFopen( newFileName.GetFullPath(), wxT( "w+t" ) ) ) == NULL )
|
if( ( dest = wxFopen( newFileName.GetFullPath(), wxT( "w+t" ) ) ) == NULL )
|
||||||
|
@ -553,12 +531,12 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
|
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
// Switch the locale to standard C (needed to print floating point numbers
|
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
||||||
// like 1.3)
|
|
||||||
SetLocaleTo_C_standard();
|
SetLocaleTo_C_standard();
|
||||||
|
|
||||||
FOOTPRINT_LIBRARY output_lib( dest );
|
FOOTPRINT_LIBRARY output_lib( dest );
|
||||||
output_lib.m_List = input_lib.m_List;
|
output_lib.m_List = input_lib.m_List;
|
||||||
|
|
||||||
if( ! module_exists )
|
if( ! module_exists )
|
||||||
output_lib.m_List.Add( Name_Cmp );
|
output_lib.m_List.Add( Name_Cmp );
|
||||||
|
|
||||||
|
@ -573,6 +551,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
|
|
||||||
// Copy footprints, until the old footprint to delete
|
// Copy footprints, until the old footprint to delete
|
||||||
bool skip_header = true;
|
bool skip_header = true;
|
||||||
|
|
||||||
while( GetLine( lib_module, Line, &LineNum ) )
|
while( GetLine( lib_module, Line, &LineNum ) )
|
||||||
{
|
{
|
||||||
StrPurge( Line );
|
StrPurge( Line );
|
||||||
|
@ -592,6 +571,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
{
|
{
|
||||||
sscanf( Line + 7, " %s", Name );
|
sscanf( Line + 7, " %s", Name );
|
||||||
msg = FROM_UTF8( Name );
|
msg = FROM_UTF8( Name );
|
||||||
|
|
||||||
if( msg.CmpNoCase( Name_Cmp ) == 0 )
|
if( msg.CmpNoCase( Name_Cmp ) == 0 )
|
||||||
{
|
{
|
||||||
/* skip old footprint descr (delete from the lib) */
|
/* skip old footprint descr (delete from the lib) */
|
||||||
|
@ -604,6 +584,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf( dest, "%s\n", Line );
|
fprintf( dest, "%s\n", Line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,16 +630,6 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Create_1_Module
|
|
||||||
* Creates a new module or footprint : A new module contains 2 texts :
|
|
||||||
* First = REFERENCE
|
|
||||||
* Second = VALUE: "VAL**"
|
|
||||||
* the new module is added to the board module list
|
|
||||||
* @param aModuleName = name of the new footprint
|
|
||||||
* (will the component reference in board)
|
|
||||||
* @return a pointer to the new module
|
|
||||||
*/
|
|
||||||
MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName )
|
MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName )
|
||||||
{
|
{
|
||||||
MODULE* Module;
|
MODULE* Module;
|
||||||
|
@ -671,21 +642,23 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName )
|
||||||
if( moduleName.IsEmpty() )
|
if( moduleName.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxTextEntryDialog dlg( this, _( "Module Reference:" ),
|
wxTextEntryDialog dlg( this, _( "Module Reference:" ),
|
||||||
_( "Module Creation" ), moduleName );
|
_( "Module Creation" ), moduleName );
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return NULL; //Aborted by user
|
return NULL; //Aborted by user
|
||||||
|
|
||||||
moduleName = dlg.GetValue();
|
moduleName = dlg.GetValue();
|
||||||
}
|
}
|
||||||
moduleName.Trim( true );
|
moduleName.Trim( true );
|
||||||
moduleName.Trim( false );
|
moduleName.Trim( false );
|
||||||
|
|
||||||
if( moduleName.IsEmpty( ) )
|
if( moduleName.IsEmpty( ) )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( this, _( "No reference, aborted" ) );
|
DisplayInfoMessage( this, _( "No reference, aborted" ) );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates the new module and add it to the head of the linked list of
|
// Creates the new module and add it to the head of the linked list of modules
|
||||||
// modules
|
|
||||||
Module = new MODULE( GetBoard() );
|
Module = new MODULE( GetBoard() );
|
||||||
|
|
||||||
GetBoard()->Add( Module );
|
GetBoard()->Add( Module );
|
||||||
|
@ -715,8 +688,10 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::Select_Active_Library()
|
void FOOTPRINT_EDIT_FRAME::Select_Active_Library()
|
||||||
{
|
{
|
||||||
|
wxString msg;
|
||||||
|
|
||||||
if( g_LibName_List.GetCount() == 0 )
|
if( g_LibName_List.GetCount() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -725,29 +700,44 @@ void WinEDA_ModuleEditFrame::Select_Active_Library()
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_CurrentLib = dlg.GetTextSelection();
|
wxFileName fileName = wxFileName( wxEmptyString, dlg.GetTextSelection(), ModuleFileExtension );
|
||||||
|
fileName = wxGetApp().FindLibraryPath( fileName );
|
||||||
|
|
||||||
|
if( fileName.IsOk() && fileName.FileExists() )
|
||||||
|
{
|
||||||
|
m_CurrentLib = dlg.GetTextSelection();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg.Printf( _( "The footprint library <%s> could not be found in any of the search paths." ),
|
||||||
|
GetChars( dlg.GetTextSelection() ) );
|
||||||
|
DisplayError( this, msg );
|
||||||
|
m_CurrentLib.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int WinEDA_ModuleEditFrame::Create_Librairie( const wxString& LibName )
|
int FOOTPRINT_EDIT_FRAME::Create_Librairie( const wxString& aLibName )
|
||||||
{
|
{
|
||||||
FILE* lib_module;
|
FILE* lib_module;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
wxFileName fileName = aLibName;
|
||||||
|
|
||||||
if( wxFileExists( LibName ) )
|
if( fileName.FileExists() )
|
||||||
{
|
{
|
||||||
msg = _( "Library exists " ) + LibName;
|
msg.Printf( _( "Library <%s> already exists." ), GetChars( fileName.GetFullPath() ) );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( lib_module = wxFopen( LibName, wxT( "wt" ) ) ) == NULL )
|
if( !IsWritable( fileName ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( ( lib_module = wxFopen( fileName.GetFullPath(), wxT( "wt" ) ) ) == NULL )
|
||||||
{
|
{
|
||||||
msg = _( "Unable to create " ) + LibName;
|
msg = _( "Unable to create " ) + fileName.GetFullPath();
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,13 +24,8 @@ static void DisplayCmpDoc( wxString& Name );
|
||||||
|
|
||||||
static FOOTPRINT_LIST MList;
|
static FOOTPRINT_LIST MList;
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Load_Module_From_BOARD
|
bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* Module )
|
||||||
* load in Modedit a footfrint from the main board
|
|
||||||
* @param Module = the module to load. If NULL, a module reference will we asked to user
|
|
||||||
* @return true if a module isloaded, false otherwise.
|
|
||||||
*/
|
|
||||||
bool WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module )
|
|
||||||
{
|
{
|
||||||
MODULE* NewModule;
|
MODULE* NewModule;
|
||||||
PCB_BASE_FRAME* parent = (PCB_BASE_FRAME*) GetParent();
|
PCB_BASE_FRAME* parent = (PCB_BASE_FRAME*) GetParent();
|
||||||
|
@ -109,8 +104,8 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
|
||||||
{
|
{
|
||||||
AllowWildSeach = false;
|
AllowWildSeach = false;
|
||||||
keys = ModuleName.AfterFirst( '=' );
|
keys = ModuleName.AfterFirst( '=' );
|
||||||
ModuleName = Select_1_Module_From_List( this, library, wxEmptyString,
|
ModuleName = Select_1_Module_From_List( this, library, wxEmptyString, keys );
|
||||||
keys );
|
|
||||||
if( ModuleName.IsEmpty() ) /* Cancel command */
|
if( ModuleName.IsEmpty() ) /* Cancel command */
|
||||||
{
|
{
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
@ -121,8 +116,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
|
||||||
|| ( ModuleName.Contains( wxT( "*" ) ) ) ) // Selection wild card
|
|| ( ModuleName.Contains( wxT( "*" ) ) ) ) // Selection wild card
|
||||||
{
|
{
|
||||||
AllowWildSeach = false;
|
AllowWildSeach = false;
|
||||||
ModuleName = Select_1_Module_From_List( this, library, ModuleName,
|
ModuleName = Select_1_Module_From_List( this, library, ModuleName, wxEmptyString );
|
||||||
wxEmptyString );
|
|
||||||
if( ModuleName.IsEmpty() )
|
if( ModuleName.IsEmpty() )
|
||||||
{
|
{
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
@ -137,15 +131,17 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
|
||||||
AllowWildSeach = false;
|
AllowWildSeach = false;
|
||||||
wxString wildname = wxChar( '*' ) + ModuleName + wxChar( '*' );
|
wxString wildname = wxChar( '*' ) + ModuleName + wxChar( '*' );
|
||||||
ModuleName = wildname;
|
ModuleName = wildname;
|
||||||
ModuleName = Select_1_Module_From_List( this, library, ModuleName,
|
ModuleName = Select_1_Module_From_List( this, library, ModuleName, wxEmptyString );
|
||||||
wxEmptyString );
|
|
||||||
if( ModuleName.IsEmpty() )
|
if( ModuleName.IsEmpty() )
|
||||||
{
|
{
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
return NULL; /* Cancel command. */
|
return NULL; /* Cancel command. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
module = Get_Librairie_Module( library, ModuleName, true );
|
module = Get_Librairie_Module( library, ModuleName, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->SetCrossHairPosition( curspos );
|
GetScreen()->SetCrossHairPosition( curspos );
|
||||||
|
@ -168,6 +164,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
|
||||||
* rebuild only the pad and list of nets ( faster)
|
* rebuild only the pad and list of nets ( faster)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// GetBoard()->m_Pcb->m_NetInfo->BuildListOfNets();
|
// GetBoard()->m_Pcb->m_NetInfo->BuildListOfNets();
|
||||||
RecalculateAllTracksNetcode();
|
RecalculateAllTracksNetcode();
|
||||||
|
|
||||||
|
@ -208,8 +205,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
|
||||||
if( one_lib )
|
if( one_lib )
|
||||||
fn = aLibraryFullFilename;
|
fn = aLibraryFullFilename;
|
||||||
else
|
else
|
||||||
fn = wxFileName( wxEmptyString, g_LibName_List[ii],
|
fn = wxFileName( wxEmptyString, g_LibName_List[ii], ModuleFileExtension );
|
||||||
ModuleFileExtension );
|
|
||||||
|
|
||||||
tmp = wxGetApp().FindLibraryPath( fn );
|
tmp = wxGetApp().FindLibraryPath( fn );
|
||||||
|
|
||||||
|
@ -219,9 +215,9 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
|
||||||
{
|
{
|
||||||
msg.Printf( _( "PCB footprint library file <%s> not found in search paths." ),
|
msg.Printf( _( "PCB footprint library file <%s> not found in search paths." ),
|
||||||
GetChars( fn.GetFullName() ) );
|
GetChars( fn.GetFullName() ) );
|
||||||
wxMessageBox( msg, _( "Library Load Error" ),
|
wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this );
|
||||||
wxOK | wxICON_ERROR, this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,8 +227,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Could not open PCB footprint library file <%s>." ),
|
msg.Printf( _( "Could not open PCB footprint library file <%s>." ),
|
||||||
GetChars( tmp ) );
|
GetChars( tmp ) );
|
||||||
wxMessageBox( msg, _( "Library Load Error" ),
|
wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this );
|
||||||
wxOK | wxICON_ERROR, this );
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,8 +244,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
|
||||||
{
|
{
|
||||||
msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library file." ),
|
msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library file." ),
|
||||||
GetChars( tmp ) );
|
GetChars( tmp ) );
|
||||||
wxMessageBox( msg, _( "Library Load Error" ),
|
wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this );
|
||||||
wxOK | wxICON_ERROR, this );
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,7 +306,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
|
||||||
* void, list all modules)
|
* void, list all modules)
|
||||||
* @param aMask = Display filter (wildcard)( Mask = wxEmptyString if not used )
|
* @param aMask = Display filter (wildcard)( Mask = wxEmptyString if not used )
|
||||||
* @param aKeyWord = keyword list, to display a filtered list of module having
|
* @param aKeyWord = keyword list, to display a filtered list of module having
|
||||||
* one (or more) of these keyworks in their keywork list
|
* one (or more) of these keyworks in their keyword list
|
||||||
* ( aKeyWord = wxEmptyString if not used )
|
* ( aKeyWord = wxEmptyString if not used )
|
||||||
*
|
*
|
||||||
* @return wxEmptyString if abort or fails, or the selected module name if Ok
|
* @return wxEmptyString if abort or fails, or the selected module name if Ok
|
||||||
|
@ -350,13 +344,16 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow,
|
||||||
for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
|
for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
wxString& candidate = MList.GetItem(ii).m_Module;
|
wxString& candidate = MList.GetItem(ii).m_Module;
|
||||||
|
|
||||||
if( WildCompareString( aMask, candidate, false ) )
|
if( WildCompareString( aMask, candidate, false ) )
|
||||||
footprint_names_list.Add( candidate );
|
footprint_names_list.Add( candidate );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Create the full list of modules
|
else // Create the full list of modules
|
||||||
|
{
|
||||||
for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
|
for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
|
||||||
footprint_names_list.Add( MList.GetItem(ii).m_Module );
|
footprint_names_list.Add( MList.GetItem(ii).m_Module );
|
||||||
|
}
|
||||||
|
|
||||||
if( footprint_names_list.GetCount() )
|
if( footprint_names_list.GetCount() )
|
||||||
{
|
{
|
||||||
|
@ -401,16 +398,10 @@ static void DisplayCmpDoc( wxString& Name )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
MODULE* FOOTPRINT_EDIT_FRAME::Select_1_Module_From_BOARD( BOARD* aPcb )
|
||||||
* Function Select_1_Module_From_BOARD
|
|
||||||
* Display the list of modules currently existing on the BOARD
|
|
||||||
* @return a pointer to a module if this module is selected or NULL otherwise
|
|
||||||
* @param aPcb = the board from modules can be loaded
|
|
||||||
*/
|
|
||||||
MODULE* WinEDA_ModuleEditFrame::Select_1_Module_From_BOARD( BOARD* aPcb )
|
|
||||||
{
|
{
|
||||||
MODULE* Module;
|
MODULE* Module;
|
||||||
static wxString OldName; /* Save name of last module selectec. */
|
static wxString OldName; /* Save name of last module selected. */
|
||||||
wxString CmpName, msg;
|
wxString CmpName, msg;
|
||||||
|
|
||||||
wxArrayString listnames;
|
wxArrayString listnames;
|
||||||
|
@ -432,6 +423,7 @@ MODULE* WinEDA_ModuleEditFrame::Select_1_Module_From_BOARD( BOARD* aPcb )
|
||||||
OldName = CmpName;
|
OldName = CmpName;
|
||||||
|
|
||||||
Module = aPcb->m_Modules;
|
Module = aPcb->m_Modules;
|
||||||
|
|
||||||
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
|
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
|
||||||
{
|
{
|
||||||
if( CmpName == Module->m_Reference->m_Text )
|
if( CmpName == Module->m_Reference->m_Text )
|
||||||
|
|
|
@ -13,10 +13,8 @@
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "pcbnew_id.h"
|
#include "pcbnew_id.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief (Re)Create the menubar for the module editor frame
|
void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::ReCreateMenuBar()
|
|
||||||
{
|
{
|
||||||
// Create and try to get the current menubar
|
// Create and try to get the current menubar
|
||||||
wxMenuBar* menuBar = GetMenuBar();
|
wxMenuBar* menuBar = GetMenuBar();
|
||||||
|
@ -28,6 +26,7 @@ void WinEDA_ModuleEditFrame::ReCreateMenuBar()
|
||||||
// Delete all existing menus so they can be rebuilt.
|
// Delete all existing menus so they can be rebuilt.
|
||||||
// This allows language changes of the menu text on the fly.
|
// This allows language changes of the menu text on the fly.
|
||||||
menuBar->Freeze();
|
menuBar->Freeze();
|
||||||
|
|
||||||
while( menuBar->GetMenuCount() )
|
while( menuBar->GetMenuCount() )
|
||||||
delete menuBar->Remove(0);
|
delete menuBar->Remove(0);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "collectors.h"
|
#include "collectors.h"
|
||||||
|
|
||||||
|
|
||||||
BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
|
BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
|
|
||||||
|
@ -49,19 +49,18 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
scanList = GENERAL_COLLECTOR::ModulesAndTheirItems;
|
scanList = GENERAL_COLLECTOR::ModulesAndTheirItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Collector->Collect( GetBoard(), scanList, GetScreen()->RefPos(
|
m_Collector->Collect( GetBoard(), scanList, GetScreen()->RefPos( true ), guide );
|
||||||
true ), guide );
|
|
||||||
|
|
||||||
/* Remove redundancies: when an item is found, we can remove the
|
/* Remove redundancies: when an item is found, we can remove the module from list */
|
||||||
* module from list
|
|
||||||
*/
|
|
||||||
if( m_Collector->GetCount() > 1 )
|
if( m_Collector->GetCount() > 1 )
|
||||||
{
|
{
|
||||||
for( int ii = 0; ii < m_Collector->GetCount(); ii++ )
|
for( int ii = 0; ii < m_Collector->GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
item = (*m_Collector)[ii];
|
item = (*m_Collector)[ii];
|
||||||
|
|
||||||
if( item->Type() != TYPE_MODULE )
|
if( item->Type() != TYPE_MODULE )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
m_Collector->Remove( ii );
|
m_Collector->Remove( ii );
|
||||||
ii--;
|
ii--;
|
||||||
}
|
}
|
||||||
|
@ -72,21 +71,20 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
item = (*m_Collector)[0];
|
item = (*m_Collector)[0];
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
}
|
}
|
||||||
else // we can't figure out which item user wants, do popup menu so user
|
else // we can't figure out which item user wants, do popup menu so user can choose
|
||||||
// can choose
|
|
||||||
{
|
{
|
||||||
wxMenu itemMenu;
|
wxMenu itemMenu;
|
||||||
|
|
||||||
/* Give a title to the selection menu. This is also a cancel
|
/* Give a title to the selection menu. This is also a cancel menu item **/
|
||||||
* menu item **/
|
wxMenuItem* item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
|
||||||
wxMenuItem* item_title =
|
|
||||||
new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
wxFont bold_font( *wxNORMAL_FONT );
|
wxFont bold_font( *wxNORMAL_FONT );
|
||||||
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
|
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
|
||||||
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
|
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
|
||||||
item_title->SetFont( bold_font );
|
item_title->SetFont( bold_font );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
itemMenu.Append( item_title );
|
itemMenu.Append( item_title );
|
||||||
itemMenu.AppendSeparator();
|
itemMenu.AppendSeparator();
|
||||||
|
|
||||||
|
@ -117,11 +115,9 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
// item is selected
|
// item is selected
|
||||||
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
DrawPanel->m_IgnoreMouseEvents = false;
|
||||||
|
|
||||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
// The function ProcessItemSelection() has set the current item, return it.
|
||||||
|
|
||||||
// The function ProcessItemSelection() has set the current item, return
|
|
||||||
// it.
|
|
||||||
item = GetCurItem();
|
item = GetCurItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,17 +129,13 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Function LoadModuleFromBoard
|
void FOOTPRINT_EDIT_FRAME::LoadModuleFromBoard( wxCommandEvent& event )
|
||||||
* called from the main toolbar
|
|
||||||
* to load a footprint from board mainly to edit it
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event )
|
|
||||||
{
|
{
|
||||||
if( GetScreen()->IsModify() )
|
if( GetScreen()->IsModify() )
|
||||||
{
|
{
|
||||||
if( !IsOK( this,
|
if( !IsOK( this,
|
||||||
_( "Current footprint changes will be lost and this operation cannot be undone. Continue ?" ) ) )
|
_( "Current footprint changes will be lost and this operation cannot be undone. Continue?" ) ) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +150,7 @@ void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
|
@ -227,11 +219,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_MODEDIT_DELETE_PART:
|
case ID_MODEDIT_DELETE_PART:
|
||||||
{
|
{
|
||||||
wxFileName fn = wxFileName( wxEmptyString, m_CurrentLib,
|
wxFileName fn = wxFileName( wxEmptyString, m_CurrentLib, ModuleFileExtension );
|
||||||
ModuleFileExtension );
|
|
||||||
wxString full_libraryfilename = wxGetApp().FindLibraryPath( fn );
|
wxString full_libraryfilename = wxGetApp().FindLibraryPath( fn );
|
||||||
|
|
||||||
if( wxFileName::FileExists( full_libraryfilename ) )
|
if( wxFileName::FileExists( full_libraryfilename ) )
|
||||||
Delete_Module_In_Library( full_libraryfilename );
|
Delete_Module_In_Library( full_libraryfilename );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,8 +245,10 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
GetBoard()->m_NetInfo->BuildListOfNets();
|
GetBoard()->m_NetInfo->BuildListOfNets();
|
||||||
redraw = true;
|
redraw = true;
|
||||||
module->SetPosition( wxPoint( 0, 0 ) );
|
module->SetPosition( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
GetBoard()->m_Modules->m_Flags = 0;
|
GetBoard()->m_Modules->m_Flags = 0;
|
||||||
|
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -286,14 +281,14 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
if( module_in_edit->m_Link ) // this is not a new module ...
|
if( module_in_edit->m_Link ) // this is not a new module ...
|
||||||
{
|
{
|
||||||
source_module = mainpcb->m_Modules;
|
source_module = mainpcb->m_Modules;
|
||||||
for( ;
|
|
||||||
source_module != NULL;
|
for( ; source_module != NULL; source_module = (MODULE*) source_module->Next() )
|
||||||
source_module = (MODULE*) source_module->Next() )
|
|
||||||
{
|
{
|
||||||
if( module_in_edit->m_Link == source_module->m_TimeStamp )
|
if( module_in_edit->m_Link == source_module->m_TimeStamp )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( source_module == NULL )
|
if( ( source_module == NULL )
|
||||||
&& ( id == ID_MODEDIT_UPDATE_MODULE_IN_BOARD ) ) // source not found
|
&& ( id == ID_MODEDIT_UPDATE_MODULE_IN_BOARD ) ) // source not found
|
||||||
{
|
{
|
||||||
|
@ -331,6 +326,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
PICKED_ITEMS_LIST pickList;
|
PICKED_ITEMS_LIST pickList;
|
||||||
pcbframe->Exchange_Module( source_module, newmodule, &pickList );
|
pcbframe->Exchange_Module( source_module, newmodule, &pickList );
|
||||||
newmodule->m_TimeStamp = module_in_edit->m_Link;
|
newmodule->m_TimeStamp = module_in_edit->m_Link;
|
||||||
|
|
||||||
if( pickList.GetCount() )
|
if( pickList.GetCount() )
|
||||||
pcbframe->SaveCopyInUndoList( pickList, UR_UNSPECIFIED );
|
pcbframe->SaveCopyInUndoList( pickList, UR_UNSPECIFIED );
|
||||||
}
|
}
|
||||||
|
@ -354,22 +350,27 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_MODEDIT_IMPORT_PART:
|
case ID_MODEDIT_IMPORT_PART:
|
||||||
if( ! Clear_Pcb( true ) )
|
if( ! Clear_Pcb( true ) )
|
||||||
break; // //this command is aborted
|
break; // //this command is aborted
|
||||||
|
|
||||||
GetScreen()->ClearUndoRedoList();
|
GetScreen()->ClearUndoRedoList();
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
|
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||||
Import_Module( );
|
Import_Module();
|
||||||
redraw = true;
|
redraw = true;
|
||||||
|
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
GetBoard()->m_Modules->m_Flags = 0;
|
GetBoard()->m_Modules->m_Flags = 0;
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
|
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
m_Draw3DFrame->NewDisplay();
|
m_Draw3DFrame->NewDisplay();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_EXPORT_PART:
|
case ID_MODEDIT_EXPORT_PART:
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
Export_Module( GetBoard()->m_Modules, FALSE );
|
Export_Module( GetBoard()->m_Modules, false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART:
|
case ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART:
|
||||||
|
@ -390,6 +391,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
full_libraryfilename = wxGetApp().FindLibraryPath( fn );
|
full_libraryfilename = wxGetApp().FindLibraryPath( fn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxLogDebug( wxT( "Loading module from library " ) + full_libraryfilename );
|
||||||
|
|
||||||
GetScreen()->ClearUndoRedoList();
|
GetScreen()->ClearUndoRedoList();
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
Clear_Pcb( true );
|
Clear_Pcb( true );
|
||||||
|
@ -407,20 +410,27 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
TEXTE_MODULE* ref = GetBoard()->m_Modules->m_Reference;
|
TEXTE_MODULE* ref = GetBoard()->m_Modules->m_Reference;
|
||||||
TEXTE_MODULE* val = GetBoard()->m_Modules->m_Value;
|
TEXTE_MODULE* val = GetBoard()->m_Modules->m_Value;
|
||||||
|
|
||||||
if( val && ref )
|
if( val && ref )
|
||||||
{
|
{
|
||||||
ref->m_Type = TEXT_is_REFERENCE; // just in case ...
|
ref->m_Type = TEXT_is_REFERENCE; // just in case ...
|
||||||
|
|
||||||
if( ref->m_Text.Length() == 0 )
|
if( ref->m_Text.Length() == 0 )
|
||||||
ref->m_Text = L"Ref**";
|
ref->m_Text = L"Ref**";
|
||||||
|
|
||||||
val->m_Type = TEXT_is_VALUE; // just in case ...
|
val->m_Type = TEXT_is_VALUE; // just in case ...
|
||||||
|
|
||||||
if( val->m_Text.Length() == 0 )
|
if( val->m_Text.Length() == 0 )
|
||||||
val->m_Text = L"Val**";
|
val->m_Text = L"Val**";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
|
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
m_Draw3DFrame->NewDisplay();
|
m_Draw3DFrame->NewDisplay();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_PAD_SETTINGS:
|
case ID_MODEDIT_PAD_SETTINGS:
|
||||||
|
@ -434,11 +444,10 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
{
|
{
|
||||||
SetCurItem( GetBoard()->m_Modules );
|
SetCurItem( GetBoard()->m_Modules );
|
||||||
DIALOG_MODULE_MODULE_EDITOR dialog( this,
|
DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()-> GetCurItem() );
|
||||||
(MODULE*) GetScreen()->
|
|
||||||
GetCurItem() );
|
|
||||||
int ret = dialog.ShowModal();
|
int ret = dialog.ShowModal();
|
||||||
GetScreen()->GetCurItem()->m_Flags = 0;
|
GetScreen()->GetCurItem()->m_Flags = 0;
|
||||||
|
|
||||||
if( ret > 0 )
|
if( ret > 0 )
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
@ -464,12 +473,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_MODULE:
|
case ID_POPUP_PCB_EDIT_MODULE:
|
||||||
{
|
{
|
||||||
DIALOG_MODULE_MODULE_EDITOR dialog( this,
|
DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()->GetCurItem() );
|
||||||
(MODULE*) GetScreen()->GetCurItem() );
|
|
||||||
int ret = dialog.ShowModal();
|
int ret = dialog.ShowModal();
|
||||||
GetScreen()->GetCurItem()->m_Flags = 0;
|
GetScreen()->GetCurItem()->m_Flags = 0;
|
||||||
GetScreen()->GetCurItem()->m_Flags = 0;
|
GetScreen()->GetCurItem()->m_Flags = 0;
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( ret > 0 )
|
if( ret > 0 )
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
@ -515,8 +524,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_TEXTMODULE:
|
case ID_POPUP_PCB_EDIT_TEXTMODULE:
|
||||||
{
|
{
|
||||||
InstallTextModOptionsFrame(
|
InstallTextModOptionsFrame( (TEXTE_MODULE*) GetScreen()->GetCurItem(), &dc );
|
||||||
(TEXTE_MODULE*) GetScreen()->GetCurItem(), &dc );
|
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -551,11 +559,13 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
|
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( (GetScreen()->GetCurItem()->m_Flags & IS_NEW) )
|
if( (GetScreen()->GetCurItem()->m_Flags & IS_NEW) )
|
||||||
{
|
{
|
||||||
End_Edge_Module( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
End_Edge_Module( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_ENTER_EDGE_WIDTH:
|
case ID_POPUP_PCB_ENTER_EDGE_WIDTH:
|
||||||
|
@ -566,36 +576,37 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
edge = (EDGE_MODULE*) GetScreen()->GetCurItem();
|
edge = (EDGE_MODULE*) GetScreen()->GetCurItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
Enter_Edge_Width( edge );
|
Enter_Edge_Width( edge );
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( edge )
|
if( edge )
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE:
|
case ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Edit_Edge_Width( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
Edit_Edge_Width( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
||||||
DrawPanel->Refresh( );
|
DrawPanel->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE:
|
case ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Edit_Edge_Width( NULL );
|
Edit_Edge_Width( NULL );
|
||||||
DrawPanel->Refresh( );
|
DrawPanel->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE:
|
case ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Edit_Edge_Layer( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
Edit_Edge_Layer( (EDGE_MODULE*) GetScreen()->GetCurItem() );
|
||||||
DrawPanel->Refresh( );
|
DrawPanel->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE:
|
case ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE:
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
Edit_Edge_Layer( NULL );
|
Edit_Edge_Layer( NULL );
|
||||||
DrawPanel->Refresh( );
|
DrawPanel->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_DELETE_EDGE:
|
case ID_POPUP_PCB_DELETE_EDGE:
|
||||||
|
@ -619,11 +630,13 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_PCB_PAD_SETUP:
|
case ID_PCB_PAD_SETUP:
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
|
|
||||||
if( item )
|
if( item )
|
||||||
{
|
{
|
||||||
if( item->Type() != TYPE_PAD )
|
if( item->Type() != TYPE_PAD )
|
||||||
item = NULL;
|
item = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallPadOptionsFrame( (D_PAD*) item );
|
InstallPadOptionsFrame( (D_PAD*) item );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -634,14 +647,14 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_POPUP_PLACE_BLOCK:
|
case ID_POPUP_PLACE_BLOCK:
|
||||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
|
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
|
||||||
DrawPanel->m_AutoPAN_Request = FALSE;
|
DrawPanel->m_AutoPAN_Request = false;
|
||||||
HandleBlockPlace( &dc );
|
HandleBlockPlace( &dc );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_COPY_BLOCK:
|
case ID_POPUP_COPY_BLOCK:
|
||||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
|
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
|
||||||
GetScreen()->m_BlockLocate.SetMessageBlock( this );
|
GetScreen()->m_BlockLocate.SetMessageBlock( this );
|
||||||
DrawPanel->m_AutoPAN_Request = FALSE;
|
DrawPanel->m_AutoPAN_Request = false;
|
||||||
HandleBlockPlace( &dc );
|
HandleBlockPlace( &dc );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -671,7 +684,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this,
|
DisplayError( this,
|
||||||
wxT( "WinEDA_ModuleEditFrame::Process_Special_Functions error" ) );
|
wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,13 +693,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Execute a geometric transform on the current footprint.
|
void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
|
||||||
* The footprint, after transform is always in reference position and
|
|
||||||
* orientation:
|
|
||||||
* position 0,0
|
|
||||||
* orientation 0, component side.
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
|
||||||
{
|
{
|
||||||
D_PAD* pad = module->m_Pads;
|
D_PAD* pad = module->m_Pads;
|
||||||
EDA_ITEM* PtStruct = module->m_Drawings;
|
EDA_ITEM* PtStruct = module->m_Drawings;
|
||||||
|
@ -710,10 +717,13 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
||||||
|
|
||||||
module->m_Reference->m_Pos0 = module->m_Reference->m_Pos;
|
module->m_Reference->m_Pos0 = module->m_Reference->m_Pos;
|
||||||
module->m_Reference->m_Orient += angle;
|
module->m_Reference->m_Orient += angle;
|
||||||
|
|
||||||
if( module->m_Reference->m_Orient >= 1800 )
|
if( module->m_Reference->m_Orient >= 1800 )
|
||||||
module->m_Reference->m_Orient -= 1800;
|
module->m_Reference->m_Orient -= 1800;
|
||||||
|
|
||||||
module->m_Value->m_Pos0 = module->m_Value->m_Pos;
|
module->m_Value->m_Pos0 = module->m_Value->m_Pos;
|
||||||
module->m_Value->m_Orient += angle;
|
module->m_Value->m_Orient += angle;
|
||||||
|
|
||||||
if( module->m_Value->m_Orient >= 1800 )
|
if( module->m_Value->m_Orient >= 1800 )
|
||||||
module->m_Value->m_Orient -= 1800;
|
module->m_Value->m_Orient -= 1800;
|
||||||
|
|
||||||
|
@ -742,6 +752,7 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
||||||
NEGATE( pad->m_Pos0.y );
|
NEGATE( pad->m_Pos0.y );
|
||||||
NEGATE( pad->m_Offset.y );
|
NEGATE( pad->m_Offset.y );
|
||||||
NEGATE( pad->m_DeltaSize.y );
|
NEGATE( pad->m_DeltaSize.y );
|
||||||
|
|
||||||
if( pad->m_Orient )
|
if( pad->m_Orient )
|
||||||
pad->m_Orient = 3600 - pad->m_Orient;
|
pad->m_Orient = 3600 - pad->m_Orient;
|
||||||
}
|
}
|
||||||
|
@ -750,6 +761,7 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
||||||
textmod = module->m_Reference;
|
textmod = module->m_Reference;
|
||||||
NEGATE( textmod->m_Pos.y );
|
NEGATE( textmod->m_Pos.y );
|
||||||
NEGATE( textmod->m_Pos0.y );
|
NEGATE( textmod->m_Pos0.y );
|
||||||
|
|
||||||
if( textmod->m_Orient )
|
if( textmod->m_Orient )
|
||||||
textmod->m_Orient = 3600 - textmod->m_Orient;
|
textmod->m_Orient = 3600 - textmod->m_Orient;
|
||||||
|
|
||||||
|
@ -757,6 +769,7 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
||||||
textmod = module->m_Value;
|
textmod = module->m_Value;
|
||||||
NEGATE( textmod->m_Pos.y );
|
NEGATE( textmod->m_Pos.y );
|
||||||
NEGATE( textmod->m_Pos0.y );
|
NEGATE( textmod->m_Pos0.y );
|
||||||
|
|
||||||
if( textmod->m_Orient )
|
if( textmod->m_Orient )
|
||||||
textmod->m_Orient = 3600 - textmod->m_Orient;
|
textmod->m_Orient = 3600 - textmod->m_Orient;
|
||||||
|
|
||||||
|
@ -803,7 +816,7 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnVerticalToolbar( wxCommandEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnVerticalToolbar( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
int id = aEvent.GetId();
|
int id = aEvent.GetId();
|
||||||
|
|
||||||
|
@ -840,7 +853,9 @@ void WinEDA_ModuleEditFrame::OnVerticalToolbar( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
case ID_MODEDIT_PAD_TOOL:
|
case ID_MODEDIT_PAD_TOOL:
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
|
{
|
||||||
SetToolID( id, wxCURSOR_PENCIL, _( "Add pad" ) );
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add pad" ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetToolID( id, wxCURSOR_ARROW, _( "Pad settings" ) );
|
SetToolID( id, wxCURSOR_ARROW, _( "Pad settings" ) );
|
||||||
|
|
|
@ -19,9 +19,8 @@
|
||||||
|
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
|
|
||||||
/* Handle the left click in footprint editor
|
|
||||||
*/
|
void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
|
|
||||||
|
@ -66,6 +65,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
|
if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
|
||||||
&& !wxGetKeyState( WXK_CONTROL ) )
|
&& !wxGetKeyState( WXK_CONTROL ) )
|
||||||
item = ModeditLocateAndDisplay();
|
item = ModeditLocateAndDisplay();
|
||||||
|
|
||||||
SetCurItem( item );
|
SetCurItem( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
|
|
||||||
if( GetToolId() == ID_MODEDIT_CIRCLE_TOOL )
|
if( GetToolId() == ID_MODEDIT_CIRCLE_TOOL )
|
||||||
shape = S_CIRCLE;
|
shape = S_CIRCLE;
|
||||||
|
|
||||||
if( GetToolId() == ID_MODEDIT_ARC_TOOL )
|
if( GetToolId() == ID_MODEDIT_ARC_TOOL )
|
||||||
shape = S_ARC;
|
shape = S_ARC;
|
||||||
|
|
||||||
|
@ -107,7 +108,9 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) item, DC, 0 ) );
|
SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) item, DC, 0 ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
DisplayError( this, wxT( "ProcessCommand error: item flags error" ) );
|
DisplayError( this, wxT( "ProcessCommand error: item flags error" ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -171,7 +174,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this, wxT( "WinEDA_ModuleEditFrame::ProcessCommand error" ) );
|
DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
|
||||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,11 +182,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Handle the right click in the footprint editor:
|
bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
|
||||||
* Create the pull up menu
|
|
||||||
* After this menu is built, the standard ZOOM menu is added
|
|
||||||
*/
|
|
||||||
bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
|
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -358,14 +357,14 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopM
|
||||||
case TYPE_SCREEN:
|
case TYPE_SCREEN:
|
||||||
case TYPE_NOT_INIT:
|
case TYPE_NOT_INIT:
|
||||||
case TYPE_PCB:
|
case TYPE_PCB:
|
||||||
msg.Printf( wxT( "WinEDA_ModuleEditFrame::OnRightClick Error: illegal DrawType %d" ),
|
msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
|
||||||
item->Type() );
|
item->Type() );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
msg.Printf( wxT( "WinEDA_ModuleEditFrame::OnRightClick Error: unknown DrawType %d" ),
|
msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
|
||||||
item->Type() );
|
item->Type() );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -386,10 +385,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Handle the double click in the footprint editor:
|
void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
* If the double clicked item is editable: call the corresponding editor.
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
|
|
||||||
|
@ -420,6 +416,7 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
int ret = dialog.ShowModal();
|
int ret = dialog.ShowModal();
|
||||||
GetScreen()->GetCurItem()->m_Flags = 0;
|
GetScreen()->GetCurItem()->m_Flags = 0;
|
||||||
DrawPanel->MoveCursorToCrossHair();
|
DrawPanel->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( ret > 0 )
|
if( ret > 0 )
|
||||||
DrawPanel->Refresh();
|
DrawPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,17 +13,9 @@
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
||||||
* Function SaveCopyInUndoList.
|
UNDO_REDO_T aTypeCommand,
|
||||||
* Creates a new entry in undo list of commands.
|
const wxPoint& aTransformPoint )
|
||||||
* add a picker to handle aItemToCopy
|
|
||||||
* @param aItem = the board item modified by the command to undo
|
|
||||||
* @param aTypeCommand = command type (see enum UNDO_REDO_T)
|
|
||||||
* @param aTransformPoint = the reference point of the transformation, for commands like move
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
|
||||||
UNDO_REDO_T aTypeCommand,
|
|
||||||
const wxPoint& aTransformPoint )
|
|
||||||
{
|
{
|
||||||
EDA_ITEM* item;
|
EDA_ITEM* item;
|
||||||
MODULE* CopyItem;
|
MODULE* CopyItem;
|
||||||
|
@ -47,31 +39,16 @@ void WinEDA_ModuleEditFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
||||||
* Function SaveCopyInUndoList (overloaded).
|
UNDO_REDO_T aTypeCommand,
|
||||||
* Creates a new entry in undo list of commands.
|
const wxPoint& aTransformPoint )
|
||||||
* add a list of pickers to handle a list of items
|
|
||||||
* @param aItemsList = the list of items modified by the command to undo
|
|
||||||
* @param aTypeCommand = command type (see enum UNDO_REDO_T)
|
|
||||||
* @param aTransformPoint = the reference point of the transformation, for commands like move
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
|
||||||
UNDO_REDO_T aTypeCommand,
|
|
||||||
const wxPoint& aTransformPoint )
|
|
||||||
{
|
{
|
||||||
// Currently unused in modedit, because the module itself is saved for each change
|
// Currently unused in modedit, because the module itself is saved for each change
|
||||||
wxMessageBox( wxT( "SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList..) not yet in use" ) );
|
wxMessageBox( wxT( "SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList..) not yet in use" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************/
|
void FOOTPRINT_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
|
||||||
void WinEDA_ModuleEditFrame::GetComponentFromRedoList( wxCommandEvent& event )
|
|
||||||
/********************************************************************************/
|
|
||||||
|
|
||||||
/* Redo the last edition:
|
|
||||||
* - Place the current edited library component in undo list
|
|
||||||
* - Get old version of the current edited library component
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
if( GetScreen()->GetRedoCommandCount() <= 0 )
|
if( GetScreen()->GetRedoCommandCount() <= 0 )
|
||||||
return;
|
return;
|
||||||
|
@ -99,14 +76,7 @@ void WinEDA_ModuleEditFrame::GetComponentFromRedoList( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
void FOOTPRINT_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
|
||||||
void WinEDA_ModuleEditFrame::GetComponentFromUndoList( wxCommandEvent& event )
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Undo the last edition:
|
|
||||||
* - Place the current edited library component in Redo list
|
|
||||||
* - Get old version of the current edited library component
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
if( GetScreen()->GetUndoCommandCount() <= 0 )
|
if( GetScreen()->GetUndoCommandCount() <= 0 )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
|
void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this,
|
DisplayError( this,
|
||||||
wxT( "WinEDA_ModuleEditFrame::OnSelectOptionToolbar error" ) );
|
wxT( "FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar error" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
|
|
||||||
/*********************************************************/
|
/*****************************************************/
|
||||||
/* class WinEDA_ModuleEditFrame: public EDA_DRAW_FRAME */
|
/* class FOOTPRINT_EDIT_FRAME: public EDA_DRAW_FRAME */
|
||||||
/* Class for the footprint editor */
|
/* Class for the footprint editor */
|
||||||
/*********************************************************/
|
/*****************************************************/
|
||||||
|
|
||||||
#ifndef _MODULE_EDITOR_FRAME_H_
|
#ifndef _MODULE_EDITOR_FRAME_H_
|
||||||
#define _MODULE_EDITOR_FRAME_H_
|
#define _MODULE_EDITOR_FRAME_H_
|
||||||
|
|
||||||
|
|
||||||
class WinEDA_ModuleEditFrame : public PCB_BASE_FRAME
|
class FOOTPRINT_EDIT_FRAME : public PCB_BASE_FRAME
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MODULE* CurrentModule;
|
MODULE* CurrentModule;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WinEDA_ModuleEditFrame( wxWindow* father,
|
FOOTPRINT_EDIT_FRAME( wxWindow* father,
|
||||||
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_ModuleEditFrame();
|
~FOOTPRINT_EDIT_FRAME();
|
||||||
|
|
||||||
void InstallOptionsFrame( const wxPoint& pos );
|
void InstallOptionsFrame( const wxPoint& pos );
|
||||||
|
|
||||||
|
@ -27,24 +27,69 @@ public:
|
||||||
void CloseModuleEditor( wxCommandEvent& Event );
|
void CloseModuleEditor( wxCommandEvent& Event );
|
||||||
|
|
||||||
void Process_Special_Functions( wxCommandEvent& event );
|
void Process_Special_Functions( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function RedrawActiveWindoow
|
||||||
|
* daws the footprint editor BOARD, and others elements : axis, grid ..
|
||||||
|
*/
|
||||||
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function ReCreateHToolbar
|
||||||
|
* create the main horizontal toolbar for the footprint editor
|
||||||
|
*/
|
||||||
void ReCreateHToolbar();
|
void ReCreateHToolbar();
|
||||||
|
|
||||||
void ReCreateVToolbar();
|
void ReCreateVToolbar();
|
||||||
void ReCreateOptToolbar();
|
void ReCreateOptToolbar();
|
||||||
void ReCreateAuxiliaryToolbar();
|
void ReCreateAuxiliaryToolbar();
|
||||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function OnLeftDClick
|
||||||
|
* handles the double click in the footprint editor:
|
||||||
|
* If the double clicked item is editable: call the corresponding editor.
|
||||||
|
*/
|
||||||
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function OnRightClick
|
||||||
|
* handles the right mouse click in the footprint editor:
|
||||||
|
* Create the pop up menu
|
||||||
|
* After this menu is built, the standard ZOOM menu is added
|
||||||
|
*/
|
||||||
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief (Re)Create the menubar for the module editor frame
|
||||||
|
*/
|
||||||
void ReCreateMenuBar();
|
void ReCreateMenuBar();
|
||||||
|
|
||||||
void ToolOnRightClick( wxCommandEvent& event );
|
void ToolOnRightClick( wxCommandEvent& event );
|
||||||
void OnSelectOptionToolbar( wxCommandEvent& event );
|
void OnSelectOptionToolbar( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function OnHotKey
|
||||||
|
* handle hot key events.
|
||||||
|
* <p?
|
||||||
|
* Some commands are relative to the item under the mouse cursor. Commands are
|
||||||
|
* case insensitive
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
EDA_ITEM* aItem = NULL );
|
EDA_ITEM* aItem = NULL );
|
||||||
|
|
||||||
bool OnHotkeyEditItem( int aIdCommand );
|
bool OnHotkeyEditItem( int aIdCommand );
|
||||||
bool OnHotkeyDeleteItem( int aIdCommand );
|
bool OnHotkeyDeleteItem( int aIdCommand );
|
||||||
bool OnHotkeyMoveItem( int aIdCommand );
|
bool OnHotkeyMoveItem( int aIdCommand );
|
||||||
bool OnHotkeyRotateItem( int aIdCommand );
|
bool OnHotkeyRotateItem( int aIdCommand );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Show3D_Frame
|
||||||
|
* displays 3D view of the footprint (module) being edited.
|
||||||
|
*/
|
||||||
void Show3D_Frame( wxCommandEvent& event );
|
void Show3D_Frame( wxCommandEvent& event );
|
||||||
|
|
||||||
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
||||||
void OnVerticalToolbar( wxCommandEvent& aEvent );
|
void OnVerticalToolbar( wxCommandEvent& aEvent );
|
||||||
|
|
||||||
|
@ -58,12 +103,12 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LoadModuleFromBoard
|
* Function LoadModuleFromBoard
|
||||||
* called from the main toolbar
|
* called from the main toolbar to load a footprint from board mainly to edit it.
|
||||||
* to load a footprint from board mainly to edit it
|
|
||||||
*/
|
*/
|
||||||
void LoadModuleFromBoard( wxCommandEvent& event );
|
void LoadModuleFromBoard( wxCommandEvent& event );
|
||||||
|
|
||||||
/** Virtual Function OnModify()
|
/**
|
||||||
|
* Virtual Function OnModify()
|
||||||
* Must be called after a footprint change
|
* Must be called after a footprint change
|
||||||
* in order to set the "modify" flag of the current screen
|
* in order to set the "modify" flag of the current screen
|
||||||
* and prepare, if needed the refresh of the 3D frame showing the footprint
|
* and prepare, if needed the refresh of the 3D frame showing the footprint
|
||||||
|
@ -77,7 +122,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void ToPrinter( wxCommandEvent& event );
|
void ToPrinter( wxCommandEvent& event );
|
||||||
|
|
||||||
/** Virtual function PrintPage
|
/**
|
||||||
|
* Virtual function PrintPage
|
||||||
* used to print a page
|
* used to print a page
|
||||||
* Print the page pointed by ActiveScreen, set by the calling print function
|
* Print the page pointed by ActiveScreen, set by the calling print function
|
||||||
* @param aDC = wxDC given by the calling print function
|
* @param aDC = wxDC given by the calling print function
|
||||||
|
@ -93,14 +139,32 @@ public:
|
||||||
/**
|
/**
|
||||||
* Function Clear_Pcb
|
* Function Clear_Pcb
|
||||||
* delete all and reinitialize the current board
|
* delete all and reinitialize the current board
|
||||||
* @param aQuery = true to prompt user for confirmation, false to
|
* @param aQuery = true to prompt user for confirmation, false to initialize silently
|
||||||
* initialize silently
|
|
||||||
*/
|
*/
|
||||||
bool Clear_Pcb( bool aQuery );
|
bool Clear_Pcb( bool aQuery );
|
||||||
|
|
||||||
/* handlers for block commands */
|
/* handlers for block commands */
|
||||||
virtual int ReturnBlockCommand( int key );
|
virtual int ReturnBlockCommand( int key );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function HandleBlockPlace
|
||||||
|
* handles the BLOCK PLACE command
|
||||||
|
* Last routine for block operation for:
|
||||||
|
* - block move & drag
|
||||||
|
* - block copy & paste
|
||||||
|
*/
|
||||||
virtual void HandleBlockPlace( wxDC* DC );
|
virtual void HandleBlockPlace( wxDC* DC );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function HandleBlockEnd( )
|
||||||
|
* Handle the "end" of a block command,
|
||||||
|
* i.e. is called at the end of the definition of the area of a block.
|
||||||
|
* depending on the current block command, this command is executed
|
||||||
|
* or parameters are initialized to prepare a call to HandleBlockPlace
|
||||||
|
* in GetScreen()->m_BlockLocate
|
||||||
|
* @return false if no item selected, or command finished,
|
||||||
|
* true if some items found and HandleBlockPlace must be called later
|
||||||
|
*/
|
||||||
virtual bool HandleBlockEnd( wxDC* DC );
|
virtual bool HandleBlockEnd( wxDC* DC );
|
||||||
|
|
||||||
BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 );
|
BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 );
|
||||||
|
@ -137,7 +201,20 @@ public:
|
||||||
private:
|
private:
|
||||||
static wxString m_CurrentLib;
|
static wxString m_CurrentLib;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetComponentFromUndoList
|
||||||
|
* performs an undo operation on the last edition:
|
||||||
|
* - Place the current edited library component in Redo list
|
||||||
|
* - Get old version of the current edited library component
|
||||||
|
*/
|
||||||
void GetComponentFromUndoList( wxCommandEvent& event );
|
void GetComponentFromUndoList( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fucntion GetComponentFromRedoList
|
||||||
|
* performs a redo operation on the the last edition:
|
||||||
|
* - Place the current edited library component in undo list
|
||||||
|
* - Get old version of the current edited library component
|
||||||
|
*/
|
||||||
void GetComponentFromRedoList( wxCommandEvent& event );
|
void GetComponentFromRedoList( wxCommandEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,6 +228,11 @@ public:
|
||||||
// Footprint edition
|
// Footprint edition
|
||||||
void Place_Ancre( MODULE* module );
|
void Place_Ancre( MODULE* module );
|
||||||
void RemoveStruct( EDA_ITEM* Item );
|
void RemoveStruct( EDA_ITEM* Item );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Transform
|
||||||
|
* performs a geometric transform on the current footprint.
|
||||||
|
*/
|
||||||
void Transform( MODULE* module, int transform );
|
void Transform( MODULE* module, int transform );
|
||||||
|
|
||||||
// importing / exporting Footprint
|
// importing / exporting Footprint
|
||||||
|
@ -167,6 +249,7 @@ public:
|
||||||
* false = use current path or last used path to export the footprint
|
* false = use current path or last used path to export the footprint
|
||||||
*/
|
*/
|
||||||
void Export_Module( MODULE* aModule, bool aCreateSysLib );
|
void Export_Module( MODULE* aModule, bool aCreateSysLib );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Import_Module
|
* Function Import_Module
|
||||||
* Read a file containing only one footprint.
|
* Read a file containing only one footprint.
|
||||||
|
@ -178,7 +261,6 @@ public:
|
||||||
*/
|
*/
|
||||||
MODULE* Import_Module( );
|
MODULE* Import_Module( );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Load_Module_From_BOARD
|
* Function Load_Module_From_BOARD
|
||||||
* load in Modedit a footfrint from the main board
|
* load in Modedit a footfrint from the main board
|
||||||
|
@ -205,10 +287,39 @@ public:
|
||||||
* the width of all footprint's edges
|
* the width of all footprint's edges
|
||||||
*/
|
*/
|
||||||
void Edit_Edge_Width( EDGE_MODULE* aEdge );
|
void Edit_Edge_Width( EDGE_MODULE* aEdge );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Edit_Edge_Layer
|
||||||
|
* changes the EDGE_MODULE Edge layer, (The new layer will be asked)
|
||||||
|
* if Edge == NULL change the layer of the entire footprint edges
|
||||||
|
* @param Edge = edge to edit, or NULL
|
||||||
|
*/
|
||||||
void Edit_Edge_Layer( EDGE_MODULE* Edge );
|
void Edit_Edge_Layer( EDGE_MODULE* Edge );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Delete_Edge_Module
|
||||||
|
* deletes EDGE_MODULE Edge
|
||||||
|
* @param Edge = edge to delete
|
||||||
|
*/
|
||||||
void Delete_Edge_Module( EDGE_MODULE* Edge );
|
void Delete_Edge_Module( EDGE_MODULE* Edge );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Begin_Edge_Module
|
||||||
|
* creates a new edge item (line, arc ..).
|
||||||
|
* @param Edge = if NULL: create new edge else terminate edge and create a
|
||||||
|
* new edge
|
||||||
|
* @param DC = current Device Context
|
||||||
|
* @param type_edge = S_SEGMENT,S_ARC ..
|
||||||
|
* @return the new created edge.
|
||||||
|
*/
|
||||||
EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge );
|
EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function End_Edge_Module
|
||||||
|
* terminates a move or create edge function
|
||||||
|
*/
|
||||||
void End_Edge_Module( EDGE_MODULE* Edge );
|
void End_Edge_Module( EDGE_MODULE* Edge );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Enter_Edge_Width
|
* Function Enter_Edge_Width
|
||||||
* Edition of width of module outlines
|
* Edition of width of module outlines
|
||||||
|
@ -218,7 +329,11 @@ public:
|
||||||
* changes ModuleSegmentWidth (global) = new width
|
* changes ModuleSegmentWidth (global) = new width
|
||||||
*/
|
*/
|
||||||
void Enter_Edge_Width( EDGE_MODULE* aEdge );
|
void Enter_Edge_Width( EDGE_MODULE* aEdge );
|
||||||
|
|
||||||
|
/* Function to initialise the move function params of a graphic item type DRAWSEGMENT */
|
||||||
void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC );
|
void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC );
|
||||||
|
|
||||||
|
/* Function to place a graphic item type EDGE_MODULE currently moved */
|
||||||
void Place_EdgeMod( EDGE_MODULE* drawitem );
|
void Place_EdgeMod( EDGE_MODULE* drawitem );
|
||||||
|
|
||||||
// handlers for libraries:
|
// handlers for libraries:
|
||||||
|
|
|
@ -19,106 +19,100 @@
|
||||||
#include "3d_viewer.h"
|
#include "3d_viewer.h"
|
||||||
|
|
||||||
|
|
||||||
static PCB_SCREEN* s_screenModule = NULL; // the PCB_SCREEN used by the
|
static PCB_SCREEN* s_screenModule = NULL; // the PCB_SCREEN used by the footprint editor
|
||||||
// footprint editor
|
|
||||||
|
|
||||||
// Design setting for the module editor:
|
// Design setting for the module editor:
|
||||||
static BOARD_DESIGN_SETTINGS s_ModuleEditorDesignSetting;
|
static BOARD_DESIGN_SETTINGS s_ModuleEditorDesignSetting;
|
||||||
|
|
||||||
wxString WinEDA_ModuleEditFrame::m_CurrentLib = wxEmptyString;
|
wxString FOOTPRINT_EDIT_FRAME::m_CurrentLib = wxEmptyString;
|
||||||
|
|
||||||
/********************************/
|
/******************************/
|
||||||
/* class WinEDA_ModuleEditFrame */
|
/* class FOOTPRINT_EDIT_FRAME */
|
||||||
/********************************/
|
/******************************/
|
||||||
BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, PCB_BASE_FRAME )
|
BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
|
||||||
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END,
|
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END,
|
||||||
PCB_BASE_FRAME::ProcessItemSelection )
|
PCB_BASE_FRAME::ProcessItemSelection )
|
||||||
EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow )
|
EVT_CLOSE( FOOTPRINT_EDIT_FRAME::OnCloseWindow )
|
||||||
EVT_MENU( wxID_EXIT, WinEDA_ModuleEditFrame::CloseModuleEditor )
|
EVT_MENU( wxID_EXIT, FOOTPRINT_EDIT_FRAME::CloseModuleEditor )
|
||||||
|
|
||||||
EVT_SIZE( WinEDA_ModuleEditFrame::OnSize )
|
EVT_SIZE( FOOTPRINT_EDIT_FRAME::OnSize )
|
||||||
|
|
||||||
EVT_COMBOBOX( ID_ON_ZOOM_SELECT, WinEDA_ModuleEditFrame::OnSelectZoom )
|
EVT_COMBOBOX( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom )
|
||||||
EVT_COMBOBOX( ID_ON_GRID_SELECT, WinEDA_ModuleEditFrame::OnSelectGrid )
|
EVT_COMBOBOX( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid )
|
||||||
|
|
||||||
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_DELETE_PART, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_DELETE_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_NEW_MODULE, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_NEW_MODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_LOAD_MODULE, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_LOAD_MODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_IMPORT_PART, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_IMPORT_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_EXPORT_PART, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_EXPORT_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
|
EVT_TOOL( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
|
||||||
WinEDA_ModuleEditFrame::Process_Special_Functions )
|
FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_SHEET_SET, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_SHEET_SET, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( wxID_PRINT, WinEDA_ModuleEditFrame::ToPrinter )
|
EVT_TOOL( wxID_PRINT, FOOTPRINT_EDIT_FRAME::ToPrinter )
|
||||||
EVT_TOOL( ID_MODEDIT_LOAD_MODULE, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_LOAD_MODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_CHECK, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_CHECK, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_PAD_SETTINGS, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_PAD_SETTINGS, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, WinEDA_ModuleEditFrame::LoadModuleFromBoard )
|
EVT_TOOL( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, FOOTPRINT_EDIT_FRAME::LoadModuleFromBoard )
|
||||||
EVT_TOOL( ID_MODEDIT_INSERT_MODULE_IN_BOARD, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_INSERT_MODULE_IN_BOARD, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_TOOL( wxID_UNDO, WinEDA_ModuleEditFrame::GetComponentFromUndoList )
|
EVT_TOOL( wxID_UNDO, FOOTPRINT_EDIT_FRAME::GetComponentFromUndoList )
|
||||||
EVT_TOOL( wxID_REDO, WinEDA_ModuleEditFrame::GetComponentFromRedoList )
|
EVT_TOOL( wxID_REDO, FOOTPRINT_EDIT_FRAME::GetComponentFromRedoList )
|
||||||
|
|
||||||
// Vertical tool bar button click event handler.
|
// Vertical tool bar button click event handler.
|
||||||
EVT_TOOL( ID_NO_TOOL_SELECTED, WinEDA_ModuleEditFrame::OnVerticalToolbar )
|
EVT_TOOL( ID_NO_TOOL_SELECTED, FOOTPRINT_EDIT_FRAME::OnVerticalToolbar )
|
||||||
EVT_TOOL_RANGE( ID_MODEDIT_PAD_TOOL, ID_MODEDIT_PLACE_GRID_COORD,
|
EVT_TOOL_RANGE( ID_MODEDIT_PAD_TOOL, ID_MODEDIT_PLACE_GRID_COORD,
|
||||||
WinEDA_ModuleEditFrame::OnVerticalToolbar )
|
FOOTPRINT_EDIT_FRAME::OnVerticalToolbar )
|
||||||
|
|
||||||
// Options Toolbar
|
// Options Toolbar
|
||||||
EVT_TOOL( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
|
EVT_TOOL( ID_TB_OPTIONS_SHOW_PADS_SKETCH, FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar )
|
||||||
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
|
EVT_TOOL( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar )
|
||||||
EVT_TOOL( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
|
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar )
|
||||||
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
|
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar )
|
||||||
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
|
|
||||||
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
|
|
||||||
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
|
|
||||||
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
|
|
||||||
|
|
||||||
// popup commands
|
// popup commands
|
||||||
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
|
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
|
||||||
WinEDA_ModuleEditFrame::Process_Special_Functions )
|
FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
|
|
||||||
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
|
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
|
||||||
WinEDA_ModuleEditFrame::Process_Special_Functions )
|
FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
|
|
||||||
// Module transformations
|
// Module transformations
|
||||||
EVT_MENU( ID_MODEDIT_MODULE_ROTATE, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_MENU( ID_MODEDIT_MODULE_ROTATE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_MENU( ID_MODEDIT_MODULE_MIRROR, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_MENU( ID_MODEDIT_MODULE_MIRROR, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
|
|
||||||
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_MENU( ID_PCB_PAD_SETUP, WinEDA_ModuleEditFrame::Process_Special_Functions )
|
EVT_MENU( ID_PCB_PAD_SETUP, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||||
EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions )
|
EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions )
|
||||||
|
|
||||||
// Menu 3D Frame
|
// Menu 3D Frame
|
||||||
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_ModuleEditFrame::Show3D_Frame )
|
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, FOOTPRINT_EDIT_FRAME::Show3D_Frame )
|
||||||
|
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_DELETE_PART, WinEDA_ModuleEditFrame::OnUpdateLibSelected )
|
EVT_UPDATE_UI( ID_MODEDIT_DELETE_PART, FOOTPRINT_EDIT_FRAME::OnUpdateLibSelected )
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_EXPORT_PART, WinEDA_ModuleEditFrame::OnUpdateModuleSelected )
|
EVT_UPDATE_UI( ID_MODEDIT_EXPORT_PART, FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected )
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
|
EVT_UPDATE_UI( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
|
||||||
WinEDA_ModuleEditFrame::OnUpdateModuleSelected )
|
FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected )
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_SAVE_LIBMODULE,
|
EVT_UPDATE_UI( ID_MODEDIT_SAVE_LIBMODULE, FOOTPRINT_EDIT_FRAME::OnUpdateLibAndModuleSelected )
|
||||||
WinEDA_ModuleEditFrame::OnUpdateLibAndModuleSelected )
|
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
|
EVT_UPDATE_UI( ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
|
||||||
WinEDA_ModuleEditFrame::OnUpdateLoadModuleFromBoard )
|
FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard )
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_INSERT_MODULE_IN_BOARD,
|
EVT_UPDATE_UI( ID_MODEDIT_INSERT_MODULE_IN_BOARD,
|
||||||
WinEDA_ModuleEditFrame::OnUpdateInsertModuleInBoard )
|
FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard )
|
||||||
EVT_UPDATE_UI( ID_MODEDIT_UPDATE_MODULE_IN_BOARD,
|
EVT_UPDATE_UI( ID_MODEDIT_UPDATE_MODULE_IN_BOARD,
|
||||||
WinEDA_ModuleEditFrame::OnUpdateReplaceModuleInBoard )
|
FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard )
|
||||||
EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, WinEDA_ModuleEditFrame::OnUpdateVerticalToolbar )
|
EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar )
|
||||||
EVT_UPDATE_UI_RANGE( ID_MODEDIT_PAD_TOOL, ID_MODEDIT_PLACE_GRID_COORD,
|
EVT_UPDATE_UI_RANGE( ID_MODEDIT_PAD_TOOL, ID_MODEDIT_PLACE_GRID_COORD,
|
||||||
WinEDA_ModuleEditFrame::OnUpdateVerticalToolbar )
|
FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar )
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
|
FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
|
||||||
const wxString& title,
|
const wxString& title,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style ) :
|
long style ) :
|
||||||
PCB_BASE_FRAME( father, MODULE_EDITOR_FRAME, wxEmptyString, pos, size, style )
|
PCB_BASE_FRAME( father, MODULE_EDITOR_FRAME, wxEmptyString, pos, size, style )
|
||||||
{
|
{
|
||||||
m_FrameName = wxT( "ModEditFrame" );
|
m_FrameName = wxT( "ModEditFrame" );
|
||||||
|
@ -196,7 +190,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WinEDA_ModuleEditFrame::~WinEDA_ModuleEditFrame()
|
FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME()
|
||||||
{
|
{
|
||||||
/* g_ModuleEditor_Pcb and its corresponding PCB_SCREEN are not deleted
|
/* g_ModuleEditor_Pcb and its corresponding PCB_SCREEN are not deleted
|
||||||
* here, because if we reopen the Footprint editor, we expect to find
|
* here, because if we reopen the Footprint editor, we expect to find
|
||||||
|
@ -211,7 +205,7 @@ WinEDA_ModuleEditFrame::~WinEDA_ModuleEditFrame()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnCloseWindow( wxCloseEvent& Event )
|
void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||||
{
|
{
|
||||||
if( GetScreen()->IsModify() )
|
if( GetScreen()->IsModify() )
|
||||||
{
|
{
|
||||||
|
@ -226,13 +220,13 @@ void WinEDA_ModuleEditFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::CloseModuleEditor( wxCommandEvent& Event )
|
void FOOTPRINT_EDIT_FRAME::CloseModuleEditor( wxCommandEvent& Event )
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
aEvent.Enable( GetBoard()->m_Modules != NULL );
|
aEvent.Enable( GetBoard()->m_Modules != NULL );
|
||||||
|
|
||||||
|
@ -241,25 +235,25 @@ void WinEDA_ModuleEditFrame::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateLibSelected( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateLibSelected( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
aEvent.Enable( m_CurrentLib != wxEmptyString );
|
aEvent.Enable( m_CurrentLib != wxEmptyString );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateModuleSelected( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
aEvent.Enable( GetBoard()->m_Modules != NULL );
|
aEvent.Enable( GetBoard()->m_Modules != NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateLibAndModuleSelected( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateLibAndModuleSelected( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
aEvent.Enable( ( m_CurrentLib != wxEmptyString ) && ( GetBoard()->m_Modules != NULL ) );
|
aEvent.Enable( ( m_CurrentLib != wxEmptyString ) && ( GetBoard()->m_Modules != NULL ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
||||||
|
|
||||||
|
@ -267,7 +261,7 @@ void WinEDA_ModuleEditFrame::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEven
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
||||||
|
|
||||||
|
@ -294,7 +288,7 @@ void WinEDA_ModuleEditFrame::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEven
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
|
||||||
|
|
||||||
|
@ -320,10 +314,7 @@ void WinEDA_ModuleEditFrame::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEve
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
|
||||||
* Display 3D frame of footprint (module) being edited.
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
|
|
||||||
{
|
{
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
{
|
{
|
||||||
|
@ -331,6 +322,7 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
|
||||||
// This should work on any platform.
|
// This should work on any platform.
|
||||||
if( m_Draw3DFrame->IsIconized() )
|
if( m_Draw3DFrame->IsIconized() )
|
||||||
m_Draw3DFrame->Iconize( false );
|
m_Draw3DFrame->Iconize( false );
|
||||||
|
|
||||||
m_Draw3DFrame->Raise();
|
m_Draw3DFrame->Raise();
|
||||||
|
|
||||||
// Raising the window does not set the focus on Linux. This should work on any platform.
|
// Raising the window does not set the focus on Linux. This should work on any platform.
|
||||||
|
@ -345,7 +337,7 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
|
void FOOTPRINT_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
|
||||||
{
|
{
|
||||||
wxRealPoint gridSize;
|
wxRealPoint gridSize;
|
||||||
wxPoint oldpos;
|
wxPoint oldpos;
|
||||||
|
@ -420,14 +412,7 @@ void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::OnModify()
|
||||||
* Function OnModify() (virtual)
|
|
||||||
* Must be called after a change
|
|
||||||
* in order to set the "modify" flag of the current screen
|
|
||||||
* and prepare, if needed the refresh of the 3D frame showing the footprint
|
|
||||||
* do not forget to call the basic OnModify function to update auxiliary info
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::OnModify()
|
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME::OnModify();
|
PCB_BASE_FRAME::OnModify();
|
||||||
|
|
||||||
|
@ -436,10 +421,31 @@ void WinEDA_ModuleEditFrame::OnModify()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::UpdateTitle()
|
void FOOTPRINT_EDIT_FRAME::UpdateTitle()
|
||||||
{
|
{
|
||||||
|
wxString title = _( "Module Editor " );
|
||||||
|
|
||||||
if( m_CurrentLib.IsEmpty() )
|
if( m_CurrentLib.IsEmpty() )
|
||||||
SetTitle( _( "Module Editor (no active library)" ) );
|
{
|
||||||
|
title += _( "(no active library)" );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
SetTitle( _( "Module Editor (active library: " ) + m_CurrentLib + wxT( ")" ) );
|
{
|
||||||
|
wxFileName fileName = wxFileName( wxEmptyString, m_CurrentLib, ModuleFileExtension );
|
||||||
|
fileName = wxGetApp().FindLibraryPath( fileName );
|
||||||
|
|
||||||
|
if( !fileName.IsOk() || !fileName.FileExists() )
|
||||||
|
{
|
||||||
|
title += _( "(no active library)" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title = _( "Module Editor (active library: " ) + fileName.GetFullPath() + wxT( ")" );
|
||||||
|
|
||||||
|
if( !fileName.IsFileWritable() )
|
||||||
|
title += _( " [Read Only]" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "pcbstruct.h" // enum PCB_VISIBLE
|
#include "pcbstruct.h" // enum PCB_VISIBLE
|
||||||
#include "collectors.h"
|
#include "collectors.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
|
#include "build_version.h"
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "pcbnew_id.h"
|
#include "pcbnew_id.h"
|
||||||
#include "drc_stuff.h"
|
#include "drc_stuff.h"
|
||||||
|
@ -477,9 +478,6 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display 3D frame of current printed circuit board.
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
|
void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
|
@ -502,9 +500,6 @@ void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the Design Rules Editor.
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
|
void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
DIALOG_DESIGN_RULES dR_editor( this );
|
DIALOG_DESIGN_RULES dR_editor( this );
|
||||||
|
@ -574,54 +569,30 @@ void PCB_EDIT_FRAME::SaveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function IsGridVisible() , virtual
|
|
||||||
* @return true if the grid must be shown
|
|
||||||
*/
|
|
||||||
bool PCB_EDIT_FRAME::IsGridVisible()
|
bool PCB_EDIT_FRAME::IsGridVisible()
|
||||||
{
|
{
|
||||||
return IsElementVisible( GRID_VISIBLE );
|
return IsElementVisible( GRID_VISIBLE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetGridVisibility() , virtual
|
|
||||||
* It may be overloaded by derived classes
|
|
||||||
* if you want to store/retrieve the grid visibility in configuration.
|
|
||||||
* @param aVisible = true if the grid must be shown
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SetGridVisibility(bool aVisible)
|
void PCB_EDIT_FRAME::SetGridVisibility(bool aVisible)
|
||||||
{
|
{
|
||||||
SetElementVisibility( GRID_VISIBLE, aVisible );
|
SetElementVisibility( GRID_VISIBLE, aVisible );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetGridColor() , virtual
|
|
||||||
* @return the color of the grid
|
|
||||||
*/
|
|
||||||
int PCB_EDIT_FRAME::GetGridColor()
|
int PCB_EDIT_FRAME::GetGridColor()
|
||||||
{
|
{
|
||||||
return GetBoard()->GetVisibleElementColor( GRID_VISIBLE );
|
return GetBoard()->GetVisibleElementColor( GRID_VISIBLE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetGridColor() , virtual
|
|
||||||
* @param aColor = the new color of the grid
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SetGridColor(int aColor)
|
void PCB_EDIT_FRAME::SetGridColor(int aColor)
|
||||||
{
|
{
|
||||||
GetBoard()->SetVisibleElementColor( GRID_VISIBLE, aColor );
|
GetBoard()->SetVisibleElementColor( GRID_VISIBLE, aColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Return true if a microvia can be put on board
|
|
||||||
* A microvia is a small via restricted to 2 near neighbor layers
|
|
||||||
* because its is hole is made by laser which can penetrate only one layer
|
|
||||||
* It is mainly used to connect BGA to the first inner layer
|
|
||||||
* And it is allowed from an external layer to the first inner layer
|
|
||||||
*/
|
|
||||||
bool PCB_EDIT_FRAME::IsMicroViaAcceptable( void )
|
bool PCB_EDIT_FRAME::IsMicroViaAcceptable( void )
|
||||||
{
|
{
|
||||||
int copperlayercnt = GetBoard()->GetCopperLayerCount( );
|
int copperlayercnt = GetBoard()->GetCopperLayerCount( );
|
||||||
|
@ -658,13 +629,6 @@ void PCB_EDIT_FRAME::unitsChangeRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetElementVisibility
|
|
||||||
* changes the visibility of an element category
|
|
||||||
* @param aPCB_VISIBLE is from the enum by the same name
|
|
||||||
* @param aNewState = The new visibility state of the element category
|
|
||||||
* @see enum PCB_VISIBLE
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SetElementVisibility( int aPCB_VISIBLE, bool aNewState )
|
void PCB_EDIT_FRAME::SetElementVisibility( int aPCB_VISIBLE, bool aNewState )
|
||||||
{
|
{
|
||||||
GetBoard()->SetElementVisibility( aPCB_VISIBLE, aNewState );
|
GetBoard()->SetElementVisibility( aPCB_VISIBLE, aNewState );
|
||||||
|
@ -672,10 +636,6 @@ void PCB_EDIT_FRAME::SetElementVisibility( int aPCB_VISIBLE, bool aNewState )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetVisibleAlls
|
|
||||||
* Set the status of all visible element categories and layers to VISIBLE
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SetVisibleAlls( )
|
void PCB_EDIT_FRAME::SetVisibleAlls( )
|
||||||
{
|
{
|
||||||
GetBoard()->SetVisibleAlls( );
|
GetBoard()->SetVisibleAlls( );
|
||||||
|
@ -685,10 +645,6 @@ void PCB_EDIT_FRAME::SetVisibleAlls( )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetLanguage
|
|
||||||
* called on a language menu selection
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
|
void PCB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
EDA_DRAW_FRAME::SetLanguage( event );
|
EDA_DRAW_FRAME::SetLanguage( event );
|
||||||
|
@ -731,13 +687,6 @@ void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function OnModify() (virtual)
|
|
||||||
* Must be called after a change
|
|
||||||
* in order to set the "modify" flag of the current screen
|
|
||||||
* and prepare, if needed the refresh of the 3D frame showing the footprint
|
|
||||||
* do not forget to call the basic OnModify function to update auxiliary info
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::OnModify( )
|
void PCB_EDIT_FRAME::OnModify( )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME::OnModify();
|
PCB_BASE_FRAME::OnModify();
|
||||||
|
@ -747,12 +696,32 @@ void PCB_EDIT_FRAME::OnModify( )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Prepare the data structures of print management
|
|
||||||
* And displays the dialog window management of printing sheets
|
|
||||||
*/
|
|
||||||
void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
|
void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
DIALOG_SVG_PRINT frame( this );
|
DIALOG_SVG_PRINT frame( this );
|
||||||
|
|
||||||
frame.ShowModal();
|
frame.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PCB_EDIT_FRAME::UpdateTitle()
|
||||||
|
{
|
||||||
|
wxString title;
|
||||||
|
wxFileName fileName = GetScreen()->GetFileName();
|
||||||
|
|
||||||
|
if( fileName.IsOk() && fileName.FileExists() )
|
||||||
|
{
|
||||||
|
title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
||||||
|
wxT( " " ) + fileName.GetFullPath();
|
||||||
|
|
||||||
|
if( !fileName.IsFileWritable() )
|
||||||
|
title += _( " [Read Only]" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
||||||
|
wxT( " " ) + _( " [no file]" );
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTitle( title );
|
||||||
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ void WinEDA_App::MacOpenFile( const wxString& fileName )
|
||||||
if( !filename.FileExists() )
|
if( !filename.FileExists() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
frame->LoadOnePcbFile( fileName, FALSE );
|
frame->LoadOnePcbFile( fileName, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ bool WinEDA_App::OnInit()
|
||||||
|
|
||||||
if( m_Checker && m_Checker->IsAnotherRunning() )
|
if( m_Checker && m_Checker->IsAnotherRunning() )
|
||||||
{
|
{
|
||||||
if( !IsOK( NULL, _( "Pcbnew is already running, Continue?" ) ) )
|
if( !IsOK( NULL, _( "PCBnew is already running, Continue?" ) ) )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ bool WinEDA_App::OnInit()
|
||||||
|
|
||||||
if( fn.GetExt() != PcbFileExtension )
|
if( fn.GetExt() != PcbFileExtension )
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT( "PcbNew file <%s> has the wrong extension. \
|
wxLogDebug( wxT( "PCBNew file <%s> has the wrong extension. \
|
||||||
Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
fn.SetExt( PcbFileExtension );
|
fn.SetExt( PcbFileExtension );
|
||||||
}
|
}
|
||||||
|
@ -123,12 +123,12 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
|
|
||||||
g_DrawBgColor = BLACK;
|
g_DrawBgColor = BLACK;
|
||||||
|
|
||||||
/* Must be called before creating the main frame in order to
|
/* Must be called before creating the main frame in order to
|
||||||
* display the real hotkeys in menus or tool tips */
|
* display the real hotkeys in menus or tool tips */
|
||||||
ReadHotkeyConfig( wxT("PcbFrame"), g_Board_Editor_Hokeys_Descr );
|
ReadHotkeyConfig( wxT("PcbFrame"), g_Board_Editor_Hokeys_Descr );
|
||||||
|
|
||||||
frame = new PCB_EDIT_FRAME( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
|
frame = new PCB_EDIT_FRAME( NULL, wxT( "PCBNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
|
||||||
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
|
frame->UpdateTitle();
|
||||||
|
|
||||||
SetTopWindow( frame );
|
SetTopWindow( frame );
|
||||||
frame->Show( true );
|
frame->Show( true );
|
||||||
|
@ -144,17 +144,17 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
/* Load file specified in the command line. */
|
/* Load file specified in the command line. */
|
||||||
if( fn.IsOk() )
|
if( fn.IsOk() )
|
||||||
{
|
{
|
||||||
/* Note the first time Pcbnew is called after creating a new project
|
/* Note the first time PCBnew is called after creating a new project
|
||||||
* the board file may not exists
|
* the board file may not exists
|
||||||
* So we load settings only
|
* So we load settings only
|
||||||
*/
|
*/
|
||||||
if( fn.FileExists() )
|
if( fn.FileExists() )
|
||||||
frame->LoadOnePcbFile( fn.GetFullPath() );
|
frame->LoadOnePcbFile( fn.GetFullPath() );
|
||||||
else
|
else
|
||||||
{ // File does not exists: prepare an empty board
|
{ // File does not exists: prepare an empty board
|
||||||
wxSetWorkingDirectory( fn.GetPath() );
|
wxSetWorkingDirectory( fn.GetPath() );
|
||||||
frame->GetScreen()->SetFileName( fn.GetFullPath( wxPATH_UNIX ) );
|
frame->GetScreen()->SetFileName( fn.GetFullPath( wxPATH_UNIX ) );
|
||||||
frame->SetTitle( frame->GetScreen()->GetFileName() );
|
frame->UpdateTitle();
|
||||||
frame->UpdateFileHistory( frame->GetScreen()->GetFileName() );
|
frame->UpdateFileHistory( frame->GetScreen()->GetFileName() );
|
||||||
frame->OnModify(); // Ready to save the new empty board
|
frame->OnModify(); // Ready to save the new empty board
|
||||||
g_SaveTime = time( NULL ); // Init the time out to save the board
|
g_SaveTime = time( NULL ); // Init the time out to save the board
|
||||||
|
|
|
@ -20,19 +20,10 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
int aDraw_mode, int aMasklayer,
|
int aDraw_mode, int aMasklayer,
|
||||||
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt );
|
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt );
|
||||||
|
|
||||||
/**
|
void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
* Function PrintPage
|
int aPrintMaskLayer,
|
||||||
* Used to print the board (on printer, or when creating SVF files).
|
bool aPrintMirrorMode,
|
||||||
* Print the board, but only layers allowed by aPrintMaskLayer
|
void * aData)
|
||||||
* @param aDC = the print device context
|
|
||||||
* @param aPrintMaskLayer = a 32 bits mask: bit n = 1 -> layer n is printed
|
|
||||||
* @param aPrintMirrorMode = true to plot mirrored
|
|
||||||
* @param aData = a pointer to an optional data (NULL if not used)
|
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC,
|
|
||||||
int aPrintMaskLayer,
|
|
||||||
bool aPrintMirrorMode,
|
|
||||||
void * aData)
|
|
||||||
{
|
{
|
||||||
MODULE* Module;
|
MODULE* Module;
|
||||||
int drawmode = GR_COPY;
|
int drawmode = GR_COPY;
|
||||||
|
@ -42,6 +33,7 @@ void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC,
|
||||||
|
|
||||||
PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null
|
PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null
|
||||||
PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
|
PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
|
||||||
|
|
||||||
if( printParameters )
|
if( printParameters )
|
||||||
defaultPenSize = printParameters->m_PenDefaultSize;
|
defaultPenSize = printParameters->m_PenDefaultSize;
|
||||||
|
|
||||||
|
@ -67,9 +59,9 @@ void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC,
|
||||||
|
|
||||||
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
||||||
|
|
||||||
// The OR mode is used in color mode, but be aware the backgroud *must be
|
// The OR mode is used in color mode, but be aware the background *must be
|
||||||
// BLACK. In the print page dialog, we first print in BLACK, and after
|
// BLACK. In the print page dialog, we first print in BLACK, and after
|
||||||
// reprint in color, on the black "local" backgroud, in OR mode the black
|
// reprint in color, on the black "local" background, in OR mode the black
|
||||||
// print is not made before, only a white page is printed
|
// print is not made before, only a white page is printed
|
||||||
if( GetGRForceBlackPenState() == false )
|
if( GetGRForceBlackPenState() == false )
|
||||||
drawmode = GR_OR;
|
drawmode = GR_OR;
|
||||||
|
@ -92,6 +84,7 @@ void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC,
|
||||||
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
||||||
Module->Move( -offset );
|
Module->Move( -offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
D_PAD::m_PadSketchModePenSize = tmp;
|
D_PAD::m_PadSketchModePenSize = tmp;
|
||||||
|
|
||||||
DrawPanel->m_PrintIsMirrored = false;
|
DrawPanel->m_PrintIsMirrored = false;
|
||||||
|
@ -166,8 +159,8 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
}
|
}
|
||||||
|
|
||||||
// pads on Silkscreen layer are usually plot in sketch mode:
|
// pads on Silkscreen layer are usually plot in sketch mode:
|
||||||
if( (GetScreen()->m_Active_Layer == SILKSCREEN_N_BACK) ||
|
if( (GetScreen()->m_Active_Layer == SILKSCREEN_N_BACK)
|
||||||
(GetScreen()->m_Active_Layer == SILKSCREEN_N_FRONT) )
|
|| (GetScreen()->m_Active_Layer == SILKSCREEN_N_FRONT) )
|
||||||
DisplayOpt.DisplayPadFill = false;
|
DisplayOpt.DisplayPadFill = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -181,8 +174,8 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
||||||
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
||||||
m_DisplayPadNum = DisplayOpt.DisplayPadNum = false;
|
m_DisplayPadNum = DisplayOpt.DisplayPadNum = false;
|
||||||
bool nctmp = GetBoard()->IsElementVisible(NO_CONNECTS_VISIBLE);
|
bool nctmp = GetBoard()->IsElementVisible( NO_CONNECTS_VISIBLE );
|
||||||
GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, false);
|
GetBoard()->SetElementVisibility( NO_CONNECTS_VISIBLE, false );
|
||||||
DisplayOpt.DisplayPadIsol = false;
|
DisplayOpt.DisplayPadIsol = false;
|
||||||
m_DisplayModEdge = DisplayOpt.DisplayModEdge = FILLED;
|
m_DisplayModEdge = DisplayOpt.DisplayModEdge = FILLED;
|
||||||
m_DisplayModText = DisplayOpt.DisplayModText = FILLED;
|
m_DisplayModText = DisplayOpt.DisplayModText = FILLED;
|
||||||
|
@ -194,15 +187,16 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
|
|
||||||
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
||||||
|
|
||||||
// The OR mode is used in color mode, but be aware the backgroud *must be
|
// The OR mode is used in color mode, but be aware the background *must be
|
||||||
// BLACK. In the print page dialog, we first print in BLACK, and after
|
// BLACK. In the print page dialog, we first print in BLACK, and after
|
||||||
// reprint in color, on the black "local" backgroud, in OR mode the black
|
// reprint in color, on the black "local" background, in OR mode the black
|
||||||
// print is not made before, only a white page is printed
|
// print is not made before, only a white page is printed
|
||||||
if( GetGRForceBlackPenState() == false )
|
if( GetGRForceBlackPenState() == false )
|
||||||
drawmode = GR_OR;
|
drawmode = GR_OR;
|
||||||
|
|
||||||
/* Print the pcb graphic items (texts, ...) */
|
/* Print the pcb graphic items (texts, ...) */
|
||||||
GRSetDrawMode( aDC, drawmode );
|
GRSetDrawMode( aDC, drawmode );
|
||||||
|
|
||||||
for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() )
|
||||||
{
|
{
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
|
@ -225,10 +219,12 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
|
|
||||||
/* Print tracks */
|
/* Print tracks */
|
||||||
pt_piste = Pcb->m_Track;
|
pt_piste = Pcb->m_Track;
|
||||||
|
|
||||||
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
||||||
{
|
{
|
||||||
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
|
if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
|
||||||
{
|
{
|
||||||
int rayon = pt_piste->m_Width >> 1;
|
int rayon = pt_piste->m_Width >> 1;
|
||||||
|
@ -241,22 +237,26 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
0, color, color );
|
0, color, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
pt_piste->Draw( DrawPanel, aDC, drawmode );
|
pt_piste->Draw( DrawPanel, aDC, drawmode );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pt_piste = Pcb->m_Zone;
|
pt_piste = Pcb->m_Zone;
|
||||||
|
|
||||||
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
||||||
{
|
{
|
||||||
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pt_piste->Draw( DrawPanel, aDC, drawmode );
|
pt_piste->Draw( DrawPanel, aDC, drawmode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Draw filled areas (i.e. zones) */
|
/* Draw filled areas (i.e. zones) */
|
||||||
for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ )
|
for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ )
|
||||||
{
|
{
|
||||||
ZONE_CONTAINER* zone = Pcb->GetArea( ii );
|
ZONE_CONTAINER* zone = Pcb->GetArea( ii );
|
||||||
|
|
||||||
if( ( aPrintMaskLayer & ( 1 << zone->GetLayer() ) ) == 0 )
|
if( ( aPrintMaskLayer & ( 1 << zone->GetLayer() ) ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -268,10 +268,12 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
Module = (MODULE*) Pcb->m_Modules;
|
Module = (MODULE*) Pcb->m_Modules;
|
||||||
int tmp = D_PAD::m_PadSketchModePenSize;
|
int tmp = D_PAD::m_PadSketchModePenSize;
|
||||||
D_PAD::m_PadSketchModePenSize = defaultPenSize;
|
D_PAD::m_PadSketchModePenSize = defaultPenSize;
|
||||||
|
|
||||||
for( ; Module != NULL; Module = Module->Next() )
|
for( ; Module != NULL; Module = Module->Next() )
|
||||||
{
|
{
|
||||||
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
||||||
}
|
}
|
||||||
|
|
||||||
D_PAD::m_PadSketchModePenSize = tmp;
|
D_PAD::m_PadSketchModePenSize = tmp;
|
||||||
|
|
||||||
/* Print via holes in bg color: Not sure it is good for buried or blind
|
/* Print via holes in bg color: Not sure it is good for buried or blind
|
||||||
|
@ -283,23 +285,28 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
||||||
bool blackpenstate = GetGRForceBlackPenState();
|
bool blackpenstate = GetGRForceBlackPenState();
|
||||||
GRForceBlackPen( false );
|
GRForceBlackPen( false );
|
||||||
GRSetDrawMode( aDC, GR_COPY );
|
GRSetDrawMode( aDC, GR_COPY );
|
||||||
|
|
||||||
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
||||||
{
|
{
|
||||||
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
|
if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
|
||||||
{
|
{
|
||||||
int diameter;
|
int diameter;
|
||||||
|
|
||||||
if( drillShapeOpt == PRINT_PARAMETERS::SMALL_DRILL_SHAPE )
|
if( drillShapeOpt == PRINT_PARAMETERS::SMALL_DRILL_SHAPE )
|
||||||
diameter = min( SMALL_DRILL, pt_piste->GetDrillValue());
|
diameter = min( SMALL_DRILL, pt_piste->GetDrillValue() );
|
||||||
else
|
else
|
||||||
diameter = pt_piste->GetDrillValue();
|
diameter = pt_piste->GetDrillValue();
|
||||||
|
|
||||||
GRFilledCircle( &DrawPanel->m_ClipBox, aDC,
|
GRFilledCircle( &DrawPanel->m_ClipBox, aDC,
|
||||||
pt_piste->m_Start.x, pt_piste->m_Start.y,
|
pt_piste->m_Start.x, pt_piste->m_Start.y,
|
||||||
diameter/2,
|
diameter/2,
|
||||||
0, color, color );
|
0, color, color );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GRForceBlackPen( blackpenstate );
|
GRForceBlackPen( blackpenstate );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,8 +340,10 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
{
|
{
|
||||||
if( (pt_pad->m_Masque_Layer & aMasklayer ) == 0 )
|
if( (pt_pad->m_Masque_Layer & aMasklayer ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Manage hole according to the print drill option
|
// Manage hole according to the print drill option
|
||||||
wxSize drill_tmp = pt_pad->m_Drill;
|
wxSize drill_tmp = pt_pad->m_Drill;
|
||||||
|
|
||||||
switch ( aDrillShapeOpt )
|
switch ( aDrillShapeOpt )
|
||||||
{
|
{
|
||||||
case PRINT_PARAMETERS::NO_DRILL_SHAPE:
|
case PRINT_PARAMETERS::NO_DRILL_SHAPE:
|
||||||
|
@ -348,6 +357,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
// Do nothing
|
// Do nothing
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pt_pad->Draw( aPanel, aDC, aDraw_mode );
|
pt_pad->Draw( aPanel, aDC, aDraw_mode );
|
||||||
pt_pad->m_Drill = drill_tmp;
|
pt_pad->m_Drill = drill_tmp;
|
||||||
}
|
}
|
||||||
|
@ -355,6 +365,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
/* Print footprint graphic shapes */
|
/* Print footprint graphic shapes */
|
||||||
PtStruct = aModule->m_Drawings;
|
PtStruct = aModule->m_Drawings;
|
||||||
mlayer = g_TabOneLayerMask[aModule->GetLayer()];
|
mlayer = g_TabOneLayerMask[aModule->GetLayer()];
|
||||||
|
|
||||||
if( aModule->GetLayer() == LAYER_N_BACK )
|
if( aModule->GetLayer() == LAYER_N_BACK )
|
||||||
mlayer = SILKSCREEN_LAYER_BACK;
|
mlayer = SILKSCREEN_LAYER_BACK;
|
||||||
else if( aModule->GetLayer() == LAYER_N_FRONT )
|
else if( aModule->GetLayer() == LAYER_N_FRONT )
|
||||||
|
@ -364,6 +375,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
{
|
{
|
||||||
if( !aModule->m_Reference->m_NoShow )
|
if( !aModule->m_Reference->m_NoShow )
|
||||||
aModule->m_Reference->Draw( aPanel, aDC, aDraw_mode );
|
aModule->m_Reference->Draw( aPanel, aDC, aDraw_mode );
|
||||||
|
|
||||||
if( !aModule->m_Value->m_NoShow )
|
if( !aModule->m_Value->m_NoShow )
|
||||||
aModule->m_Value->Draw( aPanel, aDC, aDraw_mode );
|
aModule->m_Value->Draw( aPanel, aDC, aDraw_mode );
|
||||||
}
|
}
|
||||||
|
@ -373,7 +385,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
switch( PtStruct->Type() )
|
switch( PtStruct->Type() )
|
||||||
{
|
{
|
||||||
case TYPE_TEXTE_MODULE:
|
case TYPE_TEXTE_MODULE:
|
||||||
if( (mlayer & aMasklayer ) == 0 )
|
if( ( mlayer & aMasklayer ) == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
TextMod = (TEXTE_MODULE*) PtStruct;
|
TextMod = (TEXTE_MODULE*) PtStruct;
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Create the main horizontal toolbar for the footprint editor */
|
void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
|
||||||
void WinEDA_ModuleEditFrame::ReCreateHToolbar()
|
|
||||||
{
|
{
|
||||||
if( m_HToolBar != NULL )
|
if( m_HToolBar != NULL )
|
||||||
return;
|
return;
|
||||||
|
@ -111,13 +110,12 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
|
||||||
wxBitmap( module_check_xpm ),
|
wxBitmap( module_check_xpm ),
|
||||||
_( "Check module" ) );
|
_( "Check module" ) );
|
||||||
|
|
||||||
// after adding the buttons to the toolbar, must call Realize() to reflect
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
||||||
// the changes
|
|
||||||
m_HToolBar->Realize();
|
m_HToolBar->Realize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::ReCreateVToolbar()
|
void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar()
|
||||||
{
|
{
|
||||||
if( m_VToolBar )
|
if( m_VToolBar )
|
||||||
return;
|
return;
|
||||||
|
@ -163,7 +161,7 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
|
void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
|
||||||
{
|
{
|
||||||
if( m_OptionsToolBar )
|
if( m_OptionsToolBar )
|
||||||
return;
|
return;
|
||||||
|
@ -206,7 +204,7 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar()
|
void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void PCB_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event )
|
void FOOTPRINT_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
int id = event.GetSelection();
|
int id = event.GetSelection();
|
||||||
|
|
|
@ -33,9 +33,7 @@ static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module,
|
||||||
int ox, int oy, int MasqueLayer, int draw_mode );
|
int ox, int oy, int MasqueLayer, int draw_mode );
|
||||||
|
|
||||||
|
|
||||||
/* Draw the footprint editor BOARD, and others elements : axis, grid ..
|
void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
*/
|
|
||||||
void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|
||||||
{
|
{
|
||||||
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
|
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
|
||||||
|
|
||||||
|
@ -54,7 +52,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_WX_OVERLAY
|
#ifdef USE_WX_OVERLAY
|
||||||
if(IsShown())
|
if( IsShown() )
|
||||||
{
|
{
|
||||||
DrawPanel->m_overlay.Reset();
|
DrawPanel->m_overlay.Reset();
|
||||||
wxDCOverlay overlaydc( DrawPanel->m_overlay, (wxWindowDC*)DC );
|
wxDCOverlay overlaydc( DrawPanel->m_overlay, (wxWindowDC*)DC );
|
||||||
|
@ -63,7 +61,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( DrawPanel->IsMouseCaptured() )
|
if( DrawPanel->IsMouseCaptured() )
|
||||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
|
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||||
|
|
||||||
/* Redraw the cursor */
|
/* Redraw the cursor */
|
||||||
DrawPanel->DrawCrossHair( DC );
|
DrawPanel->DrawCrossHair( DC );
|
||||||
|
@ -99,7 +97,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( DrawPanel->IsMouseCaptured() )
|
if( DrawPanel->IsMouseCaptured() )
|
||||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
|
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||||
|
|
||||||
// Redraw the cursor
|
// Redraw the cursor
|
||||||
DrawPanel->DrawCrossHair( DC );
|
DrawPanel->DrawCrossHair( DC );
|
||||||
|
@ -107,8 +105,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
|
|
||||||
|
|
||||||
/* Redraw the BOARD items but not cursors, axis or grid */
|
/* Redraw the BOARD items but not cursors, axis or grid */
|
||||||
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC,
|
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, int aDrawMode, const wxPoint& offset )
|
||||||
int aDrawMode, const wxPoint& offset )
|
|
||||||
{
|
{
|
||||||
/* The order of drawing is flexible on some systems and not on others. For
|
/* The order of drawing is flexible on some systems and not on others. For
|
||||||
* OSes which use OR to draw, the order is not important except for the
|
* OSes which use OR to draw, the order is not important except for the
|
||||||
|
@ -180,14 +177,14 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC,
|
||||||
if( !IsElementVisible( PCB_VISIBLE(MOD_FR_VISIBLE) ) )
|
if( !IsElementVisible( PCB_VISIBLE(MOD_FR_VISIBLE) ) )
|
||||||
{
|
{
|
||||||
if( module->GetLayer() == LAYER_N_FRONT )
|
if( module->GetLayer() == LAYER_N_FRONT )
|
||||||
display = FALSE;
|
display = false;
|
||||||
layerMask &= ~LAYER_FRONT;
|
layerMask &= ~LAYER_FRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !IsElementVisible( PCB_VISIBLE(MOD_BK_VISIBLE) ) )
|
if( !IsElementVisible( PCB_VISIBLE(MOD_BK_VISIBLE) ) )
|
||||||
{
|
{
|
||||||
if( module->GetLayer() == LAYER_N_BACK )
|
if( module->GetLayer() == LAYER_N_BACK )
|
||||||
display = FALSE;
|
display = false;
|
||||||
layerMask &= ~LAYER_BACK;
|
layerMask &= ~LAYER_BACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,8 +197,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC,
|
||||||
if( IsHightLightNetON() )
|
if( IsHightLightNetON() )
|
||||||
DrawHighLight( aPanel, DC, GetHightLightNetCode() );
|
DrawHighLight( aPanel, DC, GetHightLightNetCode() );
|
||||||
|
|
||||||
// draw the BOARD's markers last, otherwise the high light will erase
|
// draw the BOARD's markers last, otherwise the high light will erase any marker on a pad
|
||||||
// any marker on a pad
|
|
||||||
for( unsigned i=0; i < m_markers.size(); ++i )
|
for( unsigned i=0; i < m_markers.size(); ++i )
|
||||||
{
|
{
|
||||||
m_markers[i]->Draw( aPanel, DC, aDrawMode );
|
m_markers[i]->Draw( aPanel, DC, aDrawMode );
|
||||||
|
@ -220,6 +216,7 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* DC, int aNetCode )
|
||||||
|
|
||||||
// Redraw ZONE_CONTAINERS
|
// Redraw ZONE_CONTAINERS
|
||||||
BOARD::ZONE_CONTAINERS& zones = m_ZoneDescriptorList;
|
BOARD::ZONE_CONTAINERS& zones = m_ZoneDescriptorList;
|
||||||
|
|
||||||
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
|
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
|
||||||
{
|
{
|
||||||
if( (*zc)->GetNet() == aNetCode )
|
if( (*zc)->GetNet() == aNetCode )
|
||||||
|
@ -265,7 +262,7 @@ void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module,
|
||||||
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
||||||
|
|
||||||
tmp = frame->m_DisplayPadFill;
|
tmp = frame->m_DisplayPadFill;
|
||||||
frame->m_DisplayPadFill = FALSE;
|
frame->m_DisplayPadFill = false;
|
||||||
|
|
||||||
/* Draw pads. */
|
/* Draw pads. */
|
||||||
for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() )
|
||||||
|
@ -278,4 +275,3 @@ void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module,
|
||||||
|
|
||||||
frame->m_DisplayPadFill = tmp;
|
frame->m_DisplayPadFill = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue