visibles work, update TODO.txt

This commit is contained in:
dickelbeck 2010-01-25 06:45:34 +00:00
parent 0f366f84d3
commit 98fab0b59e
6 changed files with 117 additions and 40 deletions

View File

@ -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(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
# 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_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
# Comment this out if you don't want to build with Python support.

View File

@ -49,8 +49,13 @@
#define strnicmp _strnicmp
#endif
#if 1
// now mandatory, not configurable
#define KICAD_AUIMANAGER 1
#define KICAD_AUITOOLBAR 1
#else
#cmakedefine KICAD_AUIMANAGER 1
#cmakedefine KICAD_AUITOOLBAR 1
#endif
#endif /* __CONFIG_H__ */

View File

@ -59,7 +59,7 @@ from folks with less than that minimum.
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(),
which is probably where fix should go.
@ -74,6 +74,17 @@ PCBNew
* Need to add polygon aperture type.
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:
@ -95,5 +106,9 @@ L7) make the bitmapbutton a staticbitmap, and make its size dependent on
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:
L9) still thinking about background colors, easier now without wxformbuilder.

View File

@ -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 )
{
m_BoardSettings->SetVisibleElements( aMask );
@ -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 color = -1;

View File

@ -283,6 +283,9 @@ public:
*/
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
* is a proxy function that calls the correspondent function in m_BoardSettings
@ -301,6 +304,25 @@ public:
*/
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
* returns the color of a pcb visible element.

View File

@ -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()
renderRows[row].color = board->GetVisibleElementColor( renderRows[row].id );
}
// @todo
// renderRows[row].state = GetBoard()->IsElementVisible( renderRows[row].id );
renderRows[row].state = board->IsElementVisible( renderRows[row].id );
}
AppendRenderRows( renderRows, DIM(renderRows) );
@ -380,27 +379,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
// see todo above, don't really want anything except IsElementVisible() here.
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;
break;
case MOD_FR_VISIBLE:
DisplayOpt.Show_Modules_Cmp = isEnabled;
break;
case MOD_BK_VISIBLE:
DisplayOpt.Show_Modules_Cu = isEnabled;
break;
default:
int visibleElements = brd->GetVisibleElements();
if( isEnabled )
visibleElements |= (1 << aId );
else
visibleElements &= ~(1 << aId);
brd->SetVisibleElements( visibleElements );
brd->SetElementVisibility( aId, isEnabled );
}
myframe->DrawPanel->Refresh();