Set eol-style native on new files.
This commit is contained in:
parent
689579bde1
commit
b38c601661
|
@ -1,63 +1,63 @@
|
|||
/****************************************************/
|
||||
/* class_drawpickedstruct.cpp */
|
||||
/****************************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "gr_basic.h"
|
||||
#include "base_struct.h"
|
||||
#include "sch_item_struct.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "program.h"
|
||||
#include "general.h"
|
||||
#include "libcmp.h"
|
||||
#include "protos.h"
|
||||
|
||||
/* Constructor and destructor for SCH_ITEM */
|
||||
/* They are not inline because this creates problems with gcc at linking time
|
||||
* in debug mode
|
||||
*/
|
||||
|
||||
SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
|
||||
EDA_BaseStruct( aParent, aType )
|
||||
{
|
||||
m_Layer = 0;
|
||||
}
|
||||
|
||||
SCH_ITEM::~SCH_ITEM()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* place the struct in EEDrawList.
|
||||
* if it is a new item, it it also put in undo list
|
||||
* for an "old" item, saving it in undo list must be done before editiing,
|
||||
* and not here!
|
||||
*/
|
||||
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
|
||||
{
|
||||
if( m_Flags & IS_NEW )
|
||||
{
|
||||
SCH_SCREEN* screen = frame->GetScreen();
|
||||
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
|
||||
screen->AddToDrawList( this );
|
||||
g_ItemToRepeat = this;
|
||||
frame->SaveCopyInUndoList( this, IS_NEW );
|
||||
}
|
||||
|
||||
m_Flags = 0;
|
||||
frame->GetScreen()->SetModify();
|
||||
frame->GetScreen()->SetCurItem( NULL );
|
||||
frame->DrawPanel->ManageCurseur = NULL;
|
||||
frame->DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
|
||||
if( DC )
|
||||
{
|
||||
frame->DrawPanel->CursorOff( DC ); // Erase schematic cursor
|
||||
RedrawOneStruct( frame->DrawPanel, DC, this, GR_DEFAULT_DRAWMODE );
|
||||
frame->DrawPanel->CursorOn( DC ); // Display schematic cursor
|
||||
}
|
||||
}
|
||||
/****************************************************/
|
||||
/* class_drawpickedstruct.cpp */
|
||||
/****************************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "gr_basic.h"
|
||||
#include "base_struct.h"
|
||||
#include "sch_item_struct.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "program.h"
|
||||
#include "general.h"
|
||||
#include "libcmp.h"
|
||||
#include "protos.h"
|
||||
|
||||
/* Constructor and destructor for SCH_ITEM */
|
||||
/* They are not inline because this creates problems with gcc at linking time
|
||||
* in debug mode
|
||||
*/
|
||||
|
||||
SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
|
||||
EDA_BaseStruct( aParent, aType )
|
||||
{
|
||||
m_Layer = 0;
|
||||
}
|
||||
|
||||
SCH_ITEM::~SCH_ITEM()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* place the struct in EEDrawList.
|
||||
* if it is a new item, it it also put in undo list
|
||||
* for an "old" item, saving it in undo list must be done before editiing,
|
||||
* and not here!
|
||||
*/
|
||||
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
|
||||
{
|
||||
if( m_Flags & IS_NEW )
|
||||
{
|
||||
SCH_SCREEN* screen = frame->GetScreen();
|
||||
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
|
||||
screen->AddToDrawList( this );
|
||||
g_ItemToRepeat = this;
|
||||
frame->SaveCopyInUndoList( this, IS_NEW );
|
||||
}
|
||||
|
||||
m_Flags = 0;
|
||||
frame->GetScreen()->SetModify();
|
||||
frame->GetScreen()->SetCurItem( NULL );
|
||||
frame->DrawPanel->ManageCurseur = NULL;
|
||||
frame->DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
|
||||
if( DC )
|
||||
{
|
||||
frame->DrawPanel->CursorOff( DC ); // Erase schematic cursor
|
||||
RedrawOneStruct( frame->DrawPanel, DC, this, GR_DEFAULT_DRAWMODE );
|
||||
frame->DrawPanel->CursorOn( DC ); // Display schematic cursor
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,73 +1,73 @@
|
|||
/*****************************************************************************/
|
||||
/* sch_item_struct.h : Basic classes for most eeschema items descriptions */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef __CLASS_DRAWPICKEDSTRUCT_H__
|
||||
#define __CLASS_DRAWPICKEDSTRUCT_H__
|
||||
|
||||
|
||||
#include "base_struct.h"
|
||||
|
||||
|
||||
/**
|
||||
* Class DrawPickedStruct
|
||||
* holds structures picked by pick events (like block selection).
|
||||
* This class has only one useful member: .m_PickedStruct, used as a link.
|
||||
* It is used to create a linked list of selected items (in block selection).
|
||||
* Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
|
||||
* real selected item.
|
||||
*/
|
||||
class DrawPickedStruct : public EDA_BaseStruct
|
||||
{
|
||||
public:
|
||||
EDA_BaseStruct * m_PickedStruct;
|
||||
|
||||
public:
|
||||
DrawPickedStruct( EDA_BaseStruct * pickedstruct = NULL );
|
||||
~DrawPickedStruct();
|
||||
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
|
||||
void DeleteWrapperList();
|
||||
|
||||
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
|
||||
|
||||
EDA_Rect GetBoundingBox();
|
||||
|
||||
/**
|
||||
* Function GetBoundingBoxUnion
|
||||
* returns the union of all the BoundingBox rectangles of all held items
|
||||
* in the picklist whose list head is this DrawPickedStruct.
|
||||
* @return EDA_Rect - The combined, composite, bounding box.
|
||||
*/
|
||||
EDA_Rect GetBoundingBoxUnion();
|
||||
|
||||
wxString GetClass() const { return wxT( "DrawPickedStruct" ); }
|
||||
|
||||
/**
|
||||
* Function Draw
|
||||
* Do nothing, needed for SCH_ITEM compat.
|
||||
*/
|
||||
void Draw( WinEDA_DrawPanel* panel,
|
||||
wxDC* DC,
|
||||
const wxPoint& offset,
|
||||
int draw_mode,
|
||||
int Color = -1 )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function Save
|
||||
* Do nothing, needed for SCH_ITEM compat.
|
||||
* @param aFile The FILE to write to.
|
||||
* @return bool - true if success writing else false.
|
||||
*/
|
||||
bool Save( FILE* aFile ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os );
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __CLASS_DRAWPICKEDSTRUCT_H__ */
|
||||
/*****************************************************************************/
|
||||
/* sch_item_struct.h : Basic classes for most eeschema items descriptions */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef __CLASS_DRAWPICKEDSTRUCT_H__
|
||||
#define __CLASS_DRAWPICKEDSTRUCT_H__
|
||||
|
||||
|
||||
#include "base_struct.h"
|
||||
|
||||
|
||||
/**
|
||||
* Class DrawPickedStruct
|
||||
* holds structures picked by pick events (like block selection).
|
||||
* This class has only one useful member: .m_PickedStruct, used as a link.
|
||||
* It is used to create a linked list of selected items (in block selection).
|
||||
* Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
|
||||
* real selected item.
|
||||
*/
|
||||
class DrawPickedStruct : public EDA_BaseStruct
|
||||
{
|
||||
public:
|
||||
EDA_BaseStruct * m_PickedStruct;
|
||||
|
||||
public:
|
||||
DrawPickedStruct( EDA_BaseStruct * pickedstruct = NULL );
|
||||
~DrawPickedStruct();
|
||||
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
|
||||
void DeleteWrapperList();
|
||||
|
||||
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
|
||||
|
||||
EDA_Rect GetBoundingBox();
|
||||
|
||||
/**
|
||||
* Function GetBoundingBoxUnion
|
||||
* returns the union of all the BoundingBox rectangles of all held items
|
||||
* in the picklist whose list head is this DrawPickedStruct.
|
||||
* @return EDA_Rect - The combined, composite, bounding box.
|
||||
*/
|
||||
EDA_Rect GetBoundingBoxUnion();
|
||||
|
||||
wxString GetClass() const { return wxT( "DrawPickedStruct" ); }
|
||||
|
||||
/**
|
||||
* Function Draw
|
||||
* Do nothing, needed for SCH_ITEM compat.
|
||||
*/
|
||||
void Draw( WinEDA_DrawPanel* panel,
|
||||
wxDC* DC,
|
||||
const wxPoint& offset,
|
||||
int draw_mode,
|
||||
int Color = -1 )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function Save
|
||||
* Do nothing, needed for SCH_ITEM compat.
|
||||
* @param aFile The FILE to write to.
|
||||
* @return bool - true if success writing else false.
|
||||
*/
|
||||
bool Save( FILE* aFile ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os );
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __CLASS_DRAWPICKEDSTRUCT_H__ */
|
||||
|
|
Loading…
Reference in New Issue