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
98fab0b5
Commit
98fab0b5
authored
Jan 25, 2010
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
visibles work, update TODO.txt
parent
0f366f84
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
40 deletions
+117
-40
CMakeLists.txt
CMakeLists.txt
+5
-5
config.h.cmake
CMakeModules/config.h.cmake
+6
-1
TODO.txt
TODO.txt
+27
-12
class_board.cpp
pcbnew/class_board.cpp
+53
-3
class_board.h
pcbnew/class_board.h
+22
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+4
-19
No files found.
CMakeLists.txt
View file @
98fab0b5
...
@@ -19,9 +19,9 @@ option(KICAD_CYRILLIC "enable/disable building using cyrillic (needs unicode) (d
...
@@ -19,9 +19,9 @@ option(KICAD_CYRILLIC "enable/disable building using cyrillic (needs unicode) (d
option
(
wxUSE_UNICODE
"enable/disable building unicode (default OFF)"
)
option
(
wxUSE_UNICODE
"enable/disable building unicode (default OFF)"
)
option
(
KICAD_GOST
"enable/disable building using GOST notation for multiple gates per package (default OFF)"
)
option
(
KICAD_GOST
"enable/disable building using GOST notation for multiple gates per package (default OFF)"
)
# these are now mandatorily set to ON, and now done so in CMakeModules/config.h.cmake
option
(
KICAD_AUIMANAGER
"Enable use of wxAuiManager (default ON)"
ON
)
#
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
option
(
KICAD_AUITOOLBAR
"Enable use of wxAuiToolBar (default ON)"
ON
)
#
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
# Comment this out if you don't want to build with Python support.
# Comment this out if you don't want to build with Python support.
...
...
CMakeModules/config.h.cmake
View file @
98fab0b5
...
@@ -49,8 +49,13 @@
...
@@ -49,8 +49,13 @@
#define strnicmp _strnicmp
#define strnicmp _strnicmp
#endif
#endif
#if 1
// now mandatory, not configurable
#define KICAD_AUIMANAGER 1
#define KICAD_AUITOOLBAR 1
#else
#cmakedefine KICAD_AUIMANAGER 1
#cmakedefine KICAD_AUIMANAGER 1
#cmakedefine KICAD_AUITOOLBAR 1
#cmakedefine KICAD_AUITOOLBAR 1
#endif
#endif /* __CONFIG_H__ */
#endif /* __CONFIG_H__ */
TODO.txt
View file @
98fab0b5
...
@@ -59,7 +59,7 @@ from folks with less than that minimum.
...
@@ -59,7 +59,7 @@ from folks with less than that minimum.
PCBNew
PCBNew
------
------
*
Fix the color box which shows which layer is selected, or change tool tip.
P1)
Fix the color box which shows which layer is selected, or change tool tip.
It is not tracking layer changes. Look into WinEDA_PcbFrame::syncLayerBox(),
It is not tracking layer changes. Look into WinEDA_PcbFrame::syncLayerBox(),
which is probably where fix should go.
which is probably where fix should go.
...
@@ -74,6 +74,17 @@ PCBNew
...
@@ -74,6 +74,17 @@ PCBNew
* Need to add polygon aperture type.
* Need to add polygon aperture type.
Then example 2 in RS274xrevd_e.pdf will draw properly.
Then example 2 in RS274xrevd_e.pdf will draw properly.
* Complete the migration to PCB_VISIBLEs and put them into the board,
including grid, so they are saved with a board.
* Write accessors for grid control, so that the write accessor can fire
change notifications to known listeners. But again, grid boolean should
be in the board and accessed via BOARD::IsElementVisible( GRID_VISIBLE );
* Figure out why BOARD::IsElementVisible( PAD_{FR,BK}_VISIBLE ) is never tested,
and why the pads cannot be turned off. Did something get broke?
* Via visibility does not respond to the LAYER_WIDGET.
Dick:
Dick:
...
@@ -95,5 +106,9 @@ L7) make the bitmapbutton a staticbitmap, and make its size dependent on
...
@@ -95,5 +106,9 @@ L7) make the bitmapbutton a staticbitmap, and make its size dependent on
L8) LAYER_WIDGET::GetBestSize() needs platform independence.
L8) LAYER_WIDGET::GetBestSize() needs platform independence.
L9) On board load, ReFill() is called, this should also update the Render
checkboxes and colors. Will need to extend the widget API.
Dick:
Dick:
L9) still thinking about background colors, easier now without wxformbuilder.
L9) still thinking about background colors, easier now without wxformbuilder.
pcbnew/class_board.cpp
View file @
98fab0b5
...
@@ -385,6 +385,8 @@ void BOARD::SetVisibleLayers( int aLayerMask )
...
@@ -385,6 +385,8 @@ void BOARD::SetVisibleLayers( int aLayerMask )
}
}
// these are not tidy, since there are PCB_VISIBLEs that are not stored in the bitmap.
void
BOARD
::
SetVisibleElements
(
int
aMask
)
void
BOARD
::
SetVisibleElements
(
int
aMask
)
{
{
m_BoardSettings
->
SetVisibleElements
(
aMask
);
m_BoardSettings
->
SetVisibleElements
(
aMask
);
...
@@ -397,6 +399,54 @@ int BOARD::GetVisibleElements() const
...
@@ -397,6 +399,54 @@ int BOARD::GetVisibleElements() const
}
}
bool
BOARD
::
IsElementVisible
(
int
aPCB_VISIBLE
)
const
{
// @todo move these special cases into default, by moving globals into the board.
switch
(
aPCB_VISIBLE
)
{
/*
case GRID_VISIBLE:
myframe->m_Draw_Grid = isEnabled;
break;
*/
case
MOD_FR_VISIBLE
:
return
DisplayOpt
.
Show_Modules_Cmp
;
case
MOD_BK_VISIBLE
:
return
DisplayOpt
.
Show_Modules_Cu
;
default
:
return
m_BoardSettings
->
IsElementVisible
(
aPCB_VISIBLE
);
}
}
void
BOARD
::
SetElementVisibility
(
int
aPCB_VISIBLE
,
bool
isEnabled
)
{
switch
(
aPCB_VISIBLE
)
{
/*
case GRID_VISIBLE:
myframe->m_Draw_Grid = isEnabled;
break;
*/
// @todo move these special cases into default, by moving globals into the board.
case
MOD_FR_VISIBLE
:
DisplayOpt
.
Show_Modules_Cmp
=
isEnabled
;
break
;
case
MOD_BK_VISIBLE
:
DisplayOpt
.
Show_Modules_Cu
=
isEnabled
;
break
;
default
:
m_BoardSettings
->
SetElementVisibility
(
aPCB_VISIBLE
,
isEnabled
);
}
}
int
BOARD
::
GetVisibleElementColor
(
int
aPCB_VISIBLE
)
int
BOARD
::
GetVisibleElementColor
(
int
aPCB_VISIBLE
)
{
{
int
color
=
-
1
;
int
color
=
-
1
;
...
...
pcbnew/class_board.h
View file @
98fab0b5
...
@@ -283,6 +283,9 @@ public:
...
@@ -283,6 +283,9 @@ public:
*/
*/
void
SetVisibleLayers
(
int
aLayerMask
);
void
SetVisibleLayers
(
int
aLayerMask
);
// these 2 functions are not tidy at this time, since there are PCB_VISIBLEs that
// are not stored in the bitmap.
/**
/**
* Function GetVisibleElements
* Function GetVisibleElements
* is a proxy function that calls the correspondent function in m_BoardSettings
* is a proxy function that calls the correspondent function in m_BoardSettings
...
@@ -301,6 +304,25 @@ public:
...
@@ -301,6 +304,25 @@ public:
*/
*/
void
SetVisibleElements
(
int
aMask
);
void
SetVisibleElements
(
int
aMask
);
/**
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
* inline function.
* @param aPCB_VISIBLE is from the enum by the same name
* @return bool - true if the element is visible.
* @see enum PCB_VISIBLE
*/
bool
IsElementVisible
(
int
aPCB_VISIBLE
)
const
;
/**
* Function SetElementVisibility
* changes the visibility of an element category
* @param aPCB_VISIBLE is from the enum by the same name
* @param aNewState = The new visibility state of the element category
* @see enum PCB_VISIBLE
*/
void
SetElementVisibility
(
int
aPCB_VISIBLE
,
bool
aNewState
);
/**
/**
* Function GetVisibleElementColor
* Function GetVisibleElementColor
* returns the color of a pcb visible element.
* returns the color of a pcb visible element.
...
...
pcbnew/pcbframe.cpp
View file @
98fab0b5
...
@@ -137,8 +137,7 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw
...
@@ -137,8 +137,7 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw
// this window frame must have an established BOARD, i.e. after SetBoard()
// this window frame must have an established BOARD, i.e. after SetBoard()
renderRows
[
row
].
color
=
board
->
GetVisibleElementColor
(
renderRows
[
row
].
id
);
renderRows
[
row
].
color
=
board
->
GetVisibleElementColor
(
renderRows
[
row
].
id
);
}
}
// @todo
renderRows
[
row
].
state
=
board
->
IsElementVisible
(
renderRows
[
row
].
id
);
// renderRows[row].state = GetBoard()->IsElementVisible( renderRows[row].id );
}
}
AppendRenderRows
(
renderRows
,
DIM
(
renderRows
)
);
AppendRenderRows
(
renderRows
,
DIM
(
renderRows
)
);
...
@@ -380,27 +379,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
...
@@ -380,27 +379,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
// see todo above, don't really want anything except IsElementVisible() here.
// see todo above, don't really want anything except IsElementVisible() here.
case
GRID_VISIBLE
:
case
GRID_VISIBLE
:
// @todo, make read/write accessors for grid control so the write accessor can fire updates to
// grid state listeners. I think the grid state should be kept in the BOARD.
myframe
->
m_Draw_Grid
=
isEnabled
;
myframe
->
m_Draw_Grid
=
isEnabled
;
break
;
break
;
case
MOD_FR_VISIBLE
:
DisplayOpt
.
Show_Modules_Cmp
=
isEnabled
;
break
;
case
MOD_BK_VISIBLE
:
DisplayOpt
.
Show_Modules_Cu
=
isEnabled
;
break
;
default
:
default
:
brd
->
SetElementVisibility
(
aId
,
isEnabled
);
int
visibleElements
=
brd
->
GetVisibleElements
();
if
(
isEnabled
)
visibleElements
|=
(
1
<<
aId
);
else
visibleElements
&=
~
(
1
<<
aId
);
brd
->
SetVisibleElements
(
visibleElements
);
}
}
myframe
->
DrawPanel
->
Refresh
();
myframe
->
DrawPanel
->
Refresh
();
...
...
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