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
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 */
frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED );
frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct );
......@@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* 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 */
DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
......
......@@ -147,14 +147,14 @@ wxString DrawMarkerStruct::GetComment()
/**
* Function Show
* 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.
* @param os The ostream& to output to.
*/
void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
{
// 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";
}
#endif
......@@ -222,17 +222,17 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
/**
* Function Show
* 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.
* @param os The ostream& to output to.
*/
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 << '"' <<
" width=\"" << m_Width << '"' <<
" startIsDangling=\"" << m_StartIsDangling << '"' <<
" endIsDangling=\"" << m_EndIsDangling << '"' << ">" <<
" startIsDangling=\"" << m_StartIsDangling << '"' <<
" endIsDangling=\"" << m_EndIsDangling << '"' << ">" <<
" <start" << m_Start << "/>" <<
" <end" << m_End << "/>" <<
"</" << GetClass().Lower().mb_str() << ">\n";
......@@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
#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 */
/****************************/
......
This diff is collapsed.
This diff is collapsed.
......@@ -76,7 +76,7 @@ public:
public:
EDA_DrawLineStruct( const wxPoint& pos, int layer );
~EDA_DrawLineStruct() { }
virtual wxString GetClass() const
{
return wxT( "EDA_DrawLine" );
......@@ -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,
int Color = -1 );
#if defined(DEBUG)
#if defined(DEBUG)
/**
* Function Show
* 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.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
#endif
};
......@@ -129,16 +135,16 @@ public:
wxString GetComment();
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
#if defined(DEBUG)
#if defined(DEBUG)
/**
* Function Show
* 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.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
#endif
};
......@@ -177,7 +183,7 @@ public:
public:
DrawBusEntryStruct( const wxPoint& pos, int shape, int id );
~DrawBusEntryStruct() { }
virtual wxString GetClass() const
{
return wxT( "DrawBusEntry" );
......@@ -201,7 +207,7 @@ public:
public:
DrawPolylineStruct( int layer );
~DrawPolylineStruct();
virtual wxString GetClass() const
{
return wxT( "DrawPolyline" );
......@@ -222,7 +228,7 @@ public:
public:
DrawJunctionStruct( const wxPoint& pos );
~DrawJunctionStruct() { }
virtual wxString GetClass() const
{
return wxT( "DrawJunction" );
......
......@@ -478,6 +478,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
if( GetScreen()->GetCurItem()->m_Flags == 0 )
SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED );
CmpRotationMiroir(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
&dc, option );
......@@ -497,6 +498,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
break;
EditComponentValue(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
break;
......@@ -510,6 +512,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
break;
EditComponentReference(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
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