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
1c0f034b
Commit
1c0f034b
authored
Jan 08, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make KiCad compile with minimal warnings against SVN HEAD of wxWidgets as of today.
parent
fe919cd4
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
243 additions
and
160 deletions
+243
-160
x3dmodelparser.cpp
3d-viewer/x3dmodelparser.cpp
+31
-25
basicframe.cpp
common/basicframe.cpp
+6
-1
class_layer_box_selector.cpp
common/class_layer_box_selector.cpp
+5
-0
gr_basic.cpp
common/gr_basic.cpp
+12
-5
msgpanel.cpp
common/msgpanel.cpp
+5
-0
selcolor.cpp
common/selcolor.cpp
+13
-4
xnode.cpp
common/xnode.cpp
+1
-1
dialog_color_config.cpp
eeschema/dialogs/dialog_color_config.cpp
+117
-79
dialog_color_config.h
eeschema/dialogs/dialog_color_config.h
+13
-36
draw_gerber_screen.cpp
gerbview/draw_gerber_screen.cpp
+5
-0
xnode.h
include/xnode.h
+4
-4
dialog_copper_zones.cpp
pcbnew/dialogs/dialog_copper_zones.cpp
+6
-0
dialog_keepout_area_properties.cpp
pcbnew/dialogs/dialog_keepout_area_properties.cpp
+6
-0
footprint_wizard_frame.cpp
pcbnew/footprint_wizard_frame.cpp
+8
-0
layer_widget.cpp
pcbnew/layer_widget.cpp
+6
-0
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+5
-5
No files found.
3d-viewer/x3dmodelparser.cpp
View file @
1c0f034b
...
...
@@ -36,8 +36,10 @@
#include <queue>
#include <vector>
#include "3d_struct.h"
#include "modelparsers.h"
#include <3d_struct.h>
#include <modelparsers.h>
#include <xnode.h>
X3D_MODEL_PARSER
::
X3D_MODEL_PARSER
(
S3D_MASTER
*
aMaster
)
:
S3D_MODEL_PARSER
(
aMaster
)
...
...
@@ -54,13 +56,13 @@ void X3D_MODEL_PARSER::Load( const wxString aFilename )
if
(
!
doc
.
Load
(
aFilename
)
)
{
wxLogError
(
wxT
(
"Error while parsing file
<%s>
"
),
GetChars
(
aFilename
)
);
wxLogError
(
wxT
(
"Error while parsing file
'%s'
"
),
GetChars
(
aFilename
)
);
return
;
}
if
(
doc
.
GetRoot
()
->
GetName
()
!=
wxT
(
"X3D"
)
)
{
wxLogError
(
wxT
(
"Filetype is not X3D
<%s>
"
),
GetChars
(
aFilename
)
);
wxLogError
(
wxT
(
"Filetype is not X3D
'%s'
"
),
GetChars
(
aFilename
)
);
return
;
}
...
...
@@ -85,24 +87,25 @@ wxString X3D_MODEL_PARSER::VRML_representation()
for
(
unsigned
i
=
0
;
i
<
vrml_points
.
size
();
i
++
)
{
output
+=
wxT
(
"Shape {
\n
"
" appearance Appearance {
\n
"
" material Material {
\n
"
)
+
vrml_materials
[
i
]
+
wxT
(
" }
\n
"
" }
\n
"
" geometry IndexedFaceSet {
\n
"
" solid TRUE
\n
"
" coord Coordinate {
\n
"
" point [
\n
"
)
+
vrml_points
[
i
]
+
wxT
(
" ]
\n
"
" }
\n
"
" coordIndex [
\n
"
)
+
vrml_coord_indexes
[
i
]
+
wxT
(
" ]
\n
"
" }
\n
"
"},
\n
"
);
output
+=
wxT
(
"Shape {
\n
"
" appearance Appearance {
\n
"
" material Material {
\n
"
)
+
vrml_materials
[
i
]
+
wxT
(
" }
\n
"
" }
\n
"
" geometry IndexedFaceSet {
\n
"
" solid TRUE
\n
"
" coord Coordinate {
\n
"
" point [
\n
"
)
+
vrml_points
[
i
]
+
wxT
(
" ]
\n
"
" }
\n
"
" coordIndex [
\n
"
)
+
vrml_coord_indexes
[
i
]
+
wxT
(
" ]
\n
"
" }
\n
"
"},
\n
"
);
}
return
output
;
...
...
@@ -115,6 +118,7 @@ void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
{
// Breadth-first search (BFS)
std
::
queue
<
wxXmlNode
*
>
found
;
found
.
push
(
aParent
);
while
(
!
found
.
empty
()
)
...
...
@@ -140,7 +144,7 @@ void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
void
X3D_MODEL_PARSER
::
GetNodeProperties
(
wxXmlNode
*
aNode
,
PROPERTY_MAP
&
aProps
)
{
wxXml
Property
*
prop
;
wxXml
Attribute
*
prop
;
for
(
prop
=
aNode
->
GetAttributes
();
prop
!=
NULL
;
...
...
@@ -167,6 +171,7 @@ void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
childnodes
.
clear
();
PROPERTY_MAP
properties
;
GetNodeProperties
(
aTransformNode
,
properties
);
GetChildsByName
(
aTransformNode
,
wxT
(
"IndexedFaceSet"
),
childnodes
);
...
...
@@ -252,7 +257,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
wxString
vrml_material
;
PROPERTY_MAP
::
const_iterator
p
=
++
properties
.
begin
();
// skip DEF
for
(
;
p
!=
properties
.
end
();
p
++
)
for
(
;
p
!=
properties
.
end
();
p
++
)
{
vrml_material
.
Append
(
p
->
first
+
wxT
(
" "
)
+
p
->
second
+
wxT
(
"
\n
"
)
);
}
...
...
@@ -270,8 +275,8 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
{
if
(
material
->
m_Name
==
mat_name
)
{
wxString
vrml_material
;
vrml_material
.
Append
(
wxString
::
Format
(
wxT
(
"specularColor %f %f %f
\n
"
),
material
->
m_SpecularColor
.
x
,
material
->
m_SpecularColor
.
y
,
...
...
@@ -457,6 +462,7 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
while
(
index_tokens
.
HasMoreTokens
()
)
{
long
index
=
0
;
index_tokens
.
GetNextToken
().
ToLong
(
&
index
);
// -1 marks the end of polygon
...
...
common/basicframe.cpp
View file @
1c0f034b
...
...
@@ -480,7 +480,12 @@ static inline const char* KICAD_BUILD_OPTIONS_SIGNATURE()
" (release,"
#endif
__WX_BO_UNICODE
__ABI_VERSION
__BO_COMPILER
__WX_BO_STL
__WX_BO_WXWIN_COMPAT_2_6
__WX_BO_WXWIN_COMPAT_2_8
")"
#if !wxCHECK_VERSION( 3, 0, 0 )
__WX_BO_WXWIN_COMPAT_2_6
#endif
__WX_BO_WXWIN_COMPAT_2_8
")"
;
}
...
...
common/class_layer_box_selector.cpp
View file @
1c0f034b
...
...
@@ -41,7 +41,12 @@ void LAYER_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, LAYER_NUM aLayer )
// Prepare Bitmap
bmpDC
.
SelectObject
(
aLayerbmp
);
brush
.
SetColour
(
MakeColour
(
GetLayerColor
(
aLayer
)
)
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
bmpDC
.
SetBrush
(
brush
);
bmpDC
.
DrawRectangle
(
0
,
0
,
aLayerbmp
.
GetWidth
(),
aLayerbmp
.
GetHeight
()
);
...
...
common/gr_basic.cpp
View file @
1c0f034b
...
...
@@ -396,15 +396,22 @@ void GRSetBrush( wxDC* DC, EDA_COLOR_T Color, bool fill )
||
s_DC_lastbrushfill
!=
fill
||
s_DC_lastDC
!=
DC
)
{
wxBrush
DrawBrush
;
DrawBrush
.
SetColour
(
MakeColour
(
Color
)
);
wxBrush
brush
;
brush
.
SetColour
(
MakeColour
(
Color
)
);
if
(
fill
)
DrawBrush
.
SetStyle
(
wxSOLID
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
else
brush
.
SetStyle
(
wxBRUSHSTYLE_TRANSPARENT
);
#else
brush
.
SetStyle
(
wxSOLID
);
else
DrawBrush
.
SetStyle
(
wxTRANSPARENT
);
brush
.
SetStyle
(
wxTRANSPARENT
);
#endif
DC
->
SetBrush
(
DrawB
rush
);
DC
->
SetBrush
(
b
rush
);
s_DC_lastbrushcolor
=
Color
;
s_DC_lastbrushfill
=
fill
;
...
...
common/msgpanel.cpp
View file @
1c0f034b
...
...
@@ -239,7 +239,12 @@ void EDA_MSG_PANEL::erase( wxDC* aDC )
pen
.
SetColour
(
color
);
brush
.
SetColour
(
color
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
aDC
->
SetPen
(
pen
);
aDC
->
SetBrush
(
brush
);
...
...
common/selcolor.cpp
View file @
1c0f034b
...
...
@@ -160,14 +160,23 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
butt_ID
=
ID_COLOR_BLACK
+
ii
;
wxMemoryDC
iconDC
;
wxBitmap
ButtBitmap
(
w
,
h
);
wxBrush
Brush
;
wxBrush
brush
;
iconDC
.
SelectObject
(
ButtBitmap
);
EDA_COLOR_T
buttcolor
=
g_ColorRefs
[
ii
].
m_Numcolor
;
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
ColorSetBrush
(
&
Brush
,
buttcolor
);
Brush
.
SetStyle
(
wxSOLID
);
ColorSetBrush
(
&
brush
,
buttcolor
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
SetBrush
(
Brush
);
iconDC
.
SetBackground
(
*
wxGREY_BRUSH
);
iconDC
.
Clear
();
iconDC
.
DrawRoundedRectangle
(
0
,
0
,
w
,
h
,
(
double
)
h
/
3
);
...
...
common/xnode.cpp
View file @
1c0f034b
...
...
@@ -26,7 +26,7 @@
#include <xnode.h>
#include <macros.h>
typedef
wxXml
Property
XATTR
;
typedef
wxXml
Attribute
XATTR
;
void
XNODE
::
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
throw
(
IO_ERROR
)
...
...
eeschema/dialogs/dialog_color_config.cpp
View file @
1c0f034b
...
...
@@ -16,53 +16,73 @@
#define ID_COLOR_SETUP 1800
// Specify the width and height of every (color-displaying / bitmap) button
const
int
BUTT_SIZE_X
=
16
;
const
int
BUTT_SIZE_Y
=
16
;
static
ColorButton
GeneralColorButtons
[]
=
{
{
_
(
"Wire"
),
LAYER_WIRE
},
{
_
(
"Bus"
),
LAYER_BUS
},
{
_
(
"Junction"
),
LAYER_JUNCTION
},
{
_
(
"Label"
),
LAYER_LOCLABEL
},
{
_
(
"Global label"
),
LAYER_GLOBLABEL
},
{
_
(
"Net name"
),
LAYER_NETNAM
},
{
_
(
"Notes"
),
LAYER_NOTES
},
/********************/
/* Layer menu list. */
/********************/
struct
COLORBUTTON
{
wxString
m_Name
;
int
m_Layer
;
};
struct
BUTTONINDEX
{
wxString
m_Name
;
COLORBUTTON
*
m_Buttons
;
};
static
COLORBUTTON
generalColorButtons
[]
=
{
{
_
(
"Wire"
),
LAYER_WIRE
},
{
_
(
"Bus"
),
LAYER_BUS
},
{
_
(
"Junction"
),
LAYER_JUNCTION
},
{
_
(
"Label"
),
LAYER_LOCLABEL
},
{
_
(
"Global label"
),
LAYER_GLOBLABEL
},
{
_
(
"Net name"
),
LAYER_NETNAM
},
{
_
(
"Notes"
),
LAYER_NOTES
},
{
_
(
"No Connect Symbol"
),
LAYER_NOCONNECT
},
{
wxT
(
""
),
-
1
}
// Sentinel marking end of list.
};
static
C
olorButton
C
omponentColorButtons
[]
=
{
{
_
(
"Body"
),
LAYER_DEVICE
},
{
_
(
"Body background"
),
LAYER_DEVICE_BACKGROUND
},
{
_
(
"Pin"
),
LAYER_PIN
},
{
_
(
"Pin number"
),
LAYER_PINNUM
},
{
_
(
"Pin name"
),
LAYER_PINNAM
},
{
_
(
"Reference"
),
LAYER_REFERENCEPART
},
{
_
(
"Value"
),
LAYER_VALUEPART
},
{
_
(
"Fields"
),
LAYER_FIELDS
},
static
C
OLORBUTTON
c
omponentColorButtons
[]
=
{
{
_
(
"Body"
),
LAYER_DEVICE
},
{
_
(
"Body background"
),
LAYER_DEVICE_BACKGROUND
},
{
_
(
"Pin"
),
LAYER_PIN
},
{
_
(
"Pin number"
),
LAYER_PINNUM
},
{
_
(
"Pin name"
),
LAYER_PINNAM
},
{
_
(
"Reference"
),
LAYER_REFERENCEPART
},
{
_
(
"Value"
),
LAYER_VALUEPART
},
{
_
(
"Fields"
),
LAYER_FIELDS
},
{
wxT
(
""
),
-
1
}
// Sentinel marking end of list.
};
static
C
olorButton
S
heetColorButtons
[]
=
{
{
_
(
"Sheet"
),
LAYER_SHEET
},
{
_
(
"Sheet file name"
),
LAYER_SHEETFILENAME
},
{
_
(
"Sheet name"
),
LAYER_SHEETNAME
},
{
_
(
"Sheet label"
),
LAYER_SHEETLABEL
},
{
_
(
"Hierarchical label"
),
LAYER_HIERLABEL
},
static
C
OLORBUTTON
s
heetColorButtons
[]
=
{
{
_
(
"Sheet"
),
LAYER_SHEET
},
{
_
(
"Sheet file name"
),
LAYER_SHEETFILENAME
},
{
_
(
"Sheet name"
),
LAYER_SHEETNAME
},
{
_
(
"Sheet label"
),
LAYER_SHEETLABEL
},
{
_
(
"Hierarchical label"
),
LAYER_HIERLABEL
},
{
wxT
(
""
),
-
1
}
// Sentinel marking end of list.
};
static
C
olorButton
M
iscColorButtons
[]
=
{
{
_
(
"Erc warning"
),
LAYER_ERC_WARN
},
{
_
(
"Erc error"
),
LAYER_ERC_ERR
},
{
_
(
"Grid"
),
LAYER_GRID
},
static
C
OLORBUTTON
m
iscColorButtons
[]
=
{
{
_
(
"Erc warning"
),
LAYER_ERC_WARN
},
{
_
(
"Erc error"
),
LAYER_ERC_ERR
},
{
_
(
"Grid"
),
LAYER_GRID
},
{
wxT
(
""
),
-
1
}
// Sentinel marking end of list.
};
static
B
uttonIndex
buttonGroups
[]
=
{
{
_
(
"General"
),
G
eneralColorButtons
},
{
_
(
"Component"
),
C
omponentColorButtons
},
{
_
(
"Sheet"
),
S
heetColorButtons
},
{
_
(
"Miscellaneous"
),
M
iscColorButtons
},
static
B
UTTONINDEX
buttonGroups
[]
=
{
{
_
(
"General"
),
g
eneralColorButtons
},
{
_
(
"Component"
),
c
omponentColorButtons
},
{
_
(
"Sheet"
),
s
heetColorButtons
},
{
_
(
"Miscellaneous"
),
m
iscColorButtons
},
{
wxT
(
""
),
NULL
}
};
...
...
@@ -81,7 +101,7 @@ DIALOG_COLOR_CONFIG::DIALOG_COLOR_CONFIG()
DIALOG_COLOR_CONFIG
::
DIALOG_COLOR_CONFIG
(
EDA_DRAW_FRAME
*
aParent
)
{
m_
P
arent
=
aParent
;
m_
p
arent
=
aParent
;
Init
();
Create
(
aParent
);
}
...
...
@@ -115,38 +135,39 @@ bool DIALOG_COLOR_CONFIG::Create( wxWindow* aParent,
void
DIALOG_COLOR_CONFIG
::
Init
()
{
O
uterBoxSizer
=
NULL
;
M
ainBoxSizer
=
NULL
;
C
olumnBoxSizer
=
NULL
;
R
owBoxSizer
=
NULL
;
B
itmapButton
=
NULL
;
m_o
uterBoxSizer
=
NULL
;
m_m
ainBoxSizer
=
NULL
;
m_c
olumnBoxSizer
=
NULL
;
m_r
owBoxSizer
=
NULL
;
m_b
itmapButton
=
NULL
;
m_SelBgColor
=
NULL
;
Line
=
NULL
;
StdDialogButtonSizer
=
NULL
;
Button
=
NULL
;
m_line
=
NULL
;
m_stdDialogButtonSizer
=
NULL
;
}
void
DIALOG_COLOR_CONFIG
::
CreateControls
()
{
wx
StaticText
*
label
;
int
buttonId
=
1800
;
ButtonIndex
*
groups
=
buttonGroups
;
wx
Button
*
button
;
wxStaticText
*
label
;
int
buttonId
=
1800
;
OuterBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
SetSizer
(
OuterBoxSizer
);
BUTTONINDEX
*
groups
=
buttonGroups
;
MainBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
OuterBoxSizer
->
Add
(
MainBoxSizer
,
1
,
wxGROW
|
wxLEFT
|
wxRIGHT
,
5
);
m_outerBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
SetSizer
(
m_outerBoxSizer
);
m_mainBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_outerBoxSizer
->
Add
(
m_mainBoxSizer
,
1
,
wxGROW
|
wxLEFT
|
wxRIGHT
,
5
);
while
(
groups
->
m_Buttons
!=
NULL
)
{
C
olorButton
*
buttons
=
groups
->
m_Buttons
;
C
OLORBUTTON
*
buttons
=
groups
->
m_Buttons
;
C
olumnBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
MainBoxSizer
->
Add
(
C
olumnBoxSizer
,
1
,
wxALIGN_TOP
|
wxLEFT
|
wxTOP
,
5
);
R
owBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
ColumnBoxSizer
->
Add
(
R
owBoxSizer
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
m_c
olumnBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_mainBoxSizer
->
Add
(
m_c
olumnBoxSizer
,
1
,
wxALIGN_TOP
|
wxLEFT
|
wxTOP
,
5
);
m_r
owBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_columnBoxSizer
->
Add
(
m_r
owBoxSizer
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
// Add a text string to identify the column of color select buttons.
label
=
new
wxStaticText
(
this
,
wxID_ANY
,
groups
->
m_Name
);
...
...
@@ -156,34 +177,43 @@ void DIALOG_COLOR_CONFIG::CreateControls()
font
.
SetWeight
(
wxFONTWEIGHT_BOLD
);
label
->
SetFont
(
font
);
R
owBoxSizer
->
Add
(
label
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
m_r
owBoxSizer
->
Add
(
label
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
while
(
buttons
->
m_Layer
>=
0
)
{
R
owBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
ColumnBoxSizer
->
Add
(
R
owBoxSizer
,
0
,
wxGROW
|
wxALL
,
0
);
m_r
owBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_columnBoxSizer
->
Add
(
m_r
owBoxSizer
,
0
,
wxGROW
|
wxALL
,
0
);
wxMemoryDC
iconDC
;
wxBitmap
bitmap
(
BUTT_SIZE_X
,
BUTT_SIZE_Y
);
iconDC
.
SelectObject
(
bitmap
);
EDA_COLOR_T
color
=
GetLayerColor
(
LayerNumber
(
buttons
->
m_Layer
)
);
currentColors
[
buttons
->
m_Layer
]
=
color
;
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
wxBrush
brush
;
ColorSetBrush
(
&
brush
,
color
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
BUTT_SIZE_X
,
BUTT_SIZE_Y
);
B
itmapButton
=
new
wxBitmapButton
(
this
,
buttonId
,
bitmap
,
wxDefaultPosition
,
m_b
itmapButton
=
new
wxBitmapButton
(
this
,
buttonId
,
bitmap
,
wxDefaultPosition
,
wxSize
(
BUTT_SIZE_X
+
8
,
BUTT_SIZE_Y
+
6
)
);
BitmapButton
->
SetClientData
(
(
void
*
)
buttons
);
RowBoxSizer
->
Add
(
BitmapButton
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxBOTTOM
,
5
);
m_bitmapButton
->
SetClientData
(
(
void
*
)
buttons
);
m_rowBoxSizer
->
Add
(
m_bitmapButton
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxBOTTOM
,
5
);
label
=
new
wxStaticText
(
this
,
wxID_ANY
,
wxGetTranslation
(
buttons
->
m_Name
)
);
R
owBoxSizer
->
Add
(
label
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxBOTTOM
,
5
);
m_r
owBoxSizer
->
Add
(
label
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxBOTTOM
,
5
);
buttonId
+=
1
;
buttons
++
;
}
...
...
@@ -195,7 +225,7 @@ void DIALOG_COLOR_CONFIG::CreateControls()
wxCommandEventHandler
(
DIALOG_COLOR_CONFIG
::
SetColor
)
);
// Add a spacer to improve appearance.
C
olumnBoxSizer
->
AddSpacer
(
5
);
m_c
olumnBoxSizer
->
AddSpacer
(
5
);
wxArrayString
m_SelBgColorStrings
;
m_SelBgColorStrings
.
Add
(
_
(
"White"
)
);
...
...
@@ -204,30 +234,31 @@ void DIALOG_COLOR_CONFIG::CreateControls()
wxDefaultPosition
,
wxDefaultSize
,
m_SelBgColorStrings
,
1
,
wxRA_SPECIFY_COLS
);
m_SelBgColor
->
SetSelection
(
(
g_DrawBgColor
==
BLACK
)
?
1
:
0
);
C
olumnBoxSizer
->
Add
(
m_SelBgColor
,
1
,
wxGROW
|
wxRIGHT
|
wxTOP
|
wxBOTTOM
,
5
);
m_c
olumnBoxSizer
->
Add
(
m_SelBgColor
,
1
,
wxGROW
|
wxRIGHT
|
wxTOP
|
wxBOTTOM
,
5
);
// Provide a line to separate all of the controls added so far from the
// "OK", "Cancel", and "Apply" buttons (which will be added after that
// line).
L
ine
=
new
wxStaticLine
(
this
,
-
1
,
wxDefaultPosition
,
wxDefaultSize
,
wxLI_HORIZONTAL
);
OuterBoxSizer
->
Add
(
L
ine
,
0
,
wxGROW
|
wxALL
,
5
);
m_l
ine
=
new
wxStaticLine
(
this
,
-
1
,
wxDefaultPosition
,
wxDefaultSize
,
wxLI_HORIZONTAL
);
m_outerBoxSizer
->
Add
(
m_l
ine
,
0
,
wxGROW
|
wxALL
,
5
);
// Provide a StdDialogButtonSizer to accommodate the OK, Cancel, and Apply
// buttons; using that type of sizer results in those buttons being
// automatically located in positions appropriate for each (OS) version of
// KiCad.
StdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
OuterBoxSizer
->
Add
(
StdDialogButtonSizer
,
0
,
wxGROW
|
wxALL
,
10
);
m_stdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
m_outerBoxSizer
->
Add
(
m_stdDialogButtonSizer
,
0
,
wxGROW
|
wxALL
,
10
);
button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_stdDialogButtonSizer
->
AddButton
(
button
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK
"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
StdDialogButtonSizer
->
AddButton
(
B
utton
);
button
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel
"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_stdDialogButtonSizer
->
AddButton
(
b
utton
);
Button
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
StdDialogButtonSizer
->
AddButton
(
Button
);
Button
->
SetFocus
();
button
->
SetFocus
();
B
utton
=
new
wxButton
(
this
,
wxID_APPLY
,
_
(
"Apply"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
StdDialogButtonSizer
->
AddButton
(
B
utton
);
b
utton
=
new
wxButton
(
this
,
wxID_APPLY
,
_
(
"Apply"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_stdDialogButtonSizer
->
AddButton
(
b
utton
);
Connect
(
wxID_OK
,
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_COLOR_CONFIG
::
OnOkClick
)
);
...
...
@@ -236,7 +267,7 @@ void DIALOG_COLOR_CONFIG::CreateControls()
Connect
(
wxID_APPLY
,
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_COLOR_CONFIG
::
OnApplyClick
)
);
S
tdDialogButtonSizer
->
Realize
();
m_s
tdDialogButtonSizer
->
Realize
();
// Dialog now needs to be resized, but the associated command is found elsewhere.
}
...
...
@@ -248,7 +279,7 @@ void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event )
wxCHECK_RET
(
button
!=
NULL
,
wxT
(
"Color button event object is NULL."
)
);
C
olorButton
*
colorButton
=
(
ColorButton
*
)
button
->
GetClientData
();
C
OLORBUTTON
*
colorButton
=
(
COLORBUTTON
*
)
button
->
GetClientData
();
wxCHECK_RET
(
colorButton
!=
NULL
,
wxT
(
"Client data not set for color button."
)
);
...
...
@@ -263,10 +294,17 @@ void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event )
wxBitmap
bitmap
=
button
->
GetBitmapLabel
();
iconDC
.
SelectObject
(
bitmap
);
wxBrush
brush
;
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
wxBrush
brush
;
ColorSetBrush
(
&
brush
,
color
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
BUTT_SIZE_X
,
BUTT_SIZE_Y
);
...
...
@@ -295,7 +333,7 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
warning
=
true
;
}
m_
P
arent
->
SetGridColor
(
GetLayerColor
(
LAYER_GRID
)
);
m_
p
arent
->
SetGridColor
(
GetLayerColor
(
LAYER_GRID
)
);
if
(
g_DrawBgColor
==
GetLayerColor
(
LAYER_GRID
)
)
warning
=
true
;
...
...
@@ -313,7 +351,7 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
if
(
warning
)
wxMessageBox
(
_
(
"Warning:
\n
Some items have the same color as the background
\n
and they will not be seen on screen"
)
);
m_
P
arent
->
GetCanvas
()
->
Refresh
();
m_
p
arent
->
GetCanvas
()
->
Refresh
();
EndModal
(
1
);
}
...
...
@@ -328,5 +366,5 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
void
DIALOG_COLOR_CONFIG
::
OnApplyClick
(
wxCommandEvent
&
event
)
{
UpdateColorsSettings
();
m_
P
arent
->
GetCanvas
()
->
Refresh
();
m_
p
arent
->
GetCanvas
()
->
Refresh
();
}
eeschema/dialogs/dialog_color_config.h
View file @
1c0f034b
#ifndef
_
DIALOG_COLOR_CONFIG_H_
#define
_
DIALOG_COLOR_CONFIG_H_
#ifndef DIALOG_COLOR_CONFIG_H_
#define DIALOG_COLOR_CONFIG_H_
#include <wx/statline.h>
...
...
@@ -13,47 +13,24 @@ class wxStdDialogButtonSizer;
extern
void
SeedLayers
();
// Specify the width and height of every (color-displaying / bitmap) button
const
int
BUTT_SIZE_X
=
16
;
const
int
BUTT_SIZE_Y
=
16
;
/********************/
/* Layer menu list. */
/********************/
struct
ColorButton
{
wxString
m_Name
;
int
m_Layer
;
};
struct
ButtonIndex
{
wxString
m_Name
;
ColorButton
*
m_Buttons
;
};
/***********************************************/
/* Derived class for the frame color settings. */
/***********************************************/
class
DIALOG_COLOR_CONFIG
:
public
wxDialog
class
DIALOG_COLOR_CONFIG
:
public
wxDialog
{
private
:
DECLARE_DYNAMIC_CLASS
(
DIALOG_COLOR_CONFIG
)
EDA_DRAW_FRAME
*
m_
P
arent
;
wxBoxSizer
*
O
uterBoxSizer
;
wxBoxSizer
*
M
ainBoxSizer
;
wxBoxSizer
*
C
olumnBoxSizer
;
wxBoxSizer
*
R
owBoxSizer
;
wxBitmapButton
*
B
itmapButton
;
EDA_DRAW_FRAME
*
m_
p
arent
;
wxBoxSizer
*
m_o
uterBoxSizer
;
wxBoxSizer
*
m_m
ainBoxSizer
;
wxBoxSizer
*
m_c
olumnBoxSizer
;
wxBoxSizer
*
m_r
owBoxSizer
;
wxBitmapButton
*
m_b
itmapButton
;
wxRadioBox
*
m_SelBgColor
;
wxStaticLine
*
Line
;
wxStdDialogButtonSizer
*
StdDialogButtonSizer
;
wxButton
*
Button
;
wxStaticLine
*
m_line
;
wxStdDialogButtonSizer
*
m_stdDialogButtonSizer
;
// Creation
bool
Create
(
wxWindow
*
aParent
,
...
...
@@ -70,7 +47,7 @@ private:
void
CreateControls
();
wxBitmap
GetBitmapResource
(
const
wxString
&
aName
);
wxIcon
GetIconResource
(
const
wxString
&
aName
);
wxIcon
GetIconResource
(
const
wxString
&
aName
);
static
bool
ShowToolTips
();
bool
UpdateColorsSettings
();
...
...
@@ -86,4 +63,4 @@ public:
~
DIALOG_COLOR_CONFIG
();
};
#endif //
_
DIALOG_COLOR_CONFIG_H_
#endif // DIALOG_COLOR_CONFIG_H_
gerbview/draw_gerber_screen.cpp
View file @
1c0f034b
...
...
@@ -137,7 +137,12 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
// artifacts can happen with negative items or negative images
wxColour
bgColor
=
MakeColour
(
g_DrawBgColor
);
#if wxCHECK_VERSION( 3, 0, 0 )
wxBrush
bgBrush
(
bgColor
,
wxBRUSHSTYLE_SOLID
);
#else
wxBrush
bgBrush
(
bgColor
,
wxSOLID
);
#endif
GERBVIEW_FRAME
*
gerbFrame
=
(
GERBVIEW_FRAME
*
)
aPanel
->
GetParent
();
...
...
include/xnode.h
View file @
1c0f034b
...
...
@@ -34,8 +34,8 @@
#include <wx/xml/xml.h>
#if wxCHECK_VERSION( 2, 9, 0 )
#define wxXml
Property wxXmlAttribute
#if
!
wxCHECK_VERSION( 2, 9, 0 )
#define wxXml
Attribute wxXmlProperty
#endif
/**
...
...
@@ -58,7 +58,7 @@ public:
}
XNODE
(
XNODE
*
aParent
,
wxXmlNodeType
aType
,
const
wxString
&
aName
,
const
wxString
&
aContent
=
wxEmptyString
,
wxXml
Property
*
aProperties
=
NULL
)
:
const
wxString
&
aContent
=
wxEmptyString
,
wxXml
Attribute
*
aProperties
=
NULL
)
:
wxXmlNode
(
aParent
,
aType
,
aName
,
aContent
,
aProperties
)
{
}
...
...
@@ -120,7 +120,7 @@ public:
{
return
DeleteProperty
(
attrName
);
}
wxXml
Property
*
GetAttributes
()
const
wxXml
Attribute
*
GetAttributes
()
const
{
return
GetProperties
();
}
...
...
pcbnew/dialogs/dialog_copper_zones.cpp
View file @
1c0f034b
...
...
@@ -694,7 +694,13 @@ wxBitmap DIALOG_COPPER_ZONE::makeLayerBitmap( EDA_COLOR_T aColor )
iconDC
.
SelectObject
(
bitmap
);
brush
.
SetColour
(
MakeColour
(
aColor
)
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
LAYER_BITMAP_SIZE_X
,
LAYER_BITMAP_SIZE_Y
);
...
...
pcbnew/dialogs/dialog_keepout_area_properties.cpp
View file @
1c0f034b
...
...
@@ -260,7 +260,13 @@ wxBitmap DIALOG_KEEPOUT_AREA_PROPERTIES::makeLayerBitmap( EDA_COLOR_T aColor )
iconDC
.
SelectObject
(
bitmap
);
brush
.
SetColour
(
MakeColour
(
aColor
)
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
LAYER_BITMAP_SIZE_X
,
LAYER_BITMAP_SIZE_Y
);
...
...
pcbnew/footprint_wizard_frame.cpp
View file @
1c0f034b
...
...
@@ -80,8 +80,16 @@ EVT_TOOL( ID_FOOTPRINT_WIZARD_SHOW_3D_VIEW,
// listbox events
EVT_LISTBOX
(
ID_FOOTPRINT_WIZARD_PAGE_LIST
,
FOOTPRINT_WIZARD_FRAME
::
ClickOnPageList
)
#if wxCHECK_VERSION( 3, 0, 0 )
EVT_GRID_CMD_CELL_CHANGED
(
ID_FOOTPRINT_WIZARD_PARAMETER_LIST
,
FOOTPRINT_WIZARD_FRAME
::
ParametersUpdated
)
#else
EVT_GRID_CMD_CELL_CHANGE
(
ID_FOOTPRINT_WIZARD_PARAMETER_LIST
,
FOOTPRINT_WIZARD_FRAME
::
ParametersUpdated
)
#endif
EVT_GRID_CMD_EDITOR_HIDDEN
(
ID_FOOTPRINT_WIZARD_PARAMETER_LIST
,
FOOTPRINT_WIZARD_FRAME
::
ParametersUpdated
)
...
...
pcbnew/layer_widget.cpp
View file @
1c0f034b
...
...
@@ -192,7 +192,13 @@ wxBitmap LAYER_WIDGET::makeBitmap( EDA_COLOR_T aColor )
iconDC
.
SelectObject
(
bitmap
);
brush
.
SetColour
(
MakeColour
(
aColor
)
);
#if wxCHECK_VERSION( 3, 0, 0 )
brush
.
SetStyle
(
wxBRUSHSTYLE_SOLID
);
#else
brush
.
SetStyle
(
wxSOLID
);
#endif
iconDC
.
SetBrush
(
brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
BUTT_SIZE_X
-
2
*
BUTT_VOID
,
BUTT_SIZE_Y
-
2
*
BUTT_VOID
);
...
...
pcbnew/pcbnew_config.cpp
View file @
1c0f034b
...
...
@@ -495,7 +495,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
void
PCB_EDIT_FRAME
::
SaveMacros
()
{
wxXmlDocument
xml
;
wxXml
Property
*
macrosProp
,
*
hkProp
,
*
xProp
,
*
yProp
;
wxXml
Attribute
*
macrosProp
,
*
hkProp
,
*
xProp
,
*
yProp
;
wxString
str
,
hkStr
,
xStr
,
yStr
;
wxFileName
fn
=
GetBoard
()
->
GetFileName
();
...
...
@@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::SaveMacros()
for
(
int
number
=
9
;
number
>=
0
;
number
--
)
{
str
.
Printf
(
wxT
(
"%d"
),
number
);
macrosProp
=
new
wxXml
Property
(
wxT
(
"number"
),
str
);
macrosProp
=
new
wxXml
Attribute
(
wxT
(
"number"
),
str
);
XNODE
*
macrosNode
=
new
XNODE
(
rootNode
,
wxXML_ELEMENT_NODE
,
wxT
(
"macros"
),
wxEmptyString
,
...
...
@@ -527,9 +527,9 @@ void PCB_EDIT_FRAME::SaveMacros()
xStr
.
Printf
(
wxT
(
"%d"
),
i
->
m_Position
.
x
);
yStr
.
Printf
(
wxT
(
"%d"
),
i
->
m_Position
.
y
);
yProp
=
new
wxXmlProperty
(
wxT
(
"y"
),
yStr
);
xProp
=
new
wxXmlProperty
(
wxT
(
"x"
),
xStr
,
yProp
);
hkProp
=
new
wxXml
Property
(
wxT
(
"hkcode"
),
hkStr
,
xProp
);
yProp
=
new
wxXmlAttribute
(
wxT
(
"y"
),
yStr
);
xProp
=
new
wxXmlAttribute
(
wxT
(
"x"
),
xStr
,
yProp
);
hkProp
=
new
wxXml
Attribute
(
wxT
(
"hkcode"
),
hkStr
,
xProp
);
new
XNODE
(
macrosNode
,
wxXML_ELEMENT_NODE
,
wxT
(
"hotkey"
),
wxEmptyString
,
hkProp
);
...
...
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