Commit 0f0ced37 authored by dickelbeck's avatar dickelbeck

beautify

parent 0f06e2ad
...@@ -932,7 +932,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct ...@@ -932,7 +932,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
{ /* Cette stucture est rattachee a une feuille, et n'est pas {
/* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */ * accessible par la liste globale directement */
frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED ); frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED );
frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct ); frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct );
...@@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct ...@@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
{ {
screen->RemoveFromDrawList( DrawStruct ); screen->RemoveFromDrawList( DrawStruct );
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
D( printf("PostDirtyRect()\n"); )
panel->PostDirtyRect( ((EDA_DrawLineStruct*)DrawStruct)->GetBoundingBox() );
}
else
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
/* Unlink the structure */ /* Unlink the structure */
DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
......
...@@ -147,14 +147,14 @@ wxString DrawMarkerStruct::GetComment() ...@@ -147,14 +147,14 @@ wxString DrawMarkerStruct::GetComment()
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void DrawMarkerStruct::Show( int nestLevel, std::ostream& os ) void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
{ {
// for now, make it look like XML: // for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_Pos NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_Pos
<< "/>\n"; << "/>\n";
} }
#endif #endif
...@@ -222,17 +222,17 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos ) ...@@ -222,17 +222,17 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os ) void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
{ {
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" layer=\"" << m_Layer << '"' << " layer=\"" << m_Layer << '"' <<
" width=\"" << m_Width << '"' << " width=\"" << m_Width << '"' <<
" startIsDangling=\"" << m_StartIsDangling << '"' << " startIsDangling=\"" << m_StartIsDangling << '"' <<
" endIsDangling=\"" << m_EndIsDangling << '"' << ">" << " endIsDangling=\"" << m_EndIsDangling << '"' << ">" <<
" <start" << m_Start << "/>" << " <start" << m_Start << "/>" <<
" <end" << m_End << "/>" << " <end" << m_End << "/>" <<
"</" << GetClass().Lower().mb_str() << ">\n"; "</" << GetClass().Lower().mb_str() << ">\n";
...@@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os ) ...@@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
#endif #endif
EDA_Rect EDA_DrawLineStruct::GetBoundingBox() const
{
int width = 25;
int xmin = MIN( m_Start.x, m_End.x ) - width;
int ymin = MIN( m_Start.y, m_End.y ) - width;
int xmax = MAX( m_Start.x, m_End.x ) + width;
int ymax = MAX( m_Start.y, m_End.y ) + width;
// return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) );
return ret;
}
/****************************/ /****************************/
/* Class DrawPolylineStruct */ /* Class DrawPolylineStruct */
/****************************/ /****************************/
......
This diff is collapsed.
This diff is collapsed.
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
public: public:
EDA_DrawLineStruct( const wxPoint& pos, int layer ); EDA_DrawLineStruct( const wxPoint& pos, int layer );
~EDA_DrawLineStruct() { } ~EDA_DrawLineStruct() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "EDA_DrawLine" ); return wxT( "EDA_DrawLine" );
...@@ -92,19 +92,25 @@ public: ...@@ -92,19 +92,25 @@ public:
} }
/**
* Function GetBoundingBox
* returns the bounding box of this TRACK
*/
EDA_Rect GetBoundingBox() const;
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif #endif
}; };
...@@ -129,16 +135,16 @@ public: ...@@ -129,16 +135,16 @@ public:
wxString GetComment(); wxString GetComment();
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif #endif
}; };
...@@ -177,7 +183,7 @@ public: ...@@ -177,7 +183,7 @@ public:
public: public:
DrawBusEntryStruct( const wxPoint& pos, int shape, int id ); DrawBusEntryStruct( const wxPoint& pos, int shape, int id );
~DrawBusEntryStruct() { } ~DrawBusEntryStruct() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "DrawBusEntry" ); return wxT( "DrawBusEntry" );
...@@ -201,7 +207,7 @@ public: ...@@ -201,7 +207,7 @@ public:
public: public:
DrawPolylineStruct( int layer ); DrawPolylineStruct( int layer );
~DrawPolylineStruct(); ~DrawPolylineStruct();
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "DrawPolyline" ); return wxT( "DrawPolyline" );
...@@ -222,7 +228,7 @@ public: ...@@ -222,7 +228,7 @@ public:
public: public:
DrawJunctionStruct( const wxPoint& pos ); DrawJunctionStruct( const wxPoint& pos );
~DrawJunctionStruct() { } ~DrawJunctionStruct() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "DrawJunction" ); return wxT( "DrawJunction" );
......
...@@ -478,6 +478,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -478,6 +478,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
if( GetScreen()->GetCurItem()->m_Flags == 0 ) if( GetScreen()->GetCurItem()->m_Flags == 0 )
SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED ); SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED );
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), (EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
&dc, option ); &dc, option );
...@@ -497,6 +498,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -497,6 +498,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
EditComponentValue( EditComponentValue(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc ); (EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
break; break;
...@@ -510,6 +512,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -510,6 +512,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
EditComponentReference( EditComponentReference(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc ); (EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
break; break;
......
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