Commit af7b6691 authored by charras's avatar charras

see changelog

parent 9b082be0
...@@ -5,6 +5,16 @@ Started 2007-June-11 ...@@ -5,6 +5,16 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Apr-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
* Added WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint Mouse );
* Added WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint Mouse );
Needed: Move redundant code to WinEDA_DrawFrame::GeneralControle
** Current sheet only Annotation and clear annotation now works for complex hierarchies
2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+all +all
......
...@@ -119,26 +119,22 @@ void ReAnnotatePowerSymbolsOnly( void ) ...@@ -119,26 +119,22 @@ void ReAnnotatePowerSymbolsOnly( void )
CmpListStruct* AllocateCmpListStrct( int numcomponents ) CmpListStruct* AllocateCmpListStrct( int numcomponents )
{ {
int ii = numcomponents * sizeof(CmpListStruct); int ii = numcomponents * sizeof(CmpListStruct);
CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii );
//fill this memory with zeros.
char* cptr = (char*) list;
for( int i = 0; i<ii; i++ ) //allocate memory and fill this memory with zeros.
*cptr++ = 0; CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii );
return list; return list;
} }
/* qsort function to annotate items by their position. /* qsort function to annotate items by their position.
* Components are sorted * Components are sorted
* by reference * by reference
* if same reference: by sheet * if same reference: by sheet
* if same sheet, by X pos * if same sheet, by X pos
* if same X pos, by Y pos * if same X pos, by Y pos
* if same Y pos, by time stamp * if same Y pos, by time stamp
*/ */
int AnnotateByPosition( const void* o1, const void* o2 ) int AnnotateByPosition( const void* o1, const void* o2 )
{ {
CmpListStruct* item1 = (CmpListStruct*) o1; CmpListStruct* item1 = (CmpListStruct*) o1;
...@@ -192,24 +188,53 @@ int AnnotateByValue( const void* o1, const void* o2 ) ...@@ -192,24 +188,53 @@ int AnnotateByValue( const void* o1, const void* o2 )
} }
/***************************************************************************** /**************************************************************************************/
* DeleteAnnotation: void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw )
* /**************************************************************************************/
* Clear the current annotation.
****************************************************************************/ /** Function DeleteAnnotation
void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic ) * Remove current component annotations
* @param aCurrentSheetOnly : if false: remove all annotations, else remove annotation relative to the current sheet only
* @param aRedraw : true to refresh display
*/
{ {
DrawSheetStruct* sheet; EDA_BaseStruct* strct;
SCH_SCREEN* screen;
EDA_ScreenList ScreenList;
if( annotateSchematic ) screen = ScreenList.GetFirst();
sheet = g_RootSheet;
if( aCurrentSheetOnly )
screen = GetScreen();
if( screen == NULL )
return;
while( screen )
{
strct = screen->EEDrawList;
for( ; strct; strct = strct->Pnext )
{
if( strct->Type() == TYPE_SCH_COMPONENT )
{
if( aCurrentSheetOnly )
( (SCH_COMPONENT*) strct )->ClearAnnotation( m_CurrentSheet );
else else
sheet = parent->GetSheet()->Last(); ( (SCH_COMPONENT*) strct )->ClearAnnotation( NULL );
}
}
sheet->DeleteAnnotation( annotateSchematic ); screen->SetModify();
if( aCurrentSheetOnly )
break;
screen = ScreenList.GetNext();
}
g_RootSheet->m_AssociatedScreen->SetModify();
parent->DrawPanel->Refresh( true ); //update the References
m_CurrentSheet->UpdateAllScreenReferences();
if( aRedraw )
DrawPanel->Refresh( true );
} }
...@@ -238,7 +263,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent, ...@@ -238,7 +263,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent,
/* If it is an annotation for all the components, reset previous /* If it is an annotation for all the components, reset previous
* annotation: */ * annotation: */
if( resetAnnotation ) if( resetAnnotation )
DeleteAnnotation( parent, annotateSchematic ); parent->DeleteAnnotation( !annotateSchematic, false );
/* Build the sheet list */ /* Build the sheet list */
EDA_SheetList SheetList( g_RootSheet ); EDA_SheetList SheetList( g_RootSheet );
...@@ -289,7 +314,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent, ...@@ -289,7 +314,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent,
( int( * ) ( const void*, const void* ) )AnnotateByPosition ); ( int( * ) ( const void*, const void* ) )AnnotateByPosition );
else else
qsort( BaseListeCmp, NbOfCmp, sizeof(CmpListStruct), qsort( BaseListeCmp, NbOfCmp, sizeof(CmpListStruct),
( int( * ) ( const void*, const void* ) ) AnnotateByValue); ( int( * ) ( const void*, const void* ) )AnnotateByValue );
/* Recalculate reference numbers */ /* Recalculate reference numbers */
ComputeReferenceNumber( BaseListeCmp, NbOfCmp ); ComputeReferenceNumber( BaseListeCmp, NbOfCmp );
...@@ -334,7 +359,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet ) ...@@ -334,7 +359,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
BaseListeCmp[NbrCmp].m_Cmp = DrawLibItem; BaseListeCmp[NbrCmp].m_Cmp = DrawLibItem;
BaseListeCmp[NbrCmp].m_NbParts = Entry->m_UnitCount; BaseListeCmp[NbrCmp].m_NbParts = Entry->m_UnitCount;
BaseListeCmp[NbrCmp].m_Unit = DrawLibItem->GetUnitSelection( sheet );// DrawLibItem->m_Multi; BaseListeCmp[NbrCmp].m_Unit = DrawLibItem->GetUnitSelection( sheet ); // DrawLibItem->m_Multi;
BaseListeCmp[NbrCmp].m_PartsLocked = Entry->m_UnitSelectionLocked; BaseListeCmp[NbrCmp].m_PartsLocked = Entry->m_UnitSelectionLocked;
BaseListeCmp[NbrCmp].m_SheetList = *sheet; BaseListeCmp[NbrCmp].m_SheetList = *sheet;
BaseListeCmp[NbrCmp].m_IsNew = FALSE; BaseListeCmp[NbrCmp].m_IsNew = FALSE;
...@@ -439,7 +464,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp ) ...@@ -439,7 +464,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp )
break; break;
} }
} }
} }
} }
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include "program.h" #include "program.h"
#include "annotate_dialog.h" #include "annotate_dialog.h"
extern void DeleteAnnotation( WinEDA_SchematicFrame* parent,
bool annotateSchematic );
extern void AnnotateComponents( WinEDA_SchematicFrame* parent, extern void AnnotateComponents( WinEDA_SchematicFrame* parent,
bool annotateSchematic, bool annotateSchematic,
bool sortByPosition, bool sortByPosition,
...@@ -262,7 +260,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) ...@@ -262,7 +260,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event )
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
DeleteAnnotation( m_Parent, GetLevel() ); m_Parent->DeleteAnnotation( GetLevel() ? false : true, true );
m_btnClear->Enable(false); m_btnClear->Enable(false);
} }
......
...@@ -828,7 +828,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc ...@@ -828,7 +828,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
{ {
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL);
} }
break; break;
...@@ -893,7 +893,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc ...@@ -893,7 +893,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(NULL);
break; break;
} }
...@@ -1051,7 +1051,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1051,7 +1051,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
if( Struct->Type() == TYPE_SCH_COMPONENT ) if( Struct->Type() == TYPE_SCH_COMPONENT )
{ {
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL);
SetStructFather( Struct, GetScreen() ); SetStructFather( Struct, GetScreen() );
} }
PickedList = (DrawPickedStruct*) PickedList->Pnext; PickedList = (DrawPickedStruct*) PickedList->Pnext;
...@@ -1075,7 +1075,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1075,7 +1075,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
{ {
( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(NULL);
} }
SetStructFather( DrawStruct, GetScreen() ); SetStructFather( DrawStruct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
......
...@@ -359,32 +359,6 @@ EDA_Rect DrawSheetStruct::GetBoundingBox() ...@@ -359,32 +359,6 @@ EDA_Rect DrawSheetStruct::GetBoundingBox()
} }
/**************************************************************************************/
void DrawSheetStruct::DeleteAnnotation( bool recurse )
/**************************************************************************************/
{
if( recurse && m_AssociatedScreen )
{
EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList;
for( ; strct; strct = strct->Pnext )
{
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
DrawSheetStruct* sheet = (DrawSheetStruct*) strct;
sheet->DeleteAnnotation( recurse );
}
}
}
EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList;
for( ; comp; comp = comp->Pnext )
{
if( comp->Type() == TYPE_SCH_COMPONENT )
{
( (SCH_COMPONENT*) comp )->ClearAnnotation();
}
}
}
/*******************************************************************/ /*******************************************************************/
int DrawSheetStruct::ComponentCount() int DrawSheetStruct::ComponentCount()
......
...@@ -62,16 +62,16 @@ WX_DEFINE_ARRAY( DrawSheetStruct *, SheetGrowArray ); ...@@ -62,16 +62,16 @@ WX_DEFINE_ARRAY( DrawSheetStruct *, SheetGrowArray );
class DrawSheetStruct : public SCH_ITEM /*public SCH_SCREEN*/ /* Gestion de la hierarchie */ class DrawSheetStruct : public SCH_ITEM /*public SCH_SCREEN*/ /* Gestion de la hierarchie */
{ {
public: public:
wxString m_SheetName; //this is equivalent to C101 for components: wxString m_SheetName; /*this is equivalent to C101 for components:
// it is stored in F0 ... of the file. * it is stored in F0 ... of the file. */
private: private:
wxString m_FileName; //also in SCH_SCREEN (redundant), wxString m_FileName; /*also in SCH_SCREEN (redundant),
//but need it here for loading after * but need it here for loading after
//reading the sheet description from file. * reading the sheet description from file. */
public: public:
int m_SheetNameSize; // Size (height) of the text, used to draw the name int m_SheetNameSize; /* Size (height) of the text, used to draw the name */
int m_FileNameSize; // Size (height) of the text, used to draw the name int m_FileNameSize; /* Size (height) of the text, used to draw the name */
wxPoint m_Pos; wxPoint m_Pos;
wxSize m_Size; /* Position and Size of sheet symbol */ wxSize m_Size; /* Position and Size of sheet symbol */
int m_Layer; int m_Layer;
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
return wxT( "DrawSheetStruct" ); return wxT( "DrawSheetStruct" );
} }
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
...@@ -107,15 +108,14 @@ public: ...@@ -107,15 +108,14 @@ public:
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
void SwapData( DrawSheetStruct* copyitem ); void SwapData( DrawSheetStruct* copyitem );
void DeleteAnnotation( bool recurse );
int ComponentCount(); int ComponentCount();
bool Load( WinEDA_SchematicFrame* frame ); bool Load( WinEDA_SchematicFrame* frame );
bool SearchHierarchy( wxString filename, SCH_SCREEN** screen ); bool SearchHierarchy( wxString filename, SCH_SCREEN** screen ); //search the existing hierarchy for an instance of screen "FileName".
bool LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* list ); bool LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* list );
int CountSheets(); int CountSheets();
wxString GetFileName(void); wxString GetFileName( void );
void SetFileName(const wxString & aFilename); // Set a new filename without changing anything else void SetFileName( const wxString& aFilename ); // Set a new filename without changing anything else
bool ChangeFileName(WinEDA_SchematicFrame * aFrame, const wxString & aFileName); // Set a new filename and manage data and associated screen bool ChangeFileName( WinEDA_SchematicFrame* aFrame, const wxString& aFileName ); // Set a new filename and manage data and associated screen
//void RemoveSheet(DrawSheetStruct* sheet); //void RemoveSheet(DrawSheetStruct* sheet);
//to remove a sheet, just delete it //to remove a sheet, just delete it
...@@ -143,17 +143,20 @@ public: ...@@ -143,17 +143,20 @@ public:
EDA_BaseStruct* LastDrawList(); EDA_BaseStruct* LastDrawList();
void Push( DrawSheetStruct* sheet ); void Push( DrawSheetStruct* sheet );
DrawSheetStruct* Pop(); DrawSheetStruct* Pop();
/** Function Path /** Function Path
* the path uses the time stamps which do not changes even when editing sheet parameters * the path uses the time stamps which do not changes even when editing sheet parameters
* a path is something like / (root) or /34005677 or /34005677/00AE4523 * a path is something like / (root) or /34005677 or /34005677/00AE4523
*/ */
wxString Path(); wxString Path();
/** Function PathHumanReadable /** Function PathHumanReadable
* Return the sheet path in a readable form, i.e. * Return the sheet path in a readable form, i.e.
* as a path made from sheet names. * as a path made from sheet names.
* (the "normal" path uses the time stamps which do not changes even when editing sheet parameters) * (the "normal" path uses the time stamps which do not changes even when editing sheet parameters)
*/ */
wxString PathHumanReadable(); wxString PathHumanReadable();
/** Function UpdateAllScreenReferences /** Function UpdateAllScreenReferences
* Update the reference and the m_Multi parameter (part selection) for all components on a screen * Update the reference and the m_Multi parameter (part selection) for all components on a screen
* depending on the actual sheet path. * depending on the actual sheet path.
......
...@@ -442,16 +442,21 @@ void SCH_COMPONENT::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -442,16 +442,21 @@ void SCH_COMPONENT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
} }
/***************************************************/ /**********************************************************/
void SCH_COMPONENT::ClearAnnotation() void SCH_COMPONENT::ClearAnnotation( DrawSheetPath* aSheet )
/***************************************************/ /**********************************************************/
/* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1) /**
* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1)
* @param aSheet: DrawSheetPath value: if NULL remove all annotations,
* else remove annotation relative to this sheetpath
*/ */
{ {
wxString defRef = m_PrefixString; wxString defRef = m_PrefixString;
bool KeepMulti = false; bool KeepMulti = false;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
wxString separators( wxT( " " ) );
wxArrayString reference_fields;
Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
...@@ -465,15 +470,27 @@ void SCH_COMPONENT::ClearAnnotation() ...@@ -465,15 +470,27 @@ void SCH_COMPONENT::ClearAnnotation()
wxString multi = wxT( "1" ); wxString multi = wxT( "1" );
wxString NewHref; wxString NewHref;
wxString path;
if( aSheet )
path = GetPath( aSheet );;
for( unsigned int ii = 0; ii< m_PathsAndReferences.GetCount(); ii++ ) for( unsigned int ii = 0; ii< m_PathsAndReferences.GetCount(); ii++ )
{
// Break hierachical reference in path, ref and multi selection:
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], separators );
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
{ {
if( KeepMulti ) // Get and keep part selection if( KeepMulti ) // Get and keep part selection
multi = m_PathsAndReferences[ii].AfterLast( wxChar( ' ' ) ); multi = reference_fields[2];
NewHref = m_PathsAndReferences[ii].BeforeFirst( wxChar( ' ' ) ); NewHref = reference_fields[0];
NewHref << wxT( " " ) << defRef << wxT( " " ) << multi; NewHref << wxT( " " ) << defRef << wxT( " " ) << multi;
m_PathsAndReferences[ii] = NewHref; m_PathsAndReferences[ii] = NewHref;
} }
}
// These 2 changes do not work in complex hierarchy.
// When a clear annotation is made, the calling function must call a
// UpdateAllScreenReferences for the active sheet.
// But this call does not made here.
m_Field[REFERENCE].m_Text = defRef; //for drawing. m_Field[REFERENCE].m_Text = defRef; //for drawing.
if( !KeepMulti ) if( !KeepMulti )
......
...@@ -140,7 +140,13 @@ public: ...@@ -140,7 +140,13 @@ public:
int GetRotationMiroir(); int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord ); wxPoint GetScreenCoord( const wxPoint& coord );
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
void ClearAnnotation(); /**
* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1)
* @param aSheet: DrawSheetPath value: if NULL remove all annotations,
* else remove annotation relative to this sheetpath
*/
void ClearAnnotation( DrawSheetPath* aSheet );
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
......
...@@ -216,9 +216,264 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -216,9 +216,264 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
} }
/***********************************************************************/ /*************************************************************************************/
void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
/***********************************************************************/ /*************************************************************************************/
{
wxSize delta;
SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
curpos = screen->m_MousePosition;
oldpos = screen->m_Curseur;
delta.x = screen->GetGrid().x / zoom;
delta.y = screen->GetGrid().y / zoom;
if( delta.x <= 0 )
delta.x = 1;
if( delta.y <= 0 )
delta.y = 1;
switch( g_KeyPressed )
{
case 0:
break;
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_IN_FROM_MOUSE:
OnZoom( ID_ZOOM_IN_KEY );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_OUT_FROM_MOUSE:
OnZoom( ID_ZOOM_OUT_KEY );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_CENTER_FROM_MOUSE:
OnZoom( ID_ZOOM_CENTER_KEY );
curpos = screen->m_Curseur;
break;
case WXK_NUMPAD8: /* Deplacement curseur vers le haut */
case WXK_UP:
MousePositionInPixels.y -= delta.y;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD2: /* Deplacement curseur vers le bas */
case WXK_DOWN:
MousePositionInPixels.y += delta.y;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */
case WXK_LEFT:
MousePositionInPixels.x -= delta.x;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD6: /* Deplacement curseur vers la droite */
case WXK_RIGHT:
MousePositionInPixels.x += delta.x;
DrawPanel->MouseTo( MousePositionInPixels );
break;
default:
hotkey = g_KeyPressed;
break;
}
/* Recalcul de la position du curseur schema */
screen->m_Curseur = curpos;
/* Placement sur la grille generale */
PutOnGrid( &(screen->m_Curseur) );
if( screen->IsRefreshReq() )
{
RedrawActiveWindow( DC, TRUE );
}
if( oldpos != screen->m_Curseur )
{
curpos = screen->m_Curseur;
screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
}
}
if( hotkey )
{
if( screen->GetCurItem()
&& screen->GetCurItem()->m_Flags )
OnHotKey( DC, hotkey, screen->GetCurItem() );
else
OnHotKey( DC, hotkey, NULL );
}
Affiche_Status_Box(); /* Affichage des coord curseur */
}
/*************************************************************************************/
void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
/*************************************************************************************/
{
wxSize delta;
SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
curpos = screen->m_MousePosition;
oldpos = screen->m_Curseur;
delta.x = screen->GetGrid().x / zoom;
delta.y = screen->GetGrid().y / zoom;
if( delta.x <= 0 )
delta.x = 1;
if( delta.y <= 0 )
delta.y = 1;
switch( g_KeyPressed )
{
case 0:
break;
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = screen->m_Curseur;
break;
case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_IN_FROM_MOUSE:
OnZoom( ID_ZOOM_IN_KEY );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_OUT_FROM_MOUSE:
OnZoom( ID_ZOOM_OUT_KEY );
curpos = screen->m_Curseur;
break;
case EDA_ZOOM_CENTER_FROM_MOUSE:
OnZoom( ID_ZOOM_CENTER_KEY );
curpos = screen->m_Curseur;
break;
case WXK_NUMPAD8: /* Deplacement curseur vers le haut */
case WXK_UP:
MousePositionInPixels.y -= delta.y;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD2: /* Deplacement curseur vers le bas */
case WXK_DOWN:
MousePositionInPixels.y += delta.y;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */
case WXK_LEFT:
MousePositionInPixels.x -= delta.x;
DrawPanel->MouseTo( MousePositionInPixels );
break;
case WXK_NUMPAD6: /* Deplacement curseur vers la droite */
case WXK_RIGHT:
MousePositionInPixels.x += delta.x;
DrawPanel->MouseTo( MousePositionInPixels );
break;
default:
hotkey = g_KeyPressed;
break;
}
/* Recalcul de la position du curseur schema */
screen->m_Curseur = curpos;
/* Placement sur la grille generale */
PutOnGrid( &(screen->m_Curseur) );
if( screen->IsRefreshReq() )
{
RedrawActiveWindow( DC, TRUE );
}
if( oldpos != screen->m_Curseur )
{
curpos = screen->m_Curseur;
screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
}
}
if( hotkey )
{
if( screen->GetCurItem()
&& screen->GetCurItem()->m_Flags )
OnHotKey( DC, hotkey, screen->GetCurItem() );
else
OnHotKey( DC, hotkey, NULL );
}
Affiche_Status_Box(); /* Affichage des coord curseur */
}
/*************************************************************************************/
void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
/*************************************************************************************/
{ {
wxSize delta; wxSize delta;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
...@@ -285,7 +540,6 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi ...@@ -285,7 +540,6 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi
case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2: /* Deplacement curseur vers le bas */
case WXK_DOWN: case WXK_DOWN:
D(printf("DOWN\n");)
MousePositionInPixels.y += delta.y; MousePositionInPixels.y += delta.y;
DrawPanel->MouseTo( MousePositionInPixels ); DrawPanel->MouseTo( MousePositionInPixels );
break; break;
......
...@@ -549,7 +549,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -549,7 +549,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
newitem = olditem->GenCopy(); newitem = olditem->GenCopy();
newitem->m_TimeStamp = GetTimeStamp(); newitem->m_TimeStamp = GetTimeStamp();
newitem->ClearAnnotation(); newitem->ClearAnnotation(NULL);
newitem->m_Flags = IS_NEW; newitem->m_Flags = IS_NEW;
StartMovePart( newitem, &dc ); StartMovePart( newitem, &dc );
......
...@@ -255,8 +255,9 @@ void WinEDA_SchematicFrame::CreateScreens() ...@@ -255,8 +255,9 @@ void WinEDA_SchematicFrame::CreateScreens()
} }
/**************************************************************/ /*****************************************************************/
void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event ) void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
/*****************************************************************/
{ {
DrawSheetPath* sheet; DrawSheetPath* sheet;
......
...@@ -101,6 +101,12 @@ public: ...@@ -101,6 +101,12 @@ public:
/* netlist generation */ /* netlist generation */
void* BuildNetListBase(); void* BuildNetListBase();
/** Function DeleteAnnotation
* Remove current component annotations
* @param aCurrentSheetOnly : if false: remove all annotations, else remove annotation relative to the current sheet only
* @param aRedraw : true to refresh display
*/
void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw );
// FUnctions used for hierarchy handling // FUnctions used for hierarchy handling
void InstallPreviousSheet(); void InstallPreviousSheet();
...@@ -307,6 +313,8 @@ public: ...@@ -307,6 +313,8 @@ public:
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
private: private:
// General: // General:
...@@ -416,6 +424,8 @@ public: ...@@ -416,6 +424,8 @@ public:
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
private: private:
void SelectCurrentLibrary(); void SelectCurrentLibrary();
void SelectAndViewLibraryPart( int option ); void SelectAndViewLibraryPart( int option );
......
install(DIRECTORY ca cs de es fr hu it ko pl pt ru sl sv zh_CN install(DIRECTORY ca cs de es fr hu it ko nl pl pt ru sl sv zh_CN
DESTINATION ${KICAD_INTERNAT} DESTINATION ${KICAD_INTERNAT}
COMPONENT resources COMPONENT resources
PATTERN ".svn" EXCLUDE PATTERN ".svn" EXCLUDE
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment