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
2f3aeeaa
Commit
2f3aeeaa
authored
Sep 13, 2007
by
g_harland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhance "Colors" dialog box (as listed in change_log.txt)
parent
cb49ea89
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
190 additions
and
124 deletions
+190
-124
change_log.txt
change_log.txt
+9
-0
selcolor.cpp
common/selcolor.cpp
+79
-41
eelayer.cpp
eeschema/eelayer.cpp
+44
-38
set_color.cpp
gerbview/set_color.cpp
+34
-26
common.h
include/common.h
+1
-2
set_color.cpp
pcbnew/set_color.cpp
+23
-17
No files found.
change_log.txt
View file @
2f3aeeaa
...
@@ -5,6 +5,15 @@ Please add newer entries at the top, list the date and your name with
...
@@ -5,6 +5,15 @@ Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Sep-13 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ eeschema & pcbnew & gerbview
A Cancel button has now been provided for the "Colors" dialog box, which also
permits it to (otherwise) be cancelled by pressing the "Esc" key; the button
whose color matches that of the color currently selected (for the layer being
edited) also has the initial focus set to it.
2007-Sep-11 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Sep-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+ pcbnew
+ pcbnew
...
...
common/selcolor.cpp
View file @
2f3aeeaa
/************************/
/************************/
/* SETCOLOR.CPP */
/* SETCOLOR.CPP */
/************************/
/************************/
/* Affichage et selection de la palette des couleurs disponibles
/* Affichage et selection de la palette des couleurs disponibles
dans une frame
*
dans une frame
*/
*/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -22,30 +22,33 @@ enum colors_id {
...
@@ -22,30 +22,33 @@ enum colors_id {
class
WinEDA_SelColorFrame
:
public
wxDialog
class
WinEDA_SelColorFrame
:
public
wxDialog
/*******************************************/
/*******************************************/
/* Frame d'affichage de la palette des couleurs disponibles
/* Frame d'affichage de la palette des couleurs disponibles
*/
*/
{
{
private
:
private
:
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_SelColorFrame
(
wxWindow
*
parent
,
const
wxPoint
&
framepos
);
WinEDA_SelColorFrame
(
wxWindow
*
parent
,
const
wxPoint
&
framepos
,
int
OldColor
);
~
WinEDA_SelColorFrame
(
void
)
{};
~
WinEDA_SelColorFrame
(
void
)
{};
private
:
private
:
void
OnCancel
(
wxCommandEvent
&
event
);
void
SelColor
(
wxCommandEvent
&
event
);
void
SelColor
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/* Construction de la table des evenements pour FrameClassMain */
/* Construction de la table des evenements pour FrameClassMain */
BEGIN_EVENT_TABLE
(
WinEDA_SelColorFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_SelColorFrame
,
wxDialog
)
EVT_
COMMAND_RANGE
(
ID_COLOR_BLACK
,
ID_COLOR_BLACK
+
31
,
EVT_
BUTTON
(
wxID_CANCEL
,
WinEDA_SelColorFrame
::
OnCancel
)
wxEVT_COMMAND_BUTTON_CLICKED
,
EVT_COMMAND_RANGE
(
ID_COLOR_BLACK
,
ID_COLOR_BLACK
+
31
,
WinEDA_SelColorFrame
::
SelColor
)
wxEVT_COMMAND_BUTTON_CLICKED
,
WinEDA_SelColorFrame
::
SelColor
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
/***************************************/
/***************************************/
int
DisplayColorFrame
(
wxWindow
*
parent
)
int
DisplayColorFrame
(
wxWindow
*
parent
,
int
OldColor
)
/***************************************/
/***************************************/
{
{
wxPoint
framepos
;
wxPoint
framepos
;
...
@@ -53,26 +56,32 @@ int color;
...
@@ -53,26 +56,32 @@ int color;
wxGetMousePosition
(
&
framepos
.
x
,
&
framepos
.
y
);
wxGetMousePosition
(
&
framepos
.
x
,
&
framepos
.
y
);
WinEDA_SelColorFrame
*
frame
=
new
WinEDA_SelColorFrame
(
parent
,
framepos
);
WinEDA_SelColorFrame
*
frame
=
new
WinEDA_SelColorFrame
(
parent
,
color
=
frame
->
ShowModal
();
frame
->
Destroy
();
framepos
,
OldColor
);
if
(
color
>
NBCOLOR
)
color
=
-
1
;
color
=
frame
->
ShowModal
();
frame
->
Destroy
();
if
(
color
>
NBCOLOR
)
color
=
-
1
;
return
color
;
return
color
;
}
}
/*******************************************************************/
/*******************************************************************/
WinEDA_SelColorFrame
::
WinEDA_SelColorFrame
(
wxWindow
*
parent
,
WinEDA_SelColorFrame
::
WinEDA_SelColorFrame
(
wxWindow
*
parent
,
const
wxPoint
&
framepos
)
:
const
wxPoint
&
framepos
,
int
OldColor
)
:
wxDialog
(
parent
,
-
1
,
_
(
"Colors"
),
framepos
,
wxSize
(
375
,
240
),
wxDialog
(
parent
,
-
1
,
_
(
"Colors"
),
framepos
,
wxSize
(
375
,
240
),
DIALOG_STYLE
)
DIALOG_STYLE
)
/*******************************************************************/
/*******************************************************************/
{
{
#define START_Y 10
#define START_Y 10
wxBitmapButton
*
Button
;
wxBitmapButton
*
BitmapButton
;
wxButton
*
Button
;
int
ii
,
butt_ID
,
buttcolor
;
int
ii
,
butt_ID
,
buttcolor
;
wxPoint
pos
;
wxPoint
pos
;
int
w
=
20
,
h
=
20
;
int
w
=
20
,
h
=
20
;
wxStaticText
*
text
;
wxStaticText
*
text
;
int
right
,
bottom
,
line_height
;
int
right
,
bottom
,
line_height
;
bool
ColorFound
=
false
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
...
@@ -99,33 +108,64 @@ int right, bottom, line_height;
...
@@ -99,33 +108,64 @@ int right, bottom, line_height;
iconDC
.
SetBrush
(
Brush
);
iconDC
.
SetBrush
(
Brush
);
iconDC
.
SetBackground
(
*
wxGREY_BRUSH
);
iconDC
.
SetBackground
(
*
wxGREY_BRUSH
);
iconDC
.
Clear
();
iconDC
.
Clear
();
iconDC
.
DrawRoundedRectangle
(
0
,
0
,
w
,
h
,
(
double
)
h
/
3
);
iconDC
.
DrawRoundedRectangle
(
0
,
0
,
w
,
h
,
(
double
)
h
/
3
);
text
=
new
wxStaticText
(
this
,
-
1
,
text
=
new
wxStaticText
(
this
,
-
1
,
ColorRefs
[
ii
].
m_Name
,
ColorRefs
[
ii
].
m_Name
,
wxPoint
(
pos
.
x
+
2
+
w
,
pos
.
y
),
wxPoint
(
pos
.
x
+
2
+
w
,
pos
.
y
),
wxSize
(
-
1
,
-
1
),
0
);
wxSize
(
-
1
,
-
1
),
0
);
line_height
=
MAX
(
line_height
,
text
->
GetRect
().
GetHeight
());
line_height
=
MAX
(
line_height
,
text
->
GetRect
().
GetHeight
()
);
right
=
MAX
(
right
,
text
->
GetRect
().
GetRight
()
);
right
=
MAX
(
right
,
text
->
GetRect
().
GetRight
()
);
bottom
=
MAX
(
bottom
,
text
->
GetRect
().
GetBottom
()
);
bottom
=
MAX
(
bottom
,
text
->
GetRect
().
GetBottom
()
);
B
utton
=
new
wxBitmapButton
(
this
,
butt_ID
,
B
itmapButton
=
new
wxBitmapButton
(
this
,
butt_ID
,
ButtBitmap
,
ButtBitmap
,
wxPoint
(
pos
.
x
,
pos
.
y
-
((
h
-
line_height
)
/
2
)
),
wxPoint
(
pos
.
x
,
pos
.
y
-
(
h
-
line_height
)
/
2
),
wxSize
(
w
,
h
)
);
wxSize
(
w
,
h
)
);
pos
.
y
+=
line_height
+
5
;
// Set focus to this button if its color matches the
if
(
ii
==
7
)
// color which had been selected previously (for
// whichever layer's color is currently being edited).
if
(
OldColor
==
buttcolor
)
{
{
pos
.
x
=
right
+
10
;
pos
.
y
=
START_Y
;
ColorFound
=
true
;
BitmapButton
->
SetFocus
();
}
}
else
if
(
(
ii
==
15
)
||
(
ii
==
23
)
)
pos
.
y
+=
line_height
+
5
;
if
(
ii
==
7
||
ii
==
15
)
{
{
pos
.
x
=
right
+
10
;
pos
.
y
=
START_Y
;
pos
.
x
=
right
+
10
;
pos
.
y
=
START_Y
;
}
}
}
}
SetClientSize
(
wxSize
(
right
+
10
,
bottom
+
10
)
);
pos
.
x
=
140
;
// Provide a Cancel button as well, so that this dialog
// box can also be cancelled by pressing the Esc key.
Button
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel"
),
pos
);
Button
->
SetForegroundColour
(
*
wxBLUE
);
// Set focus to the Cancel button if the currently selected color
// does not match any of the colors provided by this dialog box.
// (That shouldn't ever happen in practice though.)
if
(
!
ColorFound
)
Button
->
SetFocus
();
SetClientSize
(
wxSize
(
right
+
10
,
bottom
+
40
)
);
}
/***************************************************************/
void
WinEDA_SelColorFrame
::
OnCancel
(
wxCommandEvent
&
WXUNUSED
(
event
))
/***************************************************************/
/* Called by the Cancel button
*/
{
// Setting the return value to -1 indicates that the
// dialog box has been cancelled (and thus that the
// previously selected color is to be retained).
EndModal
(
-
1
);
}
}
...
@@ -138,5 +178,3 @@ int id = event.GetId();
...
@@ -138,5 +178,3 @@ int id = event.GetId();
EndModal
(
id
-
ID_COLOR_BLACK
);
EndModal
(
id
-
ID_COLOR_BLACK
);
}
}
eeschema/eelayer.cpp
View file @
2f3aeeaa
...
@@ -273,9 +273,11 @@ void DisplayColorSetupFrame(WinEDA_DrawFrame * parent,
...
@@ -273,9 +273,11 @@ void DisplayColorSetupFrame(WinEDA_DrawFrame * parent,
{
{
WinEDA_SetColorsFrame
*
frame
=
WinEDA_SetColorsFrame
*
frame
=
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
/**********************************************************************/
/**********************************************************************/
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
)
:
const
wxPoint
&
framepos
)
:
...
@@ -300,7 +302,7 @@ wxPoint bg_color_pos;
...
@@ -300,7 +302,7 @@ wxPoint bg_color_pos;
line_height
=
h
;
line_height
=
h
;
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
{
{
if
(
pos
.
y
!=
START_Y
)
if
(
pos
.
y
!=
START_Y
)
{
{
...
@@ -309,10 +311,10 @@ wxPoint bg_color_pos;
...
@@ -309,10 +311,10 @@ wxPoint bg_color_pos;
bg_color_pos
=
pos
;
bg_color_pos
=
pos
;
}
}
wxString
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Name
);
wxString
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Name
);
text
=
new
wxStaticText
(
this
,
-
1
,
text
=
new
wxStaticText
(
this
,
-
1
,
msg
,
msg
,
wxPoint
(
pos
.
x
,
pos
.
y
),
wxPoint
(
pos
.
x
,
pos
.
y
),
wxSize
(
-
1
,
-
1
),
0
);
wxSize
(
-
1
,
-
1
),
0
);
line_height
=
MAX
(
line_height
,
text
->
GetRect
().
GetHeight
());
line_height
=
MAX
(
line_height
,
text
->
GetRect
().
GetHeight
());
pos
.
y
+=
line_height
;
pos
.
y
+=
line_height
;
continue
;
continue
;
...
@@ -334,19 +336,19 @@ wxPoint bg_color_pos;
...
@@ -334,19 +336,19 @@ wxPoint bg_color_pos;
Brush
.
SetStyle
(
wxSOLID
);
Brush
.
SetStyle
(
wxSOLID
);
iconDC
.
SetBrush
(
Brush
);
iconDC
.
SetBrush
(
Brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
Button
=
new
wxBitmapButton
(
this
,
butt_ID
,
Button
=
new
wxBitmapButton
(
this
,
butt_ID
,
ButtBitmap
,
ButtBitmap
,
wxPoint
(
pos
.
x
,
pos
.
y
-
((
h
-
line_height
)
/
2
)
),
wxPoint
(
pos
.
x
,
pos
.
y
-
(
h
-
line_height
)
/
2
),
wxSize
(
w
,
h
)
);
wxSize
(
w
,
h
)
);
laytool_list
[
ii
]
->
m_Button
=
Button
;
laytool_list
[
ii
]
->
m_Button
=
Button
;
wxString
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Name
);
wxString
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Name
);
text
=
new
wxStaticText
(
this
,
-
1
,
text
=
new
wxStaticText
(
this
,
-
1
,
msg
,
msg
,
wxPoint
(
pos
.
x
+
5
+
w
,
pos
.
y
),
wxPoint
(
pos
.
x
+
5
+
w
,
pos
.
y
),
wxSize
(
-
1
,
-
1
),
0
);
wxSize
(
-
1
,
-
1
),
0
);
wxPoint
lowpos
;
wxPoint
lowpos
;
lowpos
.
x
=
text
->
GetRect
().
GetRight
();
lowpos
.
x
=
text
->
GetRect
().
GetRight
();
lowpos
.
y
=
text
->
GetRect
().
GetBottom
();
lowpos
.
y
=
text
->
GetRect
().
GetBottom
();
...
@@ -364,8 +366,8 @@ wxString bg_choice[2] = { _("White Background"), _("Black Background")};
...
@@ -364,8 +366,8 @@ wxString bg_choice[2] = { _("White Background"), _("Black Background")};
_
(
"Background Colour"
),
bg_color_pos
,
_
(
"Background Colour"
),
bg_color_pos
,
wxDefaultSize
,
2
,
bg_choice
,
1
,
wxRA_SPECIFY_COLS
);
wxDefaultSize
,
2
,
bg_choice
,
1
,
wxRA_SPECIFY_COLS
);
m_SelBgColor
->
SetSelection
(
(
g_DrawBgColor
==
BLACK
)
?
1
:
0
);
m_SelBgColor
->
SetSelection
(
(
g_DrawBgColor
==
BLACK
)
?
1
:
0
);
bottom
=
MAX
(
bottom
,
m_SelBgColor
->
GetRect
().
GetBottom
());
;
bottom
=
MAX
(
bottom
,
m_SelBgColor
->
GetRect
().
GetBottom
());
right
=
MAX
(
right
,
m_SelBgColor
->
GetRect
().
GetRight
());
;
right
=
MAX
(
right
,
m_SelBgColor
->
GetRect
().
GetRight
());
SetClientSize
(
wxSize
(
right
+
10
,
bottom
+
10
));
SetClientSize
(
wxSize
(
right
+
10
,
bottom
+
10
));
}
}
...
@@ -375,17 +377,23 @@ wxString bg_choice[2] = { _("White Background"), _("Black Background")};
...
@@ -375,17 +377,23 @@ wxString bg_choice[2] = { _("White Background"), _("Black Background")};
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
/***************************************************************/
/***************************************************************/
{
{
int
ii
;
int
id
=
event
.
GetId
();
int
id
=
event
.
GetId
();
int
color
=
DisplayColorFrame
(
this
)
;
int
color
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
if
(
color
<
0
)
return
;
color
=
DisplayColorFrame
(
this
,
*
laytool_list
[
id
-
ID_COLOR_SETUP
]
->
m_Color
);
if
(
color
<
0
)
return
;
for
(
i
nt
i
i
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
continue
;
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
continue
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
wxMemoryDC
iconDC
;
wxMemoryDC
iconDC
;
...
@@ -421,8 +429,10 @@ void WinEDA_SetColorsFrame::BgColorChoice(wxCommandEvent& event)
...
@@ -421,8 +429,10 @@ void WinEDA_SetColorsFrame::BgColorChoice(wxCommandEvent& event)
{
{
int
color
;
int
color
;
if
(
m_SelBgColor
->
GetSelection
()
==
0
)
color
=
WHITE
;
if
(
m_SelBgColor
->
GetSelection
()
==
0
)
else
color
=
BLACK
;
color
=
WHITE
;
else
color
=
BLACK
;
if
(
color
!=
g_DrawBgColor
)
if
(
color
!=
g_DrawBgColor
)
{
{
...
@@ -430,12 +440,9 @@ int color;
...
@@ -430,12 +440,9 @@ int color;
m_Parent
->
SetDrawBgColor
(
g_DrawBgColor
);
m_Parent
->
SetDrawBgColor
(
g_DrawBgColor
);
m_Parent
->
ReDrawPanel
();
m_Parent
->
ReDrawPanel
();
}
}
}
}
/*************************/
/*************************/
void
SeedLayers
(
void
)
void
SeedLayers
(
void
)
/*************************/
/*************************/
...
@@ -445,18 +452,18 @@ int pt;
...
@@ -445,18 +452,18 @@ int pt;
LayerPointer
->
CommonColor
=
WHITE
;
LayerPointer
->
CommonColor
=
WHITE
;
LayerPointer
->
Flags
=
0
;
LayerPointer
->
Flags
=
0
;
pt
=
0
;
pt
=
0
;
LayerPointer
->
CurrentWidth
=
1
;
LayerPointer
->
CurrentWidth
=
1
;
/* seed Up the Layer colours, set all user layers off */
/* seed Up the Layer colours, set all user layers off */
for
(
pt
=
0
;
pt
<
MAX_LAYERS
;
pt
++
)
for
(
pt
=
0
;
pt
<
MAX_LAYERS
;
pt
++
)
{
{
LayerPointer
->
LayerStatus
[
pt
]
=
0
;
LayerPointer
->
LayerStatus
[
pt
]
=
0
;
LayerPointer
->
LayerColor
[
pt
]
=
DARKGRAY
;
LayerPointer
->
LayerColor
[
pt
]
=
DARKGRAY
;
}
}
LayerPointer
->
NumberOfLayers
=
pt
-
1
;
LayerPointer
->
NumberOfLayers
=
pt
-
1
;
/* Couleurs specifiques: Mise a jour par la lecture de la config*/
/* Couleurs specifiques: Mise a jour par la lecture de la config
*/
}
}
...
@@ -464,10 +471,9 @@ int pt;
...
@@ -464,10 +471,9 @@ int pt;
int
ReturnLayerColor
(
int
Layer
)
int
ReturnLayerColor
(
int
Layer
)
/*******************************/
/*******************************/
{
{
if
(
g_LayerDescr
.
Flags
==
0
)
if
(
g_LayerDescr
.
Flags
==
0
)
return
(
g_LayerDescr
.
LayerColor
[
Layer
]
);
return
(
g_LayerDescr
.
LayerColor
[
Layer
]
);
else
else
return
(
g_LayerDescr
.
CommonColor
);
return
(
g_LayerDescr
.
CommonColor
);
}
}
gerbview/set_color.cpp
View file @
2f3aeeaa
...
@@ -28,6 +28,7 @@ enum col_sel_id {
...
@@ -28,6 +28,7 @@ enum col_sel_id {
ID_COLOR_SETUP
ID_COLOR_SETUP
};
};
/**********************************/
/**********************************/
/* Liste des menus de Menu_Layers */
/* Liste des menus de Menu_Layers */
/**********************************/
/**********************************/
...
@@ -133,11 +134,11 @@ void DisplayColorSetupFrame(WinEDA_DrawFrame * parent,
...
@@ -133,11 +134,11 @@ void DisplayColorSetupFrame(WinEDA_DrawFrame * parent,
{
{
WinEDA_SetColorsFrame
*
frame
=
WinEDA_SetColorsFrame
*
frame
=
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
/**********************************************************************/
/**********************************************************************/
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
)
:
const
wxPoint
&
framepos
)
:
...
@@ -185,7 +186,8 @@ wxBoxSizer * CurrBoxSizer = NULL;
...
@@ -185,7 +186,8 @@ wxBoxSizer * CurrBoxSizer = NULL;
{
{
if
(
*
laytool_list
[
ii
]
->
m_Color
&
ITEM_NOT_SHOW
)
if
(
*
laytool_list
[
ii
]
->
m_Color
&
ITEM_NOT_SHOW
)
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
FALSE
);
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
FALSE
);
else
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
TRUE
);
else
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
TRUE
);
}
}
else
if
(
laytool_list
[
ii
]
->
m_NoDisplay
)
else
if
(
laytool_list
[
ii
]
->
m_NoDisplay
)
...
@@ -242,6 +244,7 @@ wxBoxSizer * CurrBoxSizer = NULL;
...
@@ -242,6 +244,7 @@ wxBoxSizer * CurrBoxSizer = NULL;
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
}
/*******************************************************************/
/*******************************************************************/
void
WinEDA_SetColorsFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
))
void
WinEDA_SetColorsFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
))
/*******************************************************************/
/*******************************************************************/
...
@@ -251,7 +254,6 @@ void WinEDA_SetColorsFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
...
@@ -251,7 +254,6 @@ void WinEDA_SetColorsFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
}
}
/***********************************************************/
/***********************************************************/
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
/***********************************************************/
/***********************************************************/
...
@@ -261,16 +263,21 @@ int id = event.GetId();
...
@@ -261,16 +263,21 @@ int id = event.GetId();
int
color
;
int
color
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
color
=
DisplayColorFrame
(
this
,
color
=
DisplayColorFrame
(
this
);
*
laytool_list
[
id
-
ID_COLOR_SETUP
]
->
m_Color
);
if
(
color
<
0
)
return
;
if
(
color
<
0
)
return
;
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
continue
;
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
continue
;
continue
;
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
continue
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
wxMemoryDC
iconDC
;
wxMemoryDC
iconDC
;
...
@@ -306,28 +313,28 @@ void WinEDA_SetColorsFrame::SetDisplayOnOff(wxCommandEvent& event)
...
@@ -306,28 +313,28 @@ void WinEDA_SetColorsFrame::SetDisplayOnOff(wxCommandEvent& event)
{
{
for
(
int
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
int
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
if
(
!
laytool_list
[
ii
]
->
m_NoDisplayIsColor
&&
if
(
!
laytool_list
[
ii
]
->
m_NoDisplayIsColor
&&
(
laytool_list
[
ii
]
->
m_NoDisplay
==
NULL
)
)
continue
;
(
laytool_list
[
ii
]
->
m_NoDisplay
==
NULL
)
)
continue
;
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
{
{
if
(
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
()
)
if
(
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
()
)
*
laytool_list
[
ii
]
->
m_Color
&=
~
ITEM_NOT_SHOW
;
*
laytool_list
[
ii
]
->
m_Color
&=
~
ITEM_NOT_SHOW
;
else
*
laytool_list
[
ii
]
->
m_Color
|=
ITEM_NOT_SHOW
;
else
*
laytool_list
[
ii
]
->
m_Color
|=
ITEM_NOT_SHOW
;
}
}
else
else
{
{
*
laytool_list
[
ii
]
->
m_NoDisplay
=
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
();
*
laytool_list
[
ii
]
->
m_NoDisplay
=
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
();
}
}
}
}
m_Parent
->
GetScreen
()
->
SetRefreshReq
();
m_Parent
->
GetScreen
()
->
SetRefreshReq
();
}
}
/***********************************************************************/
/***********************************************************************/
void
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
(
wxCommandEvent
&
event
)
/***********************************************************************/
/***********************************************************************/
...
@@ -336,7 +343,8 @@ bool NewState = (event.GetId() == ID_COLOR_RESET_SHOW_LAYER_ON) ? TRUE : FALSE;
...
@@ -336,7 +343,8 @@ bool NewState = (event.GetId() == ID_COLOR_RESET_SHOW_LAYER_ON) ? TRUE : FALSE;
for
(
int
ii
=
1
;
ii
<
34
;
ii
++
)
for
(
int
ii
=
1
;
ii
<
34
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
NewState
);
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
NewState
);
}
}
...
...
include/common.h
View file @
2f3aeeaa
...
@@ -551,7 +551,7 @@ void AfficheDoc(WinEDA_DrawFrame * frame, const wxString & Doc, const wxString &
...
@@ -551,7 +551,7 @@ void AfficheDoc(WinEDA_DrawFrame * frame, const wxString & Doc, const wxString &
int
GetTimeStamp
(
void
);
int
GetTimeStamp
(
void
);
/* Retoure une identification temporelle (Time stamp) differente a chaque appel */
/* Retoure une identification temporelle (Time stamp) differente a chaque appel */
int
DisplayColorFrame
(
wxWindow
*
parent
);
int
DisplayColorFrame
(
wxWindow
*
parent
,
int
OldColor
);
int
GetCommandOptions
(
const
int
argc
,
const
char
**
argv
,
const
char
*
stringtst
,
int
GetCommandOptions
(
const
int
argc
,
const
char
**
argv
,
const
char
*
stringtst
,
const
char
**
optarg
,
int
*
optind
);
const
char
**
optarg
,
int
*
optind
);
...
@@ -627,4 +627,3 @@ void DrawAndSizingBlockOutlines(WinEDA_DrawPanel * panel, wxDC * DC, bool erase
...
@@ -627,4 +627,3 @@ void DrawAndSizingBlockOutlines(WinEDA_DrawPanel * panel, wxDC * DC, bool erase
#endif // COMMON_H
#endif // COMMON_H
pcbnew/set_color.cpp
View file @
2f3aeeaa
...
@@ -50,11 +50,6 @@ static ColorButton Msg_Layers_Cu =
...
@@ -50,11 +50,6 @@ static ColorButton Msg_Layers_Cu =
_
(
"Copper Layers"
),
-
1
/* Title */
_
(
"Copper Layers"
),
-
1
/* Title */
};
};
static
ColorButton
Msg_Layers_Tech
=
{
_
(
"Tech Layers"
),
-
1
/* Title */
};
static
ColorButton
Layer_1_Butt
=
static
ColorButton
Layer_1_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
...
@@ -183,6 +178,12 @@ static ColorButton Layer_16_Butt =
...
@@ -183,6 +178,12 @@ static ColorButton Layer_16_Butt =
TRUE
// toggle bit ITEM_NOT_SHOW of the color variable
TRUE
// toggle bit ITEM_NOT_SHOW of the color variable
};
};
static
ColorButton
Msg_Layers_Tech
=
{
_
(
"Tech Layers"
),
-
1
/* Title */
};
static
ColorButton
Layer_17_Butt
=
static
ColorButton
Layer_17_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
...
@@ -322,7 +323,8 @@ static ColorButton Ratsnest_Butt =
...
@@ -322,7 +323,8 @@ static ColorButton Ratsnest_Butt =
_
(
"Ratsnest"
),
/* Title */
_
(
"Ratsnest"
),
/* Title */
-
1
,
-
1
,
&
g_DesignSettings
.
m_RatsnestColor
,
/* adr du parametre optionnel */
&
g_DesignSettings
.
m_RatsnestColor
,
/* adr du parametre optionnel */
FALSE
,
&
g_Show_Ratsnest
// address of boolean display control parameter to toggle
FALSE
,
&
g_Show_Ratsnest
// address of boolean display control parameter to toggle
};
};
static
ColorButton
Pad_Cu_Butt
=
static
ColorButton
Pad_Cu_Butt
=
...
@@ -455,6 +457,7 @@ static ColorButton* laytool_list[] = {
...
@@ -455,6 +457,7 @@ static ColorButton* laytool_list[] = {
// &Layer_30_Butt,
// &Layer_30_Butt,
// &Layer_31_Butt,
// &Layer_31_Butt,
// &Layer_32_Butt,
&
Msg_Others_Items
,
&
Msg_Others_Items
,
&
Via_Normale_Butt
,
&
Via_Normale_Butt
,
...
@@ -552,7 +555,7 @@ BEGIN_EVENT_TABLE( WinEDA_SetColorsFrame, wxDialog )
...
@@ -552,7 +555,7 @@ BEGIN_EVENT_TABLE( WinEDA_SetColorsFrame, wxDialog )
EVT_BUTTON
(
ID_COLOR_SETUP
+
41
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
41
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
42
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
42
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
43
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
43
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
44
,
WinEDA_SetColorsFrame
::
SetColor
)
//
EVT_BUTTON( ID_COLOR_SETUP + 44, WinEDA_SetColorsFrame::SetColor )
END_EVENT_TABLE
()
END_EVENT_TABLE
()
/*****************************************************/
/*****************************************************/
...
@@ -561,9 +564,10 @@ void DisplayColorSetupFrame( WinEDA_DrawFrame* parent,
...
@@ -561,9 +564,10 @@ void DisplayColorSetupFrame( WinEDA_DrawFrame* parent,
/*****************************************************/
/*****************************************************/
{
{
WinEDA_SetColorsFrame
*
frame
=
WinEDA_SetColorsFrame
*
frame
=
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
...
@@ -736,7 +740,9 @@ void WinEDA_SetColorsFrame::SetColor( wxCommandEvent& event )
...
@@ -736,7 +740,9 @@ void WinEDA_SetColorsFrame::SetColor( wxCommandEvent& event )
int
color
;
int
color
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
color
=
DisplayColorFrame
(
this
);
color
=
DisplayColorFrame
(
this
,
*
laytool_list
[
id
-
ID_COLOR_SETUP
]
->
m_Color
);
if
(
color
<
0
)
if
(
color
<
0
)
return
;
return
;
...
...
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