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
96849d5a
Commit
96849d5a
authored
Dec 19, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleaning
parent
b808fcf4
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
75 additions
and
129 deletions
+75
-129
copy_to_clipboard.cpp
common/copy_to_clipboard.cpp
+1
-3
drawframe.cpp
common/drawframe.cpp
+2
-5
drawpanel.cpp
common/drawpanel.cpp
+29
-24
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+1
-2
find.cpp
eeschema/find.cpp
+3
-9
libframe.cpp
eeschema/libframe.cpp
+1
-3
schedit.cpp
eeschema/schedit.cpp
+1
-3
symbdraw.cpp
eeschema/symbdraw.cpp
+0
-10
tool_sch.cpp
eeschema/tool_sch.cpp
+1
-3
viewlibs.cpp
eeschema/viewlibs.cpp
+1
-4
edit.cpp
gerbview/edit.cpp
+1
-6
class_drawpanel.h
include/class_drawpanel.h
+7
-1
automove.cpp
pcbnew/automove.cpp
+1
-3
dialog_general_options.cpp
pcbnew/dialog_general_options.cpp
+2
-6
edit.cpp
pcbnew/edit.cpp
+1
-2
export_gencad.cpp
pcbnew/export_gencad.cpp
+1
-3
files.cpp
pcbnew/files.cpp
+2
-4
globaleditpad.cpp
pcbnew/globaleditpad.cpp
+1
-2
modedit.cpp
pcbnew/modedit.cpp
+1
-2
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+2
-5
modeditoptions.cpp
pcbnew/modeditoptions.cpp
+5
-9
muwave_command.cpp
pcbnew/muwave_command.cpp
+1
-3
onleftclick.cpp
pcbnew/onleftclick.cpp
+8
-11
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+1
-3
surbrill.cpp
pcbnew/surbrill.cpp
+1
-3
No files found.
common/copy_to_clipboard.cpp
View file @
96849d5a
...
...
@@ -39,9 +39,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event )
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
}
}
...
...
common/drawframe.cpp
View file @
96849d5a
...
...
@@ -340,9 +340,7 @@ void WinEDA_DrawFrame::ReDrawPanel()
if
(
DrawPanel
==
NULL
)
return
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
DrawPanel
->
ReDraw
(
&
dc
);
}
...
...
@@ -599,9 +597,8 @@ void WinEDA_DrawFrame::AdjustScrollBars()
int
x
,
y
,
scroll_x
,
scroll_y
;
double
scale_x
,
scale_y
;
wxClientDC
DC
(
this
);
DrawPanel
DC
(
this
);
DrawPanel
->
PrepareGraphicContext
(
&
DC
);
x
=
DC
.
LogicalToDeviceXRel
(
draw_size
.
GetWidth
()
);
y
=
DC
.
LogicalToDeviceYRel
(
draw_size
.
GetHeight
()
);
...
...
common/drawpanel.cpp
View file @
96849d5a
...
...
@@ -16,6 +16,26 @@
#define CURSOR_SIZE 12 // Cursor size in pixels
// Helper class to handle the client Device Context
KicadGraphicContext
::
KicadGraphicContext
(
WinEDA_DrawPanel
*
aDrawPanel
)
:
wxClientDC
(
aDrawPanel
)
{
GRResetPenAndBrush
(
this
);
SetBackgroundMode
(
wxTRANSPARENT
);
#ifdef WX_ZOOM
double
scale
=
aDrawPanel
->
GetScreen
()
->
GetScalingFactor
();
SetUserScale
(
scale
,
scale
);
wxPoint
origin
=
aDrawPanel
->
GetScreen
()
->
m_DrawOrg
;
SetLogicalOrigin
(
origin
.
x
,
origin
.
y
);
#endif
aDrawPanel
->
SetBoundaryBox
();
}
KicadGraphicContext
::~
KicadGraphicContext
(
)
{
}
/* Used to inhibit a response to a mouse left button release, after a
* double click (when releasing the left button at the end of the second
* click. Used in eeschema to inhibit a mouse left release command when
...
...
@@ -172,19 +192,6 @@ wxRealPoint WinEDA_DrawPanel::GetGrid()
}
void
WinEDA_DrawPanel
::
PrepareGraphicContext
(
wxDC
*
DC
)
{
GRResetPenAndBrush
(
DC
);
DC
->
SetBackgroundMode
(
wxTRANSPARENT
);
#ifdef WX_ZOOM
double
scale
=
GetScreen
()
->
GetScalingFactor
();
DC
->
SetUserScale
(
scale
,
scale
);
wxPoint
origin
=
GetScreen
()
->
m_DrawOrg
;
DC
->
SetLogicalOrigin
(
origin
.
x
,
origin
.
y
);
#endif
SetBoundaryBox
();
}
/** Calculate the cursor position in internal units.
* @return position (in internal units)
...
...
@@ -194,8 +201,8 @@ wxPoint WinEDA_DrawPanel::CursorRealPosition( const wxPoint& ScreenPos )
{
#ifdef WX_ZOOM
wxCoord
x
,
y
;
wxClientDC
DC
(
this
);
PrepareGraphicContext
(
&
DC
);
KicadGraphicContext
DC
(
this
);
x
=
DC
.
DeviceToLogicalX
(
ScreenPos
.
x
);
y
=
DC
.
DeviceToLogicalY
(
ScreenPos
.
y
);
return
wxPoint
(
x
,
y
);
...
...
@@ -304,8 +311,8 @@ wxPoint WinEDA_DrawPanel::CursorScreenPosition()
{
#ifdef WX_ZOOM
wxCoord
x
,
y
;
wxClientDC
DC
(
this
);
PrepareGraphicContext
(
&
DC
);
KicadGraphicContext
DC
(
this
);
x
=
DC
.
LogicalToDeviceX
(
GetScreen
()
->
m_Curseur
.
x
);
y
=
DC
.
LogicalToDeviceY
(
GetScreen
()
->
m_Curseur
.
y
);
return
wxPoint
(
x
,
y
);
...
...
@@ -332,8 +339,7 @@ wxPoint WinEDA_DrawPanel::GetScreenCenterRealPosition( void )
GetScreen
()
->
Unscale
(
realpos
);
#ifdef WX_ZOOM
// wxCoord x, y;
// wxClientDC DC( this );
// PrepareGraphicContext( &DC );
// KicadGraphicContext DC( this );
// realpos.x = DC.DeviceToLogicalX( realpos.x );
// realpos.y = DC.DeviceToLogicalY( realpos.y );
#else
...
...
@@ -567,7 +573,6 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
wxRect
PaintClipBox
;
wxPoint
org
;
PrepareGraphicContext
(
&
paintDC
);
tmp
=
m_ClipBox
;
org
=
m_ClipBox
.
GetOrigin
();
...
...
@@ -1010,11 +1015,11 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
screen
->
m_MousePosition
=
CursorRealPosition
(
screen
->
m_MousePositionInPixels
);
wxClientDC
DC
(
this
);
KicadGraphicContext
DC
(
this
);
int
kbstat
=
0
;
DC
.
SetBackground
(
*
wxBLACK_BRUSH
);
PrepareGraphicContext
(
&
DC
);
g_KeyPressed
=
localkey
;
...
...
@@ -1259,10 +1264,10 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event )
if
(
event
.
ShiftDown
()
&&
(
key
>
256
)
)
localkey
|=
GR_KB_SHIFT
;
wxClientDC
DC
(
this
);
KicadGraphicContext
DC
(
this
);
BASE_SCREEN
*
Screen
=
GetScreen
();
PrepareGraphicContext
(
&
DC
);
g_KeyPressed
=
localkey
;
...
...
eeschema/dialog_edit_component_in_schematic.cpp
View file @
96849d5a
...
...
@@ -722,8 +722,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
if
(
entry
==
NULL
)
return
;
wxClientDC
dc
(
m_Parent
->
DrawPanel
);
m_Parent
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
m_Parent
->
DrawPanel
);
RedrawOneStruct
(
m_Parent
->
DrawPanel
,
&
dc
,
m_Cmp
,
g_XorMode
);
...
...
eeschema/find.cpp
View file @
96849d5a
...
...
@@ -179,9 +179,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem(
Recadre_Trace
(
mouseWarp
);
else
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
EXCHG
(
old_cursor_position
,
sheet
->
LastScreen
()
->
m_Curseur
);
DrawPanel
->
CursorOff
(
&
dc
);
...
...
@@ -356,9 +354,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType )
Recadre_Trace
(
TRUE
);
else
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
EXCHG
(
old_cursor_position
,
sheet
->
LastScreen
()
->
m_Curseur
);
DrawPanel
->
CursorOff
(
&
dc
);
DrawPanel
->
MouseTo
(
curpos
);
...
...
@@ -581,9 +577,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem( const wxString& pattern,
Recadre_Trace
(
mouseWarp
);
else
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
EXCHG
(
old_cursor_position
,
Sheet
->
LastScreen
()
->
m_Curseur
);
DrawPanel
->
CursorOff
(
&
dc
);
...
...
eeschema/libframe.cpp
View file @
96849d5a
...
...
@@ -604,12 +604,10 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
int
id
=
event
.
GetId
();
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
DrawPanel
->
m_IgnoreMouseEvents
=
true
;
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
pos
.
y
+=
20
;
...
...
eeschema/schedit.cpp
View file @
96849d5a
...
...
@@ -22,11 +22,9 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
{
int
id
=
event
.
GetId
();
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
SCH_SCREEN
*
screen
=
GetScreen
();
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
pos
=
wxGetMousePosition
();
pos
.
y
+=
20
;
...
...
eeschema/symbdraw.cpp
View file @
96849d5a
...
...
@@ -72,13 +72,6 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
if
(
!
(
DrawItem
->
m_Flags
&
IS_NEW
)
)
SaveCopyInUndoList
(
DrawItem
->
GetParent
()
);
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
DrawItem
->
Draw
(
DrawPanel
,
&
dc
,
wxPoint
(
0
,
0
),
-
1
,
g_XorMode
,
NULL
,
DefaultTransformMatrix
);
if
(
m_drawSpecificUnit
)
DrawItem
->
m_Unit
=
GetUnit
();
else
...
...
@@ -98,9 +91,6 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
component
->
GetDrawItemList
().
sort
();
GetScreen
()
->
SetModify
();
DrawItem
->
Draw
(
DrawPanel
,
&
dc
,
wxPoint
(
0
,
0
),
-
1
,
g_XorMode
,
NULL
,
DefaultTransformMatrix
);
DrawItem
->
DisplayInfo
(
this
);
DrawPanel
->
Refresh
();
}
...
...
eeschema/tool_sch.cpp
View file @
96849d5a
...
...
@@ -287,9 +287,7 @@ void WinEDA_SchematicFrame::OnSelectOptionToolbar( wxCommandEvent& event )
return
;
int
id
=
event
.
GetId
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
switch
(
id
)
{
...
...
eeschema/viewlibs.cpp
View file @
96849d5a
...
...
@@ -189,9 +189,6 @@ void WinEDA_ViewlibFrame::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
int
NumOfParts
=
0
;
CMP_LIB_ENTRY
*
LibEntry
;
wxString
CmpName
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
if
(
Lib
)
NumOfParts
=
Lib
->
GetCount
();
...
...
@@ -234,7 +231,7 @@ void WinEDA_ViewlibFrame::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
m_entryName
=
CmpName
;
DisplayLibInfos
();
Zoom_Automatique
(
false
);
RedrawActiveWindow
(
&
dc
,
true
);
DrawPanel
->
Refresh
(
);
if
(
m_CmpList
)
{
...
...
gerbview/edit.cpp
View file @
96849d5a
...
...
@@ -75,9 +75,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
int
layer
=
GetScreen
()
->
m_Active_Layer
;
GERBER
*
gerber_layer
=
g_GERBER_List
[
layer
];
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
...
...
@@ -263,9 +261,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
void
WinEDA_GerberFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
{
EDA_BaseStruct
*
DrawStruct
=
GetScreen
()
->
GetCurItem
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
m_ID_current_state
)
{
...
...
include/class_drawpanel.h
View file @
96849d5a
...
...
@@ -75,7 +75,6 @@ public:
BASE_SCREEN
*
GetScreen
();
void
PrepareGraphicContext
(
wxDC
*
DC
);
bool
IsPointOnDisplay
(
wxPoint
ref_pos
);
void
OnPaint
(
wxPaintEvent
&
event
);
void
OnSize
(
wxSizeEvent
&
event
);
...
...
@@ -181,5 +180,12 @@ public:
DECLARE_EVENT_TABLE
()
};
// Helper class to handle the client Device Context
class
KicadGraphicContext
:
public
wxClientDC
{
public
:
KicadGraphicContext
(
WinEDA_DrawPanel
*
aDrawPanel
);
~
KicadGraphicContext
();
};
#endif
/* #ifndef PANEL_WXSTRUCT_H */
pcbnew/automove.cpp
View file @
96849d5a
...
...
@@ -36,14 +36,12 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
{
int
id
=
event
.
GetId
();
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
bool
on_state
;
if
(
m_HToolBar
==
NULL
)
return
;
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
switch
(
id
)
...
...
pcbnew/dialog_general_options.cpp
View file @
96849d5a
...
...
@@ -169,12 +169,8 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case
ID_TB_OPTIONS_SHOW_RATSNEST
:
g_Show_Ratsnest
=
m_OptionsToolBar
->
GetToolState
(
id
);
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
Ratsnest_On_Off
(
&
dc
);
RedrawActiveWindow
(
&
dc
,
true
);
}
Ratsnest_On_Off
(
NULL
);
DrawPanel
->
Refresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
:
...
...
pcbnew/edit.cpp
View file @
96849d5a
...
...
@@ -32,8 +32,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
wxPoint
pos
;
int
itmp
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
DrawPanel
->
CursorOff
(
&
dc
);
...
...
pcbnew/export_gencad.cpp
View file @
96849d5a
...
...
@@ -91,9 +91,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
offsetX
=
m_Auxiliary_Axis_Position
.
x
;
offsetY
=
m_Auxiliary_Axis_Position
.
y
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
Compile_Ratsnest
(
&
dc
,
TRUE
);
/* Temporary modification of footprints that are flipped (i.e. on bottom
...
...
pcbnew/files.cpp
View file @
96849d5a
...
...
@@ -17,7 +17,7 @@
void
WinEDA_PcbFrame
::
OnFileHistory
(
wxCommandEvent
&
event
)
{
wxString
fn
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
fn
=
GetFileFromHistory
(
event
.
GetId
(),
_
(
"Printed circuit board"
)
);
...
...
@@ -25,7 +25,6 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
{
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
{
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
}
...
...
@@ -52,8 +51,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
// If an edition is in progress, stop it
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
}
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
...
...
pcbnew/globaleditpad.cpp
View file @
96849d5a
...
...
@@ -80,9 +80,8 @@ void DIALOG_GLOBAL_PADS_EDITION::OnCancelClick( wxCommandEvent& event )
*/
void
DIALOG_GLOBAL_PADS_EDITION
::
InstallPadEditor
(
wxCommandEvent
&
event
)
{
wxClientDC
dc
(
m_Parent
->
DrawPanel
);
KicadGraphicContext
dc
(
m_Parent
->
DrawPanel
);
m_Parent
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
m_Parent
->
DrawPanel
->
CursorOff
(
&
dc
);
m_Parent
->
InstallPadOptionsFrame
(
m_CurrentPad
,
&
dc
,
wxDefaultPosition
);
m_Parent
->
DrawPanel
->
CursorOn
(
&
dc
);
...
...
pcbnew/modedit.cpp
View file @
96849d5a
...
...
@@ -147,9 +147,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
wxPoint
pos
;
bool
redraw
=
false
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
pos
.
y
+=
20
;
...
...
pcbnew/modedit_onclick.cpp
View file @
96849d5a
...
...
@@ -382,9 +382,6 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
wxPoint
pos
=
GetPosition
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
m_ID_current_state
)
{
...
...
@@ -403,7 +400,7 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
switch
(
DrawStruct
->
Type
()
)
{
case
TYPE_PAD
:
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
&
dc
,
pos
);
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
DC
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
@@ -420,7 +417,7 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break
;
case
TYPE_TEXTE_MODULE
:
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
&
dc
);
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
DC
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
pcbnew/modeditoptions.cpp
View file @
96849d5a
...
...
@@ -18,15 +18,12 @@
void
WinEDA_ModuleEditFrame
::
OnSelectOptionToolbar
(
wxCommandEvent
&
event
)
{
int
id
=
event
.
GetId
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
CursorOff
(
&
dc
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
id
)
{
case
ID_TB_OPTIONS_SHOW_GRID
:
m_Draw_Grid
=
m_OptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Re
Draw
(
&
dc
,
TRUE
);
DrawPanel
->
Re
fresh
(
);
break
;
case
ID_TB_OPTIONS_SELECT_UNIT_MM
:
...
...
@@ -51,24 +48,24 @@ void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case
ID_TB_OPTIONS_SHOW_PADS_SKETCH
:
m_DisplayPadFill
=
!
m_OptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Re
Draw
(
&
dc
,
TRUE
);
DrawPanel
->
Re
fresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_VIAS_SKETCH
:
m_DisplayViaFill
=
!
m_OptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Re
Draw
(
&
dc
,
TRUE
);
DrawPanel
->
Re
fresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
:
m_DisplayModText
=
m_OptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
DrawPanel
->
Re
Draw
(
&
dc
,
TRUE
);
DrawPanel
->
Re
fresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
:
m_DisplayModEdge
=
m_OptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
DrawPanel
->
Re
Draw
(
&
dc
,
TRUE
);
DrawPanel
->
Re
fresh
(
);
break
;
default
:
...
...
@@ -78,5 +75,4 @@ void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
}
SetToolbars
();
DrawPanel
->
CursorOn
(
&
dc
);
}
pcbnew/muwave_command.cpp
View file @
96849d5a
...
...
@@ -20,9 +20,7 @@ void WinEDA_PcbFrame::ProcessMuWaveFunctions( wxCommandEvent& event )
{
int
id
=
event
.
GetId
();
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
...
...
pcbnew/onleftclick.cpp
View file @
96849d5a
...
...
@@ -388,9 +388,6 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
wxPoint
pos
=
GetPosition
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
m_ID_current_state
)
{
...
...
@@ -429,38 +426,38 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break
;
case
TYPE_PAD
:
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
&
dc
,
pos
);
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
DC
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
break
;
case
TYPE_MODULE
:
InstallModuleOptionsFrame
(
(
MODULE
*
)
DrawStruct
,
&
dc
);
InstallModuleOptionsFrame
(
(
MODULE
*
)
DrawStruct
,
DC
);
DrawPanel
->
MouseToCursorSchema
();
break
;
case
TYPE_MIRE
:
InstallMireOptionsFrame
(
(
MIREPCB
*
)
DrawStruct
,
&
dc
,
pos
);
InstallMireOptionsFrame
(
(
MIREPCB
*
)
DrawStruct
,
DC
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
break
;
case
TYPE_COTATION
:
Install_Edit_Cotation
(
(
COTATION
*
)
DrawStruct
,
&
dc
,
pos
);
Install_Edit_Cotation
(
(
COTATION
*
)
DrawStruct
,
DC
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
break
;
case
TYPE_TEXTE_MODULE
:
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
&
dc
);
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
DC
);
DrawPanel
->
MouseToCursorSchema
();
break
;
case
TYPE_DRAWSEGMENT
:
InstallGraphicItemPropertiesDialog
(
(
DRAWSEGMENT
*
)
DrawStruct
,
&
dc
);
InstallGraphicItemPropertiesDialog
(
(
DRAWSEGMENT
*
)
DrawStruct
,
DC
);
break
;
case
TYPE_ZONE_CONTAINER
:
if
(
DrawStruct
->
m_Flags
)
break
;
Edit_Zone_Params
(
&
dc
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
Edit_Zone_Params
(
DC
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
break
;
default
:
...
...
@@ -498,7 +495,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
}
if
(
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
End_Edge
(
(
DRAWSEGMENT
*
)
DrawStruct
,
&
dc
);
End_Edge
(
(
DRAWSEGMENT
*
)
DrawStruct
,
DC
);
DrawPanel
->
m_AutoPAN_Request
=
false
;
SetCurItem
(
NULL
);
}
...
...
pcbnew/pcbnew_config.cpp
View file @
96849d5a
...
...
@@ -30,12 +30,10 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
int
id
=
event
.
GetId
();
wxPoint
pos
;
wxClientDC
dc
(
DrawPanel
);
KicadGraphicContext
dc
(
DrawPanel
);
wxFileName
fn
;
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
pos
=
GetPosition
();
pos
.
x
+=
20
;
pos
.
y
+=
20
;
...
...
pcbnew/surbrill.cpp
View file @
96849d5a
...
...
@@ -72,9 +72,7 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
if
(
found
)
{
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
KicadGraphicContext
dc
(
DrawPanel
);
if
(
g_HightLigt_Status
)
Hight_Light
(
&
dc
);
...
...
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