Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
b38c6016
Commit
b38c6016
authored
Apr 05, 2009
by
f3nix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set eol-style native on new files.
parent
689579bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
136 deletions
+136
-136
sch_item_struct.cpp
common/sch_item_struct.cpp
+63
-63
class_drawpickedstruct.h
include/class_drawpickedstruct.h
+73
-73
No files found.
common/sch_item_struct.cpp
View file @
b38c6016
/****************************************************/
/* 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
}
}
include/class_drawpickedstruct.h
View file @
b38c6016
/*****************************************************************************/
/* 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__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment