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
95891006
Commit
95891006
authored
Dec 14, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More EDA_DRAW_FRAME encapsulation work.
parent
463c17b8
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
560 additions
and
530 deletions
+560
-530
drawframe.cpp
common/drawframe.cpp
+26
-29
drawpanel.cpp
common/drawpanel.cpp
+10
-10
worksheet.cpp
common/worksheet.cpp
+1
-1
class_DisplayFootprintsFrame.cpp
cvpcb/class_DisplayFootprintsFrame.cpp
+20
-20
libeditframe.cpp
eeschema/libeditframe.cpp
+5
-5
schedit.cpp
eeschema/schedit.cpp
+1
-1
schframe.cpp
eeschema/schframe.cpp
+11
-11
tool_lib.cpp
eeschema/tool_lib.cpp
+34
-33
tool_sch.cpp
eeschema/tool_sch.cpp
+69
-67
dialog_show_page_borders.cpp
gerbview/dialogs/dialog_show_page_borders.cpp
+4
-7
gerbview_dialog_display_options_frame.cpp
gerbview/dialogs/gerbview_dialog_display_options_frame.cpp
+9
-12
gerbview_frame.cpp
gerbview/gerbview_frame.cpp
+10
-10
options.cpp
gerbview/options.cpp
+1
-1
toolbars_gerber.cpp
gerbview/toolbars_gerber.cpp
+27
-27
wxBasePcbFrame.h
include/wxBasePcbFrame.h
+4
-3
wxPcbStruct.h
include/wxPcbStruct.h
+3
-0
wxstruct.h
include/wxstruct.h
+53
-24
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+21
-19
dialog_gendrill.cpp
pcbnew/dialogs/dialog_gendrill.cpp
+1
-1
dialog_general_options.cpp
pcbnew/dialogs/dialog_general_options.cpp
+5
-6
edit.cpp
pcbnew/edit.cpp
+2
-2
export_gencad.cpp
pcbnew/export_gencad.cpp
+4
-4
gen_modules_placefile.cpp
pcbnew/gen_modules_placefile.cpp
+1
-1
hotkeys_board_editor.cpp
pcbnew/hotkeys_board_editor.cpp
+11
-11
ioascii.cpp
pcbnew/ioascii.cpp
+4
-4
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+2
-2
modeditoptions.cpp
pcbnew/modeditoptions.cpp
+4
-4
moduleframe.cpp
pcbnew/moduleframe.cpp
+9
-9
onleftclick.cpp
pcbnew/onleftclick.cpp
+1
-1
pcbframe.cpp
pcbnew/pcbframe.cpp
+19
-18
plotgerb.cpp
pcbnew/plotgerb.cpp
+1
-1
set_grid.cpp
pcbnew/set_grid.cpp
+2
-2
tool_modedit.cpp
pcbnew/tool_modedit.cpp
+59
-59
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+117
-116
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+9
-9
No files found.
common/drawframe.cpp
View file @
95891006
...
...
@@ -88,28 +88,25 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
{
wxSize
minsize
;
m_VToolBar
=
NULL
;
m_AuxVToolBar
=
NULL
;
m_OptionsToolBar
=
NULL
;
m_AuxiliaryToolBar
=
NULL
;
m_SelGridBox
=
NULL
;
m_SelZoomBox
=
NULL
;
m_drawToolBar
=
NULL
;
m_optionsToolBar
=
NULL
;
m_gridSelectBox
=
NULL
;
m_zoomSelectBox
=
NULL
;
m_HotkeysZoomAndGridList
=
NULL
;
DrawPanel
=
NULL
;
m_messagePanel
=
NULL
;
m_currentScreen
=
NULL
;
m_toolId
=
ID_NO_TOOL_SELECTED
;
m_
ID_last_state
=
ID_NO_TOOL_SELECTED
;
m_
lastDrawToolId
=
ID_NO_TOOL_SELECTED
;
m_HTOOL_current_state
=
0
;
m_Draw_Axis
=
false
;
// true to draw axis.
m_Draw_Sheet_Ref
=
false
;
// true to display reference sheet.
m_Print_Sheet_Ref
=
true
;
// true to print reference sheet.
m_Draw_Auxiliary_Axis
=
false
;
// true draw auxiliary axis.
m_Draw_Grid_Axis
=
false
;
// true to draw the grid axis
m_CursorShape
=
0
;
m_showAxis
=
false
;
// true to draw axis.
m_showBorderAndTitleBlock
=
false
;
// true to display reference sheet.
m_Print_Sheet_Ref
=
true
;
// true to print reference sheet.
m_showGridAxis
=
false
;
// true to draw the grid axis
m_cursorShape
=
0
;
m_LastGridSizeId
=
0
;
m_DrawGrid
=
true
;
// hide/Show grid. default = show
m_DrawGrid
=
true
;
// hide/Show grid. default = show
m_GridColor
=
DARKGRAY
;
// Grid color
m_snapToGrid
=
true
;
...
...
@@ -229,7 +226,7 @@ void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
{
INSTALL_UNBUFFERED_DC
(
dc
,
DrawPanel
);
DrawPanel
->
CrossHairOff
(
&
dc
);
m_
CursorShape
=
!
m_C
ursorShape
;
m_
cursorShape
=
!
m_c
ursorShape
;
DrawPanel
->
CrossHairOn
(
&
dc
);
}
...
...
@@ -265,13 +262,13 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent )
wxString
tool_tip
=
IsGridVisible
()
?
_
(
"Hide grid"
)
:
_
(
"Show grid"
);
aEvent
.
Check
(
IsGridVisible
()
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_GRID
,
tool_tip
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_GRID
,
tool_tip
);
}
void
EDA_DRAW_FRAME
::
OnUpdateCrossHairStyle
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
m_
C
ursorShape
);
aEvent
.
Check
(
m_
c
ursorShape
);
}
...
...
@@ -308,7 +305,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
if
(
event
.
GetEventType
()
==
wxEVT_COMMAND_COMBOBOX_SELECTED
)
{
if
(
m_
SelGrid
Box
==
NULL
)
if
(
m_
gridSelect
Box
==
NULL
)
return
;
/*
...
...
@@ -316,9 +313,9 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
* returns NULL in GTK. This solution is not as elegant but
* it works.
*/
int
index
=
m_
SelGrid
Box
->
GetSelection
();
int
index
=
m_
gridSelect
Box
->
GetSelection
();
wxASSERT
(
index
!=
wxNOT_FOUND
);
clientData
=
(
int
*
)
m_
SelGrid
Box
->
wxItemContainer
::
GetClientData
(
index
);
clientData
=
(
int
*
)
m_
gridSelect
Box
->
wxItemContainer
::
GetClientData
(
index
);
if
(
clientData
!=
NULL
)
id
=
*
clientData
;
...
...
@@ -330,15 +327,15 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
/* Update the grid select combobox if the grid size was changed
* by menu event.
*/
if
(
m_
SelGrid
Box
!=
NULL
)
if
(
m_
gridSelect
Box
!=
NULL
)
{
for
(
size_t
i
=
0
;
i
<
m_
SelGrid
Box
->
GetCount
();
i
++
)
for
(
size_t
i
=
0
;
i
<
m_
gridSelect
Box
->
GetCount
();
i
++
)
{
clientData
=
(
int
*
)
m_
SelGrid
Box
->
wxItemContainer
::
GetClientData
(
i
);
clientData
=
(
int
*
)
m_
gridSelect
Box
->
wxItemContainer
::
GetClientData
(
i
);
if
(
clientData
&&
id
==
*
clientData
)
{
m_
SelGrid
Box
->
SetSelection
(
i
);
m_
gridSelect
Box
->
SetSelection
(
i
);
break
;
}
}
...
...
@@ -364,12 +361,12 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
void
EDA_DRAW_FRAME
::
OnSelectZoom
(
wxCommandEvent
&
event
)
{
if
(
m_
SelZoom
Box
==
NULL
)
if
(
m_
zoomSelect
Box
==
NULL
)
return
;
// Should not happen!
int
id
=
m_
SelZoom
Box
->
GetCurrentSelection
();
int
id
=
m_
zoomSelect
Box
->
GetCurrentSelection
();
if
(
id
<
0
||
!
(
id
<
(
int
)
m_
SelZoom
Box
->
GetCount
()
)
)
if
(
id
<
0
||
!
(
id
<
(
int
)
m_
zoomSelect
Box
->
GetCount
()
)
)
return
;
if
(
id
==
0
)
// Auto zoom (Fit in Page)
...
...
@@ -839,7 +836,7 @@ void EDA_DRAW_FRAME::LoadSettings()
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
m_FrameName
+
CursorShapeEntryKeyword
,
&
m_
C
ursorShape
,
(
long
)
0
);
cfg
->
Read
(
m_FrameName
+
CursorShapeEntryKeyword
,
&
m_
c
ursorShape
,
(
long
)
0
);
bool
btmp
;
if
(
cfg
->
Read
(
m_FrameName
+
ShowGridEntryKeyword
,
&
btmp
)
)
...
...
@@ -861,7 +858,7 @@ void EDA_DRAW_FRAME::SaveSettings()
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
EDA_BASE_FRAME
::
SaveSettings
();
cfg
->
Write
(
m_FrameName
+
CursorShapeEntryKeyword
,
m_
C
ursorShape
);
cfg
->
Write
(
m_FrameName
+
CursorShapeEntryKeyword
,
m_
c
ursorShape
);
cfg
->
Write
(
m_FrameName
+
ShowGridEntryKeyword
,
IsGridVisible
()
);
cfg
->
Write
(
m_FrameName
+
GridColorEntryKeyword
,
GetGridColor
()
);
cfg
->
Write
(
m_FrameName
+
LastGridSizeId
,
(
long
)
m_LastGridSizeId
);
...
...
common/drawpanel.cpp
View file @
95891006
...
...
@@ -150,7 +150,7 @@ void EDA_DRAW_PANEL::DrawCrossHair( wxDC* aDC, int aColor )
GRSetDrawMode
(
aDC
,
GR_XOR
);
if
(
GetParent
()
->
m_
CursorShape
==
1
)
/* Draws a
crosshair. */
if
(
GetParent
()
->
m_
cursorShape
!=
0
)
/* Draws full screen
crosshair. */
{
wxSize
clientSize
=
GetClientSize
();
wxPoint
lineStart
=
wxPoint
(
Cursor
.
x
,
aDC
->
DeviceToLogicalY
(
0
)
);
...
...
@@ -535,7 +535,7 @@ void EDA_DRAW_PANEL::DrawBackGround( wxDC* DC )
DrawGrid
(
DC
);
/* Draw axis */
if
(
GetParent
()
->
m_
Draw_
Axis
)
if
(
GetParent
()
->
m_
show
Axis
)
{
/* Draw the Y axis */
GRDashedLine
(
&
m_ClipBox
,
DC
,
0
,
-
screen
->
ReturnPageSize
().
y
,
...
...
@@ -546,10 +546,10 @@ void EDA_DRAW_PANEL::DrawBackGround( wxDC* DC )
screen
->
ReturnPageSize
().
x
,
0
,
0
,
axis_color
);
}
if
(
GetParent
()
->
m_
Draw_Auxiliary_
Axis
)
if
(
GetParent
()
->
m_
showOrigin
Axis
)
DrawAuxiliaryAxis
(
DC
,
GR_COPY
);
if
(
GetParent
()
->
m_
Draw_Grid_
Axis
)
if
(
GetParent
()
->
m_
showGrid
Axis
)
DrawGridAxis
(
DC
,
GR_COPY
);
}
...
...
@@ -676,7 +676,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
void
EDA_DRAW_PANEL
::
DrawAuxiliaryAxis
(
wxDC
*
aDC
,
int
aDrawMode
)
{
if
(
GetParent
()
->
m_
Auxiliary_Axis_
Position
==
wxPoint
(
0
,
0
)
)
if
(
GetParent
()
->
m_
originAxis
Position
==
wxPoint
(
0
,
0
)
)
return
;
int
Color
=
DARKRED
;
...
...
@@ -686,18 +686,18 @@ void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode )
/* Draw the Y axis */
GRDashedLine
(
&
m_ClipBox
,
aDC
,
GetParent
()
->
m_
Auxiliary_Axis_
Position
.
x
,
GetParent
()
->
m_
originAxis
Position
.
x
,
-
screen
->
ReturnPageSize
().
y
,
GetParent
()
->
m_
Auxiliary_Axis_
Position
.
x
,
GetParent
()
->
m_
originAxis
Position
.
x
,
screen
->
ReturnPageSize
().
y
,
0
,
Color
);
/* Draw the X axis */
GRDashedLine
(
&
m_ClipBox
,
aDC
,
-
screen
->
ReturnPageSize
().
x
,
GetParent
()
->
m_
Auxiliary_Axis_
Position
.
y
,
GetParent
()
->
m_
originAxis
Position
.
y
,
screen
->
ReturnPageSize
().
x
,
GetParent
()
->
m_
Auxiliary_Axis_
Position
.
y
,
GetParent
()
->
m_
originAxis
Position
.
y
,
0
,
Color
);
}
...
...
@@ -706,7 +706,7 @@ void EDA_DRAW_PANEL::DrawGridAxis( wxDC* aDC, int aDrawMode )
{
BASE_SCREEN
*
screen
=
GetScreen
();
if
(
!
GetParent
()
->
m_
Draw_Grid_
Axis
if
(
!
GetParent
()
->
m_
showGrid
Axis
||
(
screen
->
m_GridOrigin
.
x
==
0
&&
screen
->
m_GridOrigin
.
y
==
0
)
)
return
;
...
...
common/worksheet.cpp
View file @
95891006
...
...
@@ -993,7 +993,7 @@ Ki_WorkSheetData WS_Segm5_LT =
*/
void
EDA_DRAW_FRAME
::
TraceWorkSheet
(
wxDC
*
DC
,
BASE_SCREEN
*
screen
,
int
line_width
)
{
if
(
!
m_
Draw_Sheet_Ref
)
if
(
!
m_
showBorderAndTitleBlock
)
return
;
Ki_PageDescr
*
Sheet
=
screen
->
m_CurrentSheetDesc
;
...
...
cvpcb/class_DisplayFootprintsFrame.cpp
View file @
95891006
...
...
@@ -79,7 +79,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
PCB_BASE_FRAME
(
father
,
CVPCB_DISPLAY_FRAME
,
title
,
pos
,
size
,
style
)
{
m_FrameName
=
wxT
(
"CmpFrame"
);
m_
Draw_
Axis
=
true
;
// true to draw axis.
m_
show
Axis
=
true
;
// true to draw axis.
// Give an icon
wxIcon
icon
;
...
...
@@ -124,9 +124,9 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr
.
AddPane
(
m_HToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
if
(
m_
V
ToolBar
)
// Currently, no vertical right toolbar.
m_auimgr
.
AddPane
(
m_
V
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
V
ToolBar"
)
).
Right
()
);
if
(
m_
draw
ToolBar
)
// Currently, no vertical right toolbar.
m_auimgr
.
AddPane
(
m_
draw
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
draw
ToolBar"
)
).
Right
()
);
m_auimgr
.
AddPane
(
DrawPanel
,
wxAuiPaneInfo
().
Name
(
wxT
(
"DisplayFrame"
)
).
CentrePane
()
);
...
...
@@ -134,8 +134,8 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr
.
AddPane
(
m_messagePanel
,
wxAuiPaneInfo
(
mesg
).
Name
(
wxT
(
"MsgPanel"
)
).
Bottom
().
Layer
(
10
)
);
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
Update
();
...
...
@@ -174,45 +174,45 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateVToolbar()
void
DISPLAY_FOOTPRINTS_FRAME
::
ReCreateOptToolbar
()
{
if
(
m_
O
ptionsToolBar
)
if
(
m_
o
ptionsToolBar
)
return
;
// Create options tool bar.
m_
O
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
o
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
_
(
"Hide grid"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
KiBitmap
(
polar_coord_xpm
),
_
(
"Display polar coordinates"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
KiBitmap
(
unit_inch_xpm
),
_
(
"Units in inches"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
KiBitmap
(
unit_mm_xpm
),
_
(
"Units in millimeters"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
KiBitmap
(
cursor_shape_xpm
),
_
(
"Change cursor shape"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddSeparator
();
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddSeparator
();
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
wxEmptyString
,
KiBitmap
(
pad_sketch_xpm
),
_
(
"Show pads in outline mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
wxEmptyString
,
KiBitmap
(
text_sketch_xpm
),
_
(
"Show texts in line mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
wxEmptyString
,
KiBitmap
(
show_mod_edge_xpm
),
_
(
"Show outlines in line mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
Realize
();
m_
o
ptionsToolBar
->
Realize
();
}
...
...
@@ -262,7 +262,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
i
=
0
;
aEvent
.
Check
(
m_DisplayModText
==
0
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
msgTextsFill
[
i
]
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
msgTextsFill
[
i
]
);
}
...
...
@@ -279,7 +279,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
i
=
0
;
aEvent
.
Check
(
m_DisplayModEdge
==
0
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
msgEdgesFill
[
i
]
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
msgEdgesFill
[
i
]
);
}
...
...
eeschema/libeditframe.cpp
View file @
95891006
...
...
@@ -194,7 +194,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
wxASSERT
(
aParent
);
m_FrameName
=
wxT
(
"LibeditFrame"
);
m_
Draw_Axis
=
true
;
// true to draw axis
m_
showAxis
=
true
;
// true to draw axis
m_configPath
=
wxT
(
"LibraryEditor"
);
SetShowDeMorgan
(
false
);
m_drawSpecificConvert
=
true
;
...
...
@@ -250,11 +250,11 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
m_auimgr
.
AddPane
(
m_HToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
m_auimgr
.
AddPane
(
m_
V
ToolBar
,
m_auimgr
.
AddPane
(
m_
draw
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_VToolBar"
)
).
Right
()
);
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
AddPane
(
DrawPanel
,
wxAuiPaneInfo
().
Name
(
wxT
(
"DrawFrame"
)
).
CentrePane
()
);
...
...
@@ -450,7 +450,7 @@ void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent )
{
aEvent
.
Enable
(
m_component
!=
NULL
);
if
(
m_component
!=
NULL
&&
aEvent
.
GetEventObject
()
==
m_
V
ToolBar
)
if
(
m_component
!=
NULL
&&
aEvent
.
GetEventObject
()
==
m_
draw
ToolBar
)
aEvent
.
Check
(
GetToolId
()
==
aEvent
.
GetId
()
);
}
...
...
eeschema/schedit.cpp
View file @
95891006
...
...
@@ -550,7 +550,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
void
SCH_EDIT_FRAME
::
OnUpdateSelectTool
(
wxUpdateUIEvent
&
aEvent
)
{
if
(
aEvent
.
GetEventObject
()
==
m_
V
ToolBar
)
if
(
aEvent
.
GetEventObject
()
==
m_
draw
ToolBar
)
aEvent
.
Check
(
GetToolId
()
==
aEvent
.
GetId
()
);
}
...
...
eeschema/schframe.cpp
View file @
95891006
...
...
@@ -186,12 +186,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
EDA_DRAW_FRAME
(
father
,
SCHEMATIC_FRAME
,
title
,
pos
,
size
,
style
)
{
m_FrameName
=
wxT
(
"SchematicFrame"
);
m_
Draw_Axis
=
false
;
// true to show axis
m_
Draw_Sheet_Ref
=
true
;
// true to show sheet references
m_
showAxis
=
false
;
// true to show axis
m_
showBorderAndTitleBlock
=
true
;
// true to show sheet references
m_CurrentSheet
=
new
SCH_SHEET_PATH
();
m_TextFieldSize
=
DEFAULT_SIZE_TEXT
;
m_LibeditFrame
=
NULL
;
// Component editor frame.
m_ViewlibFrame
=
NULL
;
// Frame for browsing component libraries
m_LibeditFrame
=
NULL
;
// Component editor frame.
m_ViewlibFrame
=
NULL
;
// Frame for browsing component libraries
m_DefaultSchematicFileName
=
NAMELESS_PROJECT
;
m_DefaultSchematicFileName
+=
wxT
(
".sch"
);
m_showAllPins
=
false
;
...
...
@@ -253,12 +253,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_auimgr
.
AddPane
(
m_HToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
if
(
m_
V
ToolBar
)
m_auimgr
.
AddPane
(
m_
VToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_V
ToolBar"
)
).
Right
()
);
if
(
m_
draw
ToolBar
)
m_auimgr
.
AddPane
(
m_
drawToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_draw
ToolBar"
)
).
Right
()
);
if
(
m_
O
ptionsToolBar
)
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
()
);
if
(
m_
o
ptionsToolBar
)
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
()
);
if
(
DrawPanel
)
m_auimgr
.
AddPane
(
DrawPanel
,
wxAuiPaneInfo
().
Name
(
wxT
(
"DrawFrame"
)
).
CentrePane
()
);
...
...
@@ -585,7 +585,7 @@ void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& aEvent )
_
(
"Draw horizontal and vertical wires and buses only"
);
aEvent
.
Check
(
g_HVLines
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_BUS_WIRES_ORIENT
,
tool_tip
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_BUS_WIRES_ORIENT
,
tool_tip
);
}
...
...
@@ -595,7 +595,7 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
_
(
"Show hidden pins"
);
aEvent
.
Check
(
m_showAllPins
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_HIDDEN_PINS
,
tool_tip
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_HIDDEN_PINS
,
tool_tip
);
}
...
...
eeschema/tool_lib.cpp
View file @
95891006
...
...
@@ -52,46 +52,46 @@ extern int CreateNewLibAndSavePartId;
void
LIB_EDIT_FRAME
::
ReCreateVToolbar
()
{
if
(
m_
V
ToolBar
!=
NULL
)
if
(
m_
draw
ToolBar
!=
NULL
)
return
;
m_
V
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
false
);
m_
draw
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
false
);
// Set up toolbar
m_
V
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
),
_
(
"Deselect current tool"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
),
_
(
"Deselect current tool"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_PIN_BUTT
,
wxEmptyString
,
KiBitmap
(
pin_xpm
),
HELP_ADD_PIN
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_PIN_BUTT
,
wxEmptyString
,
KiBitmap
(
pin_xpm
),
HELP_ADD_PIN
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_TEXT_BUTT
,
wxEmptyString
,
KiBitmap
(
add_text_xpm
),
HELP_ADD_BODYTEXT
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_TEXT_BUTT
,
wxEmptyString
,
KiBitmap
(
add_text_xpm
),
HELP_ADD_BODYTEXT
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_RECT_BUTT
,
wxEmptyString
,
KiBitmap
(
add_rectangle_xpm
),
HELP_ADD_BODYRECT
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_RECT_BUTT
,
wxEmptyString
,
KiBitmap
(
add_rectangle_xpm
),
HELP_ADD_BODYRECT
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_CIRCLE_BUTT
,
wxEmptyString
,
KiBitmap
(
add_circle_xpm
),
HELP_ADD_BODYCIRCLE
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_CIRCLE_BUTT
,
wxEmptyString
,
KiBitmap
(
add_circle_xpm
),
HELP_ADD_BODYCIRCLE
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_ARC_BUTT
,
wxEmptyString
,
KiBitmap
(
add_arc_xpm
),
HELP_ADD_BODYARC
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_ARC_BUTT
,
wxEmptyString
,
KiBitmap
(
add_arc_xpm
),
HELP_ADD_BODYARC
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_LINE_BUTT
,
wxEmptyString
,
KiBitmap
(
add_polygon_xpm
),
HELP_ADD_BODYPOLYGON
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_BODY_LINE_BUTT
,
wxEmptyString
,
KiBitmap
(
add_polygon_xpm
),
HELP_ADD_BODYPOLYGON
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_ANCHOR_ITEM_BUTT
,
wxEmptyString
,
KiBitmap
(
anchor_xpm
),
_
(
"Move part anchor"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_ANCHOR_ITEM_BUTT
,
wxEmptyString
,
KiBitmap
(
anchor_xpm
),
_
(
"Move part anchor"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_IMPORT_BODY_BUTT
,
wxEmptyString
,
KiBitmap
(
import_xpm
),
_
(
"Import existing drawings"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_IMPORT_BODY_BUTT
,
wxEmptyString
,
KiBitmap
(
import_xpm
),
_
(
"Import existing drawings"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_EXPORT_BODY_BUTT
,
wxEmptyString
,
KiBitmap
(
export_xpm
),
_
(
"Export current drawing"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_EXPORT_BODY_BUTT
,
wxEmptyString
,
KiBitmap
(
export_xpm
),
_
(
"Export current drawing"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_LIBEDIT_DELETE_ITEM_BUTT
,
wxEmptyString
,
KiBitmap
(
delete_body_xpm
),
HELP_DELETE_ITEMS
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_LIBEDIT_DELETE_ITEM_BUTT
,
wxEmptyString
,
KiBitmap
(
delete_body_xpm
),
HELP_DELETE_ITEMS
,
wxITEM_CHECK
);
m_
V
ToolBar
->
Realize
();
m_
draw
ToolBar
->
Realize
();
}
...
...
@@ -143,7 +143,8 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Undo last command"
),
s_Schematic_Hokeys_Descr
,
HK_UNDO
,
IS_COMMENT
);
m_HToolBar
->
AddTool
(
wxID_UNDO
,
wxEmptyString
,
KiBitmap
(
undo_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redo the last command"
),
s_Schematic_Hokeys_Descr
,
HK_REDO
,
IS_COMMENT
);
msg
=
AddHotkeyName
(
_
(
"Redo the last command"
),
s_Schematic_Hokeys_Descr
,
HK_REDO
,
IS_COMMENT
);
m_HToolBar
->
AddTool
(
wxID_REDO
,
wxEmptyString
,
KiBitmap
(
redo_xpm
),
msg
);
m_HToolBar
->
AddSeparator
();
...
...
@@ -209,24 +210,24 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
void
LIB_EDIT_FRAME
::
CreateOptionToolbar
()
{
if
(
m_
O
ptionsToolBar
)
if
(
m_
o
ptionsToolBar
)
return
;
m_
O
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
o
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
_
(
"Turn grid off"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
KiBitmap
(
unit_inch_xpm
),
_
(
"Units in inches"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
KiBitmap
(
unit_mm_xpm
),
_
(
"Units in millimeters"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
KiBitmap
(
cursor_shape_xpm
),
_
(
"Change cursor shape"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
Realize
();
m_
o
ptionsToolBar
->
Realize
();
}
eeschema/tool_sch.cpp
View file @
95891006
This diff is collapsed.
Click to expand it.
gerbview/dialogs/dialog_show_page_borders.cpp
View file @
95891006
...
...
@@ -40,7 +40,8 @@ DIALOG_PAGE_SHOW_PAGE_BORDERS::DIALOG_PAGE_SHOW_PAGE_BORDERS( GERBVIEW_FRAME *pa
SetFocus
();
m_ShowPageLimits
->
SetSelection
(
0
);
if
(
m_Parent
->
m_Draw_Sheet_Ref
)
if
(
m_Parent
->
GetShowBorderAndTitleBlock
()
)
{
for
(
int
ii
=
1
;
g_GerberPageSizeList
[
ii
]
!=
NULL
;
ii
++
)
{
...
...
@@ -67,16 +68,12 @@ void DIALOG_PAGE_SHOW_PAGE_BORDERS::OnCancelButtonClick( wxCommandEvent& event )
void
DIALOG_PAGE_SHOW_PAGE_BORDERS
::
OnOKBUttonClick
(
wxCommandEvent
&
event
)
{
m_Parent
->
m_DisplayPadFill
=
m_Parent
->
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_Parent
->
m_DisplayPadFill
=
m_Parent
->
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_Parent
->
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
int
idx
=
m_ShowPageLimits
->
GetSelection
();
if
(
idx
>
0
)
m_Parent
->
m_Draw_Sheet_Ref
=
true
;
else
m_Parent
->
m_Draw_Sheet_Ref
=
false
;
m_Parent
->
SetShowBorderAndTitleBlock
(
(
idx
>
0
)
?
true
:
false
);
m_Parent
->
GetScreen
()
->
m_CurrentSheetDesc
=
g_GerberPageSizeList
[
idx
];
EndModal
(
wxID_OK
);
...
...
gerbview/dialogs/gerbview_dialog_display_options_frame.cpp
View file @
95891006
...
...
@@ -65,7 +65,7 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
m_PolarDisplay
->
SetSelection
(
DisplayOpt
.
DisplayPolarCood
?
1
:
0
);
m_BoxUnits
->
SetSelection
(
g_UserUnit
?
1
:
0
);
m_CursorShape
->
SetSelection
(
m_Parent
->
m_CursorShape
?
1
:
0
);
m_CursorShape
->
SetSelection
(
m_Parent
->
GetCursorShape
()
?
1
:
0
);
// Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
m_OptDisplayLines
->
SetSelection
(
DisplayOpt
.
DisplayPcbTrackFill
?
1
:
0
);
...
...
@@ -74,7 +74,8 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
m_OptDisplayPolygons
->
SetSelection
(
g_DisplayPolygonsModeSketch
?
0
:
1
);
m_ShowPageLimits
->
SetSelection
(
0
);
if
(
m_Parent
->
m_Draw_Sheet_Ref
)
if
(
m_Parent
->
GetShowBorderAndTitleBlock
()
)
{
for
(
int
ii
=
1
;
g_GerberPageSizeList
[
ii
]
!=
NULL
;
ii
++
)
{
...
...
@@ -92,14 +93,14 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
void
DIALOG_DISPLAY_OPTIONS
::
OnOKBUttonClick
(
wxCommandEvent
&
event
)
{
DisplayOpt
.
DisplayPolarCood
=
(
m_PolarDisplay
->
GetSelection
()
==
0
)
?
FALSE
:
TRUE
;
(
m_PolarDisplay
->
GetSelection
()
==
0
)
?
false
:
true
;
g_UserUnit
=
(
m_BoxUnits
->
GetSelection
()
==
0
)
?
INCHES
:
MILLIMETRES
;
m_Parent
->
m_CursorShape
=
m_CursorShape
->
GetSelection
(
);
m_Parent
->
SetCursorShape
(
m_CursorShape
->
GetSelection
()
);
if
(
m_OptDisplayLines
->
GetSelection
()
==
1
)
DisplayOpt
.
DisplayPcbTrackFill
=
TRUE
;
DisplayOpt
.
DisplayPcbTrackFill
=
true
;
else
DisplayOpt
.
DisplayPcbTrackFill
=
FALSE
;
DisplayOpt
.
DisplayPcbTrackFill
=
false
;
if
(
m_OptDisplayFlashedItems
->
GetSelection
()
==
1
)
{
...
...
@@ -120,16 +121,12 @@ void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event )
m_Parent
->
SetElementVisibility
(
DCODES_VISIBLE
,
m_OptDisplayDCodes
->
GetValue
()
);
m_Parent
->
m_DisplayPadFill
=
m_Parent
->
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_Parent
->
m_DisplayPadFill
=
m_Parent
->
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_Parent
->
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
int
idx
=
m_ShowPageLimits
->
GetSelection
();
if
(
idx
>
0
)
m_Parent
->
m_Draw_Sheet_Ref
=
true
;
else
m_Parent
->
m_Draw_Sheet_Ref
=
false
;
m_Parent
->
SetShowBorderAndTitleBlock
(
(
idx
>
0
)
?
true
:
false
);
m_Parent
->
GetScreen
()
->
m_CurrentSheetDesc
=
g_GerberPageSizeList
[
idx
];
EndModal
(
1
);
...
...
gerbview/gerbview_frame.cpp
View file @
95891006
...
...
@@ -67,8 +67,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_FrameName
=
wxT
(
"GerberFrame"
);
m_show_layer_manager_tools
=
true
;
m_
Draw_Axis
=
true
;
// true to show X and Y axis on screen
m_
Draw_Sheet_Ref
=
false
;
// true for reference drawings.
m_
showAxis
=
true
;
// true to show X and Y axis on screen
m_
showBorderAndTitleBlock
=
false
;
// true for reference drawings.
m_HotkeysZoomAndGridList
=
s_Gerbview_Hokeys_Descr
;
m_SelLayerBox
=
NULL
;
m_DCodeSelector
=
NULL
;
...
...
@@ -132,16 +132,16 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_auimgr
.
AddPane
(
m_HToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
if
(
m_
V
ToolBar
)
m_auimgr
.
AddPane
(
m_
V
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
V
ToolBar"
)
).
Right
().
Row
(
1
)
);
if
(
m_
draw
ToolBar
)
m_auimgr
.
AddPane
(
m_
draw
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
draw
ToolBar"
)
).
Right
().
Row
(
1
)
);
m_auimgr
.
AddPane
(
m_LayersManager
,
lyrs
.
Name
(
wxT
(
"m_LayersManagerToolBar"
)
).
Right
().
Layer
(
0
)
);
if
(
m_
O
ptionsToolBar
)
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
()
);
if
(
m_
o
ptionsToolBar
)
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
()
);
if
(
DrawPanel
)
m_auimgr
.
AddPane
(
DrawPanel
,
...
...
@@ -223,7 +223,7 @@ void GERBVIEW_FRAME::LoadSettings()
if
(
pageSize_opt
>
0
)
{
m_
Draw_Sheet_Ref
=
true
;
m_
showBorderAndTitleBlock
=
true
;
}
long
tmp
;
...
...
@@ -256,7 +256,7 @@ void GERBVIEW_FRAME::SaveSettings()
long
pageSize_opt
=
0
;
if
(
m_
Draw_Sheet_Ref
)
if
(
m_
showBorderAndTitleBlock
)
{
for
(
int
ii
=
1
;
g_GerberPageSizeList
[
ii
]
!=
NULL
;
ii
++
)
{
...
...
gerbview/options.cpp
View file @
95891006
...
...
@@ -28,7 +28,7 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
break
;
default
:
state
=
m_
O
ptionsToolBar
->
GetToolState
(
id
);
state
=
m_
o
ptionsToolBar
->
GetToolState
(
id
);
break
;
}
...
...
gerbview/toolbars_gerber.cpp
View file @
95891006
...
...
@@ -126,92 +126,92 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
void
GERBVIEW_FRAME
::
ReCreateVToolbar
(
void
)
{
if
(
m_
V
ToolBar
)
if
(
m_
draw
ToolBar
)
return
;
m_
V
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
FALSE
);
m_
draw
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
FALSE
);
// Set up toolbar
m_
V
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
)
);
m_
V
ToolBar
->
AddSeparator
();
m_
draw
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
)
);
m_
draw
ToolBar
->
AddSeparator
();
m_
V
ToolBar
->
Realize
();
m_
draw
ToolBar
->
Realize
();
}
void
GERBVIEW_FRAME
::
ReCreateOptToolbar
(
void
)
{
if
(
m_
O
ptionsToolBar
)
if
(
m_
o
ptionsToolBar
)
return
;
// creation of tool bar options
m_
O
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
FALSE
);
m_
o
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
FALSE
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
_
(
"Turn grid off"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
KiBitmap
(
polar_coord_xpm
),
_
(
"Turn polar coordinate on"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
KiBitmap
(
unit_inch_xpm
),
_
(
"Set units to inches"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
KiBitmap
(
unit_mm_xpm
),
_
(
"Set units to millimeters"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
KiBitmap
(
cursor_shape_xpm
),
_
(
"Change cursor shape"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddSeparator
();
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddSeparator
();
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH
,
wxEmptyString
,
KiBitmap
(
pad_sketch_xpm
),
_
(
"Show spots in sketch mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_LINES_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_LINES_SKETCH
,
wxEmptyString
,
KiBitmap
(
showtrack_xpm
),
_
(
"Show lines in sketch mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH
,
wxEmptyString
,
KiBitmap
(
opt_show_polygon_xpm
),
_
(
"Show polygons in sketch mode"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_DCODES
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_DCODES
,
wxEmptyString
,
KiBitmap
(
show_dcodenumber_xpm
),
_
(
"Show dcode number"
),
wxITEM_CHECK
);
// tools to select draw mode in GerbView
m_
O
ptionsToolBar
->
AddSeparator
();
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_0
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddSeparator
();
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_0
,
wxEmptyString
,
KiBitmap
(
gbr_select_mode0_xpm
),
_
(
"Show layers in raw mode \
(could have problems with negative items when more than one gerber file is shown)"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_1
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_1
,
wxEmptyString
,
KiBitmap
(
gbr_select_mode1_xpm
),
_
(
"Show layers in stacked mode \
(show negative items without artifacts, sometimes slow)"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_2
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GBR_MODE_2
,
wxEmptyString
,
KiBitmap
(
gbr_select_mode2_xpm
),
_
(
"Show layers in transparency mode \
(show negative items without artifacts, sometimes slow)"
),
wxITEM_CHECK
);
// Tools to show/hide toolbars:
m_
O
ptionsToolBar
->
AddSeparator
();
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR
,
m_
o
ptionsToolBar
->
AddSeparator
();
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR
,
wxEmptyString
,
KiBitmap
(
layers_manager_xpm
),
_
(
"Show/hide the layers manager toolbar"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
Realize
();
m_
o
ptionsToolBar
->
Realize
();
}
...
...
@@ -265,12 +265,12 @@ void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
{
aEvent
.
Check
(
m_show_layer_manager_tools
);
if
(
m_
O
ptionsToolBar
)
if
(
m_
o
ptionsToolBar
)
{
if
(
m_show_layer_manager_tools
)
m_
O
ptionsToolBar
->
SetToolShortHelp
(
aEvent
.
GetId
(),
_
(
"Hide layers manager"
)
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
aEvent
.
GetId
(),
_
(
"Hide layers manager"
)
);
else
m_
O
ptionsToolBar
->
SetToolShortHelp
(
aEvent
.
GetId
(),
_
(
"Show layers manager"
)
);
m_
o
ptionsToolBar
->
SetToolShortHelp
(
aEvent
.
GetId
(),
_
(
"Show layers manager"
)
);
}
}
...
...
include/wxBasePcbFrame.h
View file @
95891006
...
...
@@ -84,13 +84,14 @@ protected:
BOARD
*
m_Pcb
;
GENERAL_COLLECTOR
*
m_Collector
;
/// Auxiliary tool bar typically shown below the main tool bar at the top of the
/// main window.
EDA_TOOLBAR
*
m_auxiliaryToolBar
;
void
updateGridSelectBox
();
void
updateZoomSelectBox
();
virtual
void
unitsChangeRefresh
();
public
:
PCB_BASE_FRAME
(
wxWindow
*
father
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
...
...
include/wxPcbStruct.h
View file @
95891006
...
...
@@ -82,6 +82,9 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME
int
m_RecordingMacros
;
MACROS_RECORDED
m_Macros
[
10
];
/// The auxiliary right vertical tool bar used to access the microwave tools.
EDA_TOOLBAR
*
m_microWaveToolBar
;
protected
:
PCB_LAYER_WIDGET
*
m_Layers
;
...
...
include/wxstruct.h
View file @
95891006
...
...
@@ -376,19 +376,6 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
public
:
EDA_DRAW_PANEL
*
DrawPanel
;
// Draw area
EDA_TOOLBAR
*
m_VToolBar
;
// Vertical (right side) Toolbar
EDA_TOOLBAR
*
m_AuxVToolBar
;
// Auxiliary Vertical (right side)
// Toolbar
EDA_TOOLBAR
*
m_OptionsToolBar
;
// Options Toolbar (left side)
EDA_TOOLBAR
*
m_AuxiliaryToolBar
;
// Auxiliary Toolbar used in Pcbnew
wxComboBox
*
m_SelGridBox
;
// Choice box to choose the grid size
wxComboBox
*
m_SelZoomBox
;
// Choice box to choose the zoom value
int
m_CursorShape
;
// shape for cursor (0 = default
// cursor)
int
m_ID_last_state
;
// Id of previous active button
// on the vertical toolbar
int
m_HTOOL_current_state
;
// Id of active button on
// horizontal toolbar
...
...
@@ -396,18 +383,7 @@ public:
// = 1000 for Eeschema, = 10000
// for Pcbnew and GerbView
bool
m_Draw_Axis
;
// true to show X and Y axis
bool
m_Draw_Grid_Axis
;
// true to show grid axis.
bool
m_Draw_Sheet_Ref
;
// true to show frame references
bool
m_Print_Sheet_Ref
;
// true to print frame references
bool
m_Draw_Auxiliary_Axis
;
/* true to show auxiliary axis.
* Used in Pcbnew: the auxiliary
* axis is the origin of
* coordinates for drill, gerber
* and component position files
*/
wxPoint
m_Auxiliary_Axis_Position
;
// position of the auxiliary axis
protected
:
EDA_HOTKEY_CONFIG
*
m_HotkeysZoomAndGridList
;
...
...
@@ -415,9 +391,50 @@ protected:
bool
m_DrawGrid
;
// hide/Show grid
int
m_GridColor
;
// Grid color
/// Tool ID of previously active draw tool bar button.
int
m_lastDrawToolId
;
// on the vertical toolbar
/// The shape of the KiCad cursor. The default value (0) is the normal cross
/// hair cursor. Set to non-zero value to draw the full screen cursor.
/// @note This is not the system mouse cursor.
int
m_cursorShape
;
/// True shows the X and Y axis indicators.
bool
m_showAxis
;
/// True shows the grid axis indicators.
bool
m_showGridAxis
;
/// True shows the origin axis used to indicate the coordinate offset for
/// drill, gerber, and component position files.
bool
m_showOriginAxis
;
/// Position of the origin axis.
wxPoint
m_originAxisPosition
;
/// True shows the drawing border and title block.
bool
m_showBorderAndTitleBlock
;
/// Choice box to choose the grid size.
wxComboBox
*
m_gridSelectBox
;
/// Choice box to choose the zoom value.
wxComboBox
*
m_zoomSelectBox
;
/// The tool bar that contains the buttons for quick access to the application draw
/// tools. It typically is located on the right side of the main window.
EDA_TOOLBAR
*
m_drawToolBar
;
/// The options tool bar typcially located on the left edge of the main window.
EDA_TOOLBAR
*
m_optionsToolBar
;
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL
*
m_messagePanel
;
/// Let the #EDA_DRAW_PANEL object have access to the protected data since
/// it is closely tied to the #EDA_DRAW_FRAME.
friend
class
EDA_DRAW_PANEL
;
private
:
BASE_SCREEN
*
m_currentScreen
;
///< current used SCREEN
bool
m_snapToGrid
;
///< Indicates if cursor should be snapped to grid.
...
...
@@ -444,6 +461,18 @@ public:
~
EDA_DRAW_FRAME
();
wxPoint
GetOriginAxisPosition
()
const
{
return
m_originAxisPosition
;
}
void
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
)
{
m_originAxisPosition
=
aPosition
;
}
int
GetCursorShape
()
const
{
return
m_cursorShape
;
}
void
SetCursorShape
(
int
aCursorShape
)
{
m_cursorShape
=
aCursorShape
;
}
bool
GetShowBorderAndTitleBlock
()
const
{
return
m_showBorderAndTitleBlock
;
}
void
SetShowBorderAndTitleBlock
(
bool
aShow
)
{
m_showBorderAndTitleBlock
=
aShow
;
}
virtual
wxString
GetScreenDesc
();
/**
...
...
pcbnew/basepcbframe.cpp
View file @
95891006
...
...
@@ -104,6 +104,8 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father,
m_FastGrid1
=
0
;
m_FastGrid2
=
0
;
m_auxiliaryToolBar
=
NULL
;
}
...
...
@@ -132,7 +134,7 @@ EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
if
(
area
.
GetWidth
()
==
0
&&
area
.
GetHeight
()
==
0
)
{
if
(
m_
Draw_Sheet_Ref
)
if
(
m_
showBorderAndTitleBlock
)
{
area
.
SetOrigin
(
0
,
0
);
area
.
SetEnd
(
GetScreen
()
->
ReturnPageSize
().
x
,
...
...
@@ -298,7 +300,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
void
PCB_BASE_FRAME
::
OnUpdateCoordType
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
DisplayOpt
.
DisplayPolarCood
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
DisplayOpt
.
DisplayPolarCood
?
_
(
"Display rectangular coordinates"
)
:
_
(
"Display polar coordinates"
)
);
...
...
@@ -308,7 +310,7 @@ void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
void
PCB_BASE_FRAME
::
OnUpdatePadDrawMode
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
!
m_DisplayPadFill
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
m_DisplayPadFill
?
_
(
"Show pads in outline mode"
)
:
_
(
"Show pads in fill mode"
)
);
...
...
@@ -319,7 +321,7 @@ void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent )
{
// No need to update the grid select box if it doesn't exist or the grid setting change
// was made using the select box.
if
(
m_
SelGridBox
==
NULL
||
m_A
uxiliaryToolBar
==
NULL
)
if
(
m_
gridSelectBox
==
NULL
||
m_a
uxiliaryToolBar
==
NULL
)
return
;
int
select
=
wxNOT_FOUND
;
...
...
@@ -333,14 +335,14 @@ void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent )
}
}
if
(
select
!=
m_
SelGrid
Box
->
GetSelection
()
)
m_
SelGrid
Box
->
SetSelection
(
select
);
if
(
select
!=
m_
gridSelect
Box
->
GetSelection
()
)
m_
gridSelect
Box
->
SetSelection
(
select
);
}
void
PCB_BASE_FRAME
::
OnUpdateSelectZoom
(
wxUpdateUIEvent
&
aEvent
)
{
if
(
m_
SelZoomBox
==
NULL
||
m_A
uxiliaryToolBar
==
NULL
)
if
(
m_
zoomSelectBox
==
NULL
||
m_a
uxiliaryToolBar
==
NULL
)
return
;
int
current
=
0
;
...
...
@@ -354,8 +356,8 @@ void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
}
}
if
(
current
!=
m_
SelZoom
Box
->
GetSelection
()
)
m_
SelZoom
Box
->
SetSelection
(
current
);
if
(
current
!=
m_
zoomSelect
Box
->
GetSelection
()
)
m_
zoomSelect
Box
->
SetSelection
(
current
);
}
...
...
@@ -593,11 +595,11 @@ void PCB_BASE_FRAME::updateGridSelectBox()
UpdateStatusBar
();
DisplayUnitsMsg
();
if
(
m_
SelGrid
Box
==
NULL
)
if
(
m_
gridSelect
Box
==
NULL
)
return
;
// Update grid values with the current units setting.
m_
SelGrid
Box
->
Clear
();
m_
gridSelect
Box
->
Clear
();
wxString
msg
;
wxString
format
=
_
(
"Grid"
);
...
...
@@ -639,24 +641,24 @@ void PCB_BASE_FRAME::updateGridSelectBox()
else
msg
=
_
(
"User Grid"
);
m_
SelGrid
Box
->
Append
(
msg
,
(
void
*
)
&
grid
.
m_Id
);
m_
gridSelect
Box
->
Append
(
msg
,
(
void
*
)
&
grid
.
m_Id
);
if
(
(
m_LastGridSizeId
+
ID_POPUP_GRID_LEVEL_1000
)
==
GetScreen
()
->
GetGrid
(
i
).
m_Id
)
m_
SelGrid
Box
->
SetSelection
(
i
);
m_
gridSelect
Box
->
SetSelection
(
i
);
}
}
void
PCB_BASE_FRAME
::
updateZoomSelectBox
()
{
if
(
m_
SelZoom
Box
==
NULL
)
if
(
m_
zoomSelect
Box
==
NULL
)
return
;
wxString
msg
;
m_
SelZoom
Box
->
Clear
();
m_
SelZoom
Box
->
Append
(
_
(
"Auto"
)
);
m_
SelZoom
Box
->
SetSelection
(
0
);
m_
zoomSelect
Box
->
Clear
();
m_
zoomSelect
Box
->
Append
(
_
(
"Auto"
)
);
m_
zoomSelect
Box
->
SetSelection
(
0
);
for
(
int
i
=
0
;
i
<
(
int
)
GetScreen
()
->
m_ZoomList
.
GetCount
();
i
++
)
{
...
...
@@ -666,9 +668,9 @@ void PCB_BASE_FRAME::updateZoomSelectBox()
value
.
Printf
(
wxT
(
"%g"
),
GetScreen
()
->
m_ZoomList
[
i
]);
msg
+=
value
;
m_
SelZoom
Box
->
Append
(
msg
);
m_
zoomSelect
Box
->
Append
(
msg
);
if
(
GetScreen
()
->
GetZoom
()
==
GetScreen
()
->
m_ZoomList
[
i
]
)
m_
SelZoom
Box
->
SetSelection
(
i
+
1
);
m_
zoomSelect
Box
->
SetSelection
(
i
+
1
);
}
}
pcbnew/dialogs/dialog_gendrill.cpp
View file @
95891006
...
...
@@ -340,7 +340,7 @@ void DIALOG_GENDRILL::SetParams( void )
if
(
m_Choice_Drill_Offset
->
GetSelection
()
==
0
)
m_FileDrillOffset
=
wxPoint
(
0
,
0
);
else
m_FileDrillOffset
=
m_Parent
->
m_Auxiliary_Axis_Position
;
m_FileDrillOffset
=
m_Parent
->
GetOriginAxisPosition
()
;
// get precision
int
idx
=
m_Choice_Precision
->
GetSelection
();
...
...
pcbnew/dialogs/dialog_general_options.cpp
View file @
95891006
...
...
@@ -64,7 +64,7 @@ void Dialog_GeneralOptions::init()
/* Set display options */
m_PolarDisplay
->
SetSelection
(
DisplayOpt
.
DisplayPolarCood
?
1
:
0
);
m_UnitsSelection
->
SetSelection
(
g_UserUnit
?
1
:
0
);
m_CursorShape
->
SetSelection
(
GetParent
()
->
m_CursorShape
?
1
:
0
);
m_CursorShape
->
SetSelection
(
GetParent
()
->
GetCursorShape
()
?
1
:
0
);
switch
(
g_RotationAngle
)
...
...
@@ -107,15 +107,14 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
{
EDA_UNITS_T
ii
;
DisplayOpt
.
DisplayPolarCood
=
(
m_PolarDisplay
->
GetSelection
()
==
0
)
?
false
:
true
;
DisplayOpt
.
DisplayPolarCood
=
(
m_PolarDisplay
->
GetSelection
()
==
0
)
?
false
:
true
;
ii
=
g_UserUnit
;
g_UserUnit
=
(
m_UnitsSelection
->
GetSelection
()
==
0
)
?
INCHES
:
MILLIMETRES
;
if
(
ii
!=
g_UserUnit
)
GetParent
()
->
ReCreateAuxiliaryToolbar
();
GetParent
()
->
m_CursorShape
=
m_CursorShape
->
GetSelection
(
);
GetParent
()
->
SetCursorShape
(
m_CursorShape
->
GetSelection
()
);
GetParent
()
->
SetAutoSaveInterval
(
m_SaveTime
->
GetValue
()
*
60
);
g_RotationAngle
=
10
*
wxAtoi
(
m_RotationAngle
->
GetStringSelection
()
);
...
...
@@ -150,7 +149,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
void
PCB_EDIT_FRAME
::
OnSelectOptionToolbar
(
wxCommandEvent
&
event
)
{
int
id
=
event
.
GetId
();
bool
state
=
m_
O
ptionsToolBar
->
GetToolState
(
id
);
bool
state
=
m_
o
ptionsToolBar
->
GetToolState
(
id
);
switch
(
id
)
{
...
...
@@ -218,7 +217,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
case
ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE
:
m_show_microwave_tools
=
state
;
m_auimgr
.
GetPane
(
wxT
(
"m_
AuxV
ToolBar"
)
).
Show
(
m_show_microwave_tools
);
m_auimgr
.
GetPane
(
wxT
(
"m_
microWave
ToolBar"
)
).
Show
(
m_show_microwave_tools
);
m_auimgr
.
Update
();
break
;
...
...
pcbnew/edit.cpp
View file @
95891006
...
...
@@ -169,8 +169,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if
(
GetToolId
()
!=
id
)
{
if
(
m_
ID_last_state
!=
GetToolId
()
)
m_
ID_last_state
=
GetToolId
();
if
(
m_
lastDrawToolId
!=
GetToolId
()
)
m_
lastDrawToolId
=
GetToolId
();
SetToolID
(
ID_NO_TOOL_SELECTED
,
DrawPanel
->
GetDefaultCursor
(),
wxEmptyString
);
}
...
...
pcbnew/export_gencad.cpp
View file @
95891006
...
...
@@ -145,8 +145,8 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
GetBoard
()
->
ComputeBoundingBox
();
// Save the auxiliary origin for the rest of the module
GencadOffsetX
=
m_
Auxiliary_Axis_
Position
.
x
;
GencadOffsetY
=
m_
Auxiliary_Axis_
Position
.
y
;
GencadOffsetX
=
m_
originAxis
Position
.
x
;
GencadOffsetY
=
m_
originAxis
Position
.
y
;
// No idea on *why* this should be needed... maybe to fix net names?
Compile_Ratsnest
(
NULL
,
true
);
...
...
@@ -705,8 +705,8 @@ static bool CreateHeaderInfoData( FILE* aFile, PCB_EDIT_FRAME* aFrame )
fputs
(
TO_UTF8
(
msg
),
aFile
);
fputs
(
"UNITS INCH
\n
"
,
aFile
);
msg
.
Printf
(
wxT
(
"ORIGIN %g %g
\n
"
),
MapXTo
(
aFrame
->
m_Auxiliary_Axis_Position
.
x
),
MapYTo
(
aFrame
->
m_Auxiliary_Axis_Position
.
y
)
);
MapXTo
(
aFrame
->
GetOriginAxisPosition
()
.
x
),
MapYTo
(
aFrame
->
GetOriginAxisPosition
()
.
y
)
);
fputs
(
TO_UTF8
(
msg
),
aFile
);
fputs
(
"INTERTRACK 0
\n
"
,
aFile
);
fputs
(
"$ENDHEADER
\n\n
"
,
aFile
);
...
...
pcbnew/gen_modules_placefile.cpp
View file @
95891006
...
...
@@ -93,7 +93,7 @@ void PCB_EDIT_FRAME::GenModulesPosition( wxCommandEvent& event )
FILE
*
fpBack
=
0
;
bool
switchedLocale
=
false
;
File_Place_Offset
=
m_
Auxiliary_Axis_
Position
;
File_Place_Offset
=
m_
originAxis
Position
;
/* Calculating the number of useful modules (CMS attribute, not VIRTUAL) */
int
moduleCount
=
0
;
...
...
pcbnew/hotkeys_board_editor.cpp
View file @
95891006
...
...
@@ -249,9 +249,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break
;
case
HK_SWITCH_GRID_TO_FASTGRID1
:
if
(
m_
SelGrid
Box
)
if
(
m_
gridSelect
Box
)
{
m_
SelGrid
Box
->
SetSelection
(
m_FastGrid1
);
m_
gridSelect
Box
->
SetSelection
(
m_FastGrid1
);
cmd
.
SetEventType
(
wxEVT_COMMAND_COMBOBOX_SELECTED
);
OnSelectGrid
(
cmd
);
}
...
...
@@ -259,9 +259,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break
;
case
HK_SWITCH_GRID_TO_FASTGRID2
:
if
(
m_
SelGrid
Box
)
if
(
m_
gridSelect
Box
)
{
m_
SelGrid
Box
->
SetSelection
(
m_FastGrid2
);
m_
gridSelect
Box
->
SetSelection
(
m_FastGrid2
);
cmd
.
SetEventType
(
wxEVT_COMMAND_COMBOBOX_SELECTED
);
OnSelectGrid
(
cmd
);
}
...
...
@@ -269,10 +269,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break
;
case
HK_SWITCH_GRID_TO_NEXT
:
if
(
m_
SelGrid
Box
)
if
(
m_
gridSelect
Box
)
{
m_
SelGridBox
->
SetSelection
(
(
m_SelGrid
Box
->
GetSelection
()
+
1
)
%
m_SelGrid
Box
->
GetCount
()
);
m_
gridSelectBox
->
SetSelection
(
(
m_gridSelect
Box
->
GetSelection
()
+
1
)
%
m_gridSelect
Box
->
GetCount
()
);
cmd
.
SetEventType
(
wxEVT_COMMAND_COMBOBOX_SELECTED
);
OnSelectGrid
(
cmd
);
}
...
...
@@ -280,16 +280,16 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break
;
case
HK_SWITCH_GRID_TO_PREVIOUS
:
if
(
m_
SelGrid
Box
)
if
(
m_
gridSelect
Box
)
{
cnt
=
m_
SelGrid
Box
->
GetSelection
();
cnt
=
m_
gridSelect
Box
->
GetSelection
();
if
(
cnt
==
0
)
cnt
=
m_
SelGrid
Box
->
GetCount
()
-
1
;
cnt
=
m_
gridSelect
Box
->
GetCount
()
-
1
;
else
cnt
--
;
m_
SelGrid
Box
->
SetSelection
(
cnt
);
m_
gridSelect
Box
->
SetSelection
(
cnt
);
cmd
.
SetEventType
(
wxEVT_COMMAND_COMBOBOX_SELECTED
);
OnSelectGrid
(
cmd
);
}
...
...
pcbnew/ioascii.cpp
View file @
95891006
...
...
@@ -389,8 +389,8 @@ int PCB_BASE_FRAME::ReadSetup( LINE_READER* aReader )
if
(
data
)
gy
=
atoi
(
data
);
m_
Auxiliary_Axis_
Position
.
x
=
gx
;
m_
Auxiliary_Axis_
Position
.
y
=
gy
;
m_
originAxis
Position
.
x
=
gx
;
m_
originAxis
Position
.
y
=
gy
;
continue
;
}
...
...
@@ -762,8 +762,8 @@ static int WriteSetup( FILE* aFile, PCB_EDIT_FRAME* aFrame, BOARD* aBoard )
fprintf
(
aFile
,
"AuxiliaryAxisOrg %d %d
\n
"
,
aFrame
->
m_Auxiliary_Axis_Position
.
x
,
aFrame
->
m_Auxiliary_Axis_Position
.
y
);
aFrame
->
GetOriginAxisPosition
()
.
x
,
aFrame
->
GetOriginAxisPosition
()
.
y
);
STRING_FORMATTER
sf
;
...
...
pcbnew/kicad_plugin.cpp
View file @
95891006
...
...
@@ -567,8 +567,8 @@ void KICAD_PLUGIN::loadSETUP()
BIU
gy
=
biuParse
(
data
);
/* @todo
m_
Auxiliary_Axis_
Position.x = gx;
m_
Auxiliary_Axis_
Position.y = gy;
m_
originAxis
Position.x = gx;
m_
originAxis
Position.y = gy;
*/
}
...
...
pcbnew/modeditoptions.cpp
View file @
95891006
...
...
@@ -23,24 +23,24 @@ void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch
(
id
)
{
case
ID_TB_OPTIONS_SHOW_PADS_SKETCH
:
m_DisplayPadFill
=
!
m_
O
ptionsToolBar
->
GetToolState
(
id
);
m_DisplayPadFill
=
!
m_
o
ptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Refresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_VIAS_SKETCH
:
m_DisplayViaFill
=
!
m_
O
ptionsToolBar
->
GetToolState
(
id
);
m_DisplayViaFill
=
!
m_
o
ptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Refresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
:
m_DisplayModText
=
m_
O
ptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
m_
o
ptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
DrawPanel
->
Refresh
(
);
break
;
case
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
:
m_DisplayModEdge
=
m_
O
ptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
m_
o
ptionsToolBar
->
GetToolState
(
id
)
?
SKETCH
:
FILLED
;
DrawPanel
->
Refresh
(
);
break
;
...
...
pcbnew/moduleframe.cpp
View file @
95891006
...
...
@@ -142,9 +142,9 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
PCB_BASE_FRAME
(
father
,
MODULE_EDITOR_FRAME
,
wxEmptyString
,
pos
,
size
,
style
)
{
m_FrameName
=
wxT
(
"ModEditFrame"
);
m_
Draw_Sheet_Ref
=
false
;
// true to show the frame references
m_
Draw_Axis
=
true
;
// true to show X and Y axis on screen
m_
Draw_Grid_Axis
=
true
;
// show the grid origin axis
m_
showBorderAndTitleBlock
=
false
;
// true to show the frame references
m_
showAxis
=
true
;
// true to show X and Y axis on screen
m_
showGridAxis
=
true
;
// show the grid origin axis
m_HotkeysZoomAndGridList
=
g_Module_Editor_Hokeys_Descr
;
// Give an icon
...
...
@@ -194,14 +194,14 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
m_auimgr
.
AddPane
(
m_HToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
m_auimgr
.
AddPane
(
m_
A
uxiliaryToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
A
uxiliaryToolBar"
)
).
Top
().
Row
(
1
)
);
m_auimgr
.
AddPane
(
m_
a
uxiliaryToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
a
uxiliaryToolBar"
)
).
Top
().
Row
(
1
)
);
m_auimgr
.
AddPane
(
m_
V
ToolBar
,
m_auimgr
.
AddPane
(
m_
draw
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_VToolBar"
)
).
Right
()
);
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
()
);
m_auimgr
.
AddPane
(
DrawPanel
,
wxAuiPaneInfo
().
Name
(
wxT
(
"DrawFrame"
)
).
CentrePane
()
);
...
...
@@ -253,7 +253,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
{
aEvent
.
Enable
(
GetBoard
()
->
m_Modules
!=
NULL
);
if
(
aEvent
.
GetEventObject
()
==
m_
V
ToolBar
)
if
(
aEvent
.
GetEventObject
()
==
m_
draw
ToolBar
)
aEvent
.
Check
(
GetToolId
()
==
aEvent
.
GetId
()
);
}
...
...
pcbnew/onleftclick.cpp
View file @
95891006
...
...
@@ -423,7 +423,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case
ID_PCB_PLACE_OFFSET_COORD_BUTT
:
DrawPanel
->
DrawAuxiliaryAxis
(
aDC
,
GR_XOR
);
m_
Auxiliary_Axis_
Position
=
GetScreen
()
->
GetCrossHairPosition
();
m_
originAxis
Position
=
GetScreen
()
->
GetCrossHairPosition
();
DrawPanel
->
DrawAuxiliaryAxis
(
aDC
,
GR_COPY
);
OnModify
();
break
;
...
...
pcbnew/pcbframe.cpp
View file @
95891006
...
...
@@ -267,18 +267,19 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
PCB_BASE_FRAME
(
parent
,
PCB_FRAME
,
title
,
pos
,
size
,
style
)
{
m_FrameName
=
wxT
(
"PcbFrame"
);
m_
Draw_Sheet_Ref
=
true
;
// true to display sheet references
m_
Draw_
Axis
=
false
;
// true to display X and Y axis
m_
Draw_Auxiliary_
Axis
=
true
;
m_
Draw_Grid_
Axis
=
true
;
m_SelTrackWidthBox
=
NULL
;
m_
showBorderAndTitleBlock
=
true
;
// true to display sheet references
m_
show
Axis
=
false
;
// true to display X and Y axis
m_
showOrigin
Axis
=
true
;
m_
showGrid
Axis
=
true
;
m_SelTrackWidthBox
=
NULL
;
m_SelViaSizeBox
=
NULL
;
m_SelLayerBox
=
NULL
;
m_SelLayerBox
=
NULL
;
m_show_microwave_tools
=
false
;
m_show_layer_manager_tools
=
true
;
m_HotkeysZoomAndGridList
=
g_Board_Editor_Hokeys_Descr
;
m_hasAutoSave
=
true
;
m_RecordingMacros
=
-
1
;
m_microWaveToolBar
=
NULL
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
m_Macros
[
i
].
m_Record
.
clear
();
...
...
@@ -361,30 +362,30 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_HToolBar"
)
).
Top
().
Row
(
0
)
);
}
if
(
m_
A
uxiliaryToolBar
)
// the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
if
(
m_
a
uxiliaryToolBar
)
// the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
{
m_auimgr
.
AddPane
(
m_
A
uxiliaryToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
A
uxiliaryToolBar"
)
).
Top
().
Row
(
1
)
);
m_auimgr
.
AddPane
(
m_
a
uxiliaryToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
a
uxiliaryToolBar"
)
).
Top
().
Row
(
1
)
);
}
if
(
m_
AuxV
ToolBar
)
// The auxiliary vertical right toolbar (currently microwave tools)
m_auimgr
.
AddPane
(
m_
AuxV
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
AuxV
ToolBar"
)
).
Right
().
Layer
(
1
).
Position
(
1
).
Hide
()
);
if
(
m_
microWave
ToolBar
)
// The auxiliary vertical right toolbar (currently microwave tools)
m_auimgr
.
AddPane
(
m_
microWave
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
microWave
ToolBar"
)
).
Right
().
Layer
(
1
).
Position
(
1
).
Hide
()
);
if
(
m_
V
ToolBar
)
// The main right vertical toolbar
m_auimgr
.
AddPane
(
m_
V
ToolBar
,
if
(
m_
draw
ToolBar
)
// The main right vertical toolbar
m_auimgr
.
AddPane
(
m_
draw
ToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_VToolBar"
)
).
Right
().
Layer
(
2
)
);
// Add the layer manager ( most right side of pcbframe )
m_auimgr
.
AddPane
(
m_Layers
,
lyrs
.
Name
(
wxT
(
"m_LayersManagerToolBar"
)
).
Right
().
Layer
(
3
)
);
if
(
m_
O
ptionsToolBar
)
// The left vertical toolbar (fast acces display options of Pcbnew)
if
(
m_
o
ptionsToolBar
)
// The left vertical toolbar (fast acces display options of Pcbnew)
{
m_auimgr
.
AddPane
(
m_
O
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
O
ptionsToolBar"
)
).
Left
().
Layer
(
1
)
);
m_auimgr
.
AddPane
(
m_
o
ptionsToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_
o
ptionsToolBar"
)
).
Left
().
Layer
(
1
)
);
m_auimgr
.
GetPane
(
wxT
(
"m_LayersManagerToolBar"
)
).
Show
(
m_show_layer_manager_tools
);
m_auimgr
.
GetPane
(
wxT
(
"m_
AuxV
ToolBar"
)
).
Show
(
m_show_microwave_tools
);
m_auimgr
.
GetPane
(
wxT
(
"m_
microWave
ToolBar"
)
).
Show
(
m_show_microwave_tools
);
}
if
(
DrawPanel
)
...
...
pcbnew/plotgerb.cpp
View file @
95891006
...
...
@@ -40,7 +40,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
if
(
aPlotOriginIsAuxAxis
)
{
offset
=
m_
Auxiliary_Axis_
Position
;
offset
=
m_
originAxis
Position
;
}
else
{
...
...
pcbnew/set_grid.cpp
View file @
95891006
...
...
@@ -45,8 +45,8 @@ void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos )
dlg
.
SetGridSize
(
m_UserGridSize
);
dlg
.
SetGridOrigin
(
GetScreen
()
->
m_GridOrigin
);
if
(
m_
SelGrid
Box
)
dlg
.
SetGridForFastSwitching
(
m_
SelGrid
Box
->
GetStrings
(),
m_FastGrid1
,
m_FastGrid2
);
if
(
m_
gridSelect
Box
)
dlg
.
SetGridForFastSwitching
(
m_
gridSelect
Box
->
GetStrings
(),
m_FastGrid1
,
m_FastGrid2
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
...
...
pcbnew/tool_modedit.cpp
View file @
95891006
...
...
@@ -116,90 +116,90 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
void
FOOTPRINT_EDIT_FRAME
::
ReCreateVToolbar
()
{
if
(
m_
V
ToolBar
)
if
(
m_
draw
ToolBar
)
return
;
m_
V
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
false
);
m_
draw
ToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_TOOL
,
this
,
ID_V_TOOLBAR
,
false
);
// Set up toolbar
m_
V
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
),
wxEmptyString
,
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_NO_TOOL_SELECTED
,
wxEmptyString
,
KiBitmap
(
cursor_xpm
),
wxEmptyString
,
wxITEM_CHECK
);
m_
V
ToolBar
->
AddSeparator
();
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_PAD_TOOL
,
wxEmptyString
,
KiBitmap
(
pad_xpm
),
_
(
"Add pads"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddSeparator
();
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_PAD_TOOL
,
wxEmptyString
,
KiBitmap
(
pad_xpm
),
_
(
"Add pads"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddSeparator
();
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_LINE_TOOL
,
wxEmptyString
,
KiBitmap
(
add_polygon_xpm
),
_
(
"Add graphic line or polygon"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddSeparator
();
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_LINE_TOOL
,
wxEmptyString
,
KiBitmap
(
add_polygon_xpm
),
_
(
"Add graphic line or polygon"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_CIRCLE_TOOL
,
wxEmptyString
,
KiBitmap
(
add_circle_xpm
),
_
(
"Add graphic circle"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_CIRCLE_TOOL
,
wxEmptyString
,
KiBitmap
(
add_circle_xpm
),
_
(
"Add graphic circle"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_ARC_TOOL
,
wxEmptyString
,
KiBitmap
(
add_arc_xpm
),
_
(
"Add graphic arc"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_ARC_TOOL
,
wxEmptyString
,
KiBitmap
(
add_arc_xpm
),
_
(
"Add graphic arc"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_TEXT_TOOL
,
wxEmptyString
,
KiBitmap
(
add_text_xpm
),
_
(
"Add Text"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_TEXT_TOOL
,
wxEmptyString
,
KiBitmap
(
add_text_xpm
),
_
(
"Add Text"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddSeparator
();
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_ANCHOR_TOOL
,
wxEmptyString
,
KiBitmap
(
anchor_xpm
),
_
(
"Place the footprint module reference anchor"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddSeparator
();
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_ANCHOR_TOOL
,
wxEmptyString
,
KiBitmap
(
anchor_xpm
),
_
(
"Place the footprint module reference anchor"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddSeparator
();
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_DELETE_TOOL
,
wxEmptyString
,
KiBitmap
(
delete_body_xpm
),
_
(
"Delete items"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddSeparator
();
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_DELETE_TOOL
,
wxEmptyString
,
KiBitmap
(
delete_body_xpm
),
_
(
"Delete items"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
AddTool
(
ID_MODEDIT_PLACE_GRID_COORD
,
wxEmptyString
,
KiBitmap
(
grid_select_axis_xpm
),
_
(
"Set the origin point for the grid"
),
wxITEM_CHECK
);
m_
draw
ToolBar
->
AddTool
(
ID_MODEDIT_PLACE_GRID_COORD
,
wxEmptyString
,
KiBitmap
(
grid_select_axis_xpm
),
_
(
"Set the origin point for the grid"
),
wxITEM_CHECK
);
m_
V
ToolBar
->
Realize
();
m_
draw
ToolBar
->
Realize
();
}
void
FOOTPRINT_EDIT_FRAME
::
ReCreateOptToolbar
()
{
if
(
m_
O
ptionsToolBar
)
if
(
m_
o
ptionsToolBar
)
return
;
// Create options tool bar.
m_
O
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
m_
o
ptionsToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_OPTION
,
this
,
ID_OPT_TOOLBAR
,
false
);
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_GRID
,
wxEmptyString
,
KiBitmap
(
grid_xpm
),
_
(
"Hide grid"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
wxEmptyString
,
KiBitmap
(
polar_coord_xpm
),
_
(
"Display Polar Coord ON"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_INCH
,
wxEmptyString
,
KiBitmap
(
unit_inch_xpm
),
_
(
"Units in inches"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_UNIT_MM
,
wxEmptyString
,
KiBitmap
(
unit_mm_xpm
),
_
(
"Units in millimeters"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
wxEmptyString
,
KiBitmap
(
cursor_shape_xpm
),
_
(
"Change Cursor Shape"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddSeparator
();
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddSeparator
();
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
wxEmptyString
,
KiBitmap
(
pad_sketch_xpm
),
_
(
"Show Pads Sketch"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
,
wxEmptyString
,
KiBitmap
(
text_sketch_xpm
),
_
(
"Show Texts Sketch"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
wxEmptyString
,
m_
o
ptionsToolBar
->
AddTool
(
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
,
wxEmptyString
,
KiBitmap
(
show_mod_edge_xpm
),
_
(
"Show Edges Sketch"
),
wxITEM_CHECK
);
m_
O
ptionsToolBar
->
Realize
();
m_
o
ptionsToolBar
->
Realize
();
}
...
...
@@ -207,37 +207,37 @@ void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
{
wxString
msg
;
if
(
m_
A
uxiliaryToolBar
)
if
(
m_
a
uxiliaryToolBar
)
return
;
m_
A
uxiliaryToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_AUX
,
this
,
ID_AUX_TOOLBAR
,
true
);
m_
a
uxiliaryToolBar
=
new
EDA_TOOLBAR
(
TOOLBAR_AUX
,
this
,
ID_AUX_TOOLBAR
,
true
);
// Set up toolbar
m_
A
uxiliaryToolBar
->
AddSeparator
();
m_
a
uxiliaryToolBar
->
AddSeparator
();
// Grid selection choice box.
m_
SelGridBox
=
new
wxComboBox
(
m_A
uxiliaryToolBar
,
ID_ON_GRID_SELECT
,
wxEmptyString
,
wxPoint
(
-
1
,
-
1
),
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_
AuxiliaryToolBar
->
AddControl
(
m_SelGrid
Box
);
m_
gridSelectBox
=
new
wxComboBox
(
m_a
uxiliaryToolBar
,
ID_ON_GRID_SELECT
,
wxEmptyString
,
wxPoint
(
-
1
,
-
1
),
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_
auxiliaryToolBar
->
AddControl
(
m_gridSelect
Box
);
// Zoom selection choice box.
m_
A
uxiliaryToolBar
->
AddSeparator
();
m_
SelZoomBox
=
new
wxComboBox
(
m_A
uxiliaryToolBar
,
ID_ON_ZOOM_SELECT
,
wxEmptyString
,
wxPoint
(
-
1
,
-
1
),
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_
AuxiliaryToolBar
->
AddControl
(
m_SelZoom
Box
);
m_
a
uxiliaryToolBar
->
AddSeparator
();
m_
zoomSelectBox
=
new
wxComboBox
(
m_a
uxiliaryToolBar
,
ID_ON_ZOOM_SELECT
,
wxEmptyString
,
wxPoint
(
-
1
,
-
1
),
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_
auxiliaryToolBar
->
AddControl
(
m_zoomSelect
Box
);
// Update tool bar to reflect setting.
updateGridSelectBox
();
updateZoomSelectBox
();
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_
A
uxiliaryToolBar
->
Realize
();
m_
a
uxiliaryToolBar
->
Realize
();
}
pcbnew/tool_pcb.cpp
View file @
95891006
This diff is collapsed.
Click to expand it.
pcbnew/toolbars_update_user_interface.cpp
View file @
95891006
...
...
@@ -87,7 +87,7 @@ void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateDrcEnable
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
!
Drc_On
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_DRC_OFF
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_DRC_OFF
,
Drc_On
?
_
(
"Disable design rule checking"
)
:
_
(
"Enable design rule checking"
)
);
...
...
@@ -96,7 +96,7 @@ void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateShowBoardRatsnest
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
GetBoard
()
->
IsElementVisible
(
RATSNEST_VISIBLE
)
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
GetBoard
()
->
IsElementVisible
(
RATSNEST_VISIBLE
)
?
_
(
"Hide board ratsnest"
)
:
_
(
"Show board ratsnest"
)
);
...
...
@@ -106,7 +106,7 @@ void PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateShowModuleRatsnest
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
g_Show_Module_Ratsnest
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
g_Show_Module_Ratsnest
?
_
(
"Hide module ratsnest"
)
:
_
(
"Show module ratsnest"
)
);
...
...
@@ -116,7 +116,7 @@ void PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateAutoDeleteTrack
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
g_AutoDeleteOldTrack
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
g_AutoDeleteOldTrack
?
_
(
"Disable auto delete old track"
)
:
_
(
"Enable auto delete old track"
)
);
...
...
@@ -126,7 +126,7 @@ void PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateViaDrawMode
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
!
m_DisplayViaFill
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_VIAS_SKETCH
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_VIAS_SKETCH
,
m_DisplayViaFill
?
_
(
"Show vias in outline mode"
)
:
_
(
"Show vias in fill mode"
)
);
...
...
@@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateTraceDrawMode
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
!
m_DisplayPcbTrackFill
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
m_DisplayPcbTrackFill
?
_
(
"Show tracks in outline mode"
)
:
_
(
"Show tracks in fill mode"
)
);
...
...
@@ -146,7 +146,7 @@ void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateHighContrastDisplayMode
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
DisplayOpt
.
ContrastModeDisplay
);
m_
O
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE
,
m_
o
ptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE
,
DisplayOpt
.
ContrastModeDisplay
?
_
(
"Normal contrast display mode"
)
:
_
(
"High contrast display mode"
)
);
...
...
@@ -160,7 +160,7 @@ void PCB_EDIT_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateShowMicrowaveToolbar
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
m_auimgr
.
GetPane
(
wxT
(
"m_
AuxV
ToolBar"
)
).
IsShown
()
);
aEvent
.
Check
(
m_auimgr
.
GetPane
(
wxT
(
"m_
microWave
ToolBar"
)
).
IsShown
()
);
}
...
...
@@ -172,6 +172,6 @@ void PCB_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateVerticalToolbar
(
wxUpdateUIEvent
&
aEvent
)
{
if
(
aEvent
.
GetEventObject
()
==
m_
V
ToolBar
)
if
(
aEvent
.
GetEventObject
()
==
m_
draw
ToolBar
)
aEvent
.
Check
(
GetToolId
()
==
aEvent
.
GetId
()
);
}
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