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.
@ -138,8 +138,8 @@ if( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
# On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
if(APPLE)
find_package(wxWidgets COMPONENTS gl adv html core net base QUIET)
endif(APPLE)
find_package(wxWidgets COMPONENTS gl adv html core net base QUIET)
endif(APPLE)
else( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
find_package(wxWidgets COMPONENTS gl adv html core net base QUIET)
endif( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )

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,25 +59,36 @@ from folks with less than that minimum.
PCBNew
------
* 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.
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.
* Fix block copy/move preview to not view only a border, we should
see the moved/copied parts.
* Fix block copy/move preview to not view only a border, we should
see the moved/copied parts.
* Fix DIALOG_PAD_PROPERTIES_BASE class to use actual layer names in the BOARD.
* Fix DIALOG_PAD_PROPERTIES_BASE class to use actual layer names in the BOARD.
* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
* Document specctra round tripper, and fix the english translation of help.
* Add ARC support to gerber polygons.
* Need to add polygon aperture type.
Then example 2 in RS274xrevd_e.pdf will draw properly.
* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
* Document specctra round tripper, and fix the english translation of help.
* Add ARC support to gerber polygons.
* 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:
* Get the nested quote support for DSNLEXER fixed up and committed.
* Get the nested quote support for DSNLEXER fixed up and committed.
LAYER_WIDGET for PCBNEW
@ -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;
@ -410,7 +460,7 @@ int BOARD::GetVisibleElementColor( int aPCB_VISIBLE )
case VIA_THROUGH_VISIBLE: color = g_ModuleTextCUColor; break;
case MOD_TEXT_FR_VISIBLE: color = g_ModuleTextCUColor; break;
case MOD_TEXT_BK_VISIBLE: color = g_ModuleTextCUColor; break;
case MOD_TEXT_INVISIBLE: color = g_ModuleTextNOVColor; break;
case MOD_TEXT_INVISIBLE: color = g_ModuleTextNOVColor; break;
case ANCHOR_VISIBLE: color = g_AnchorColor; break;
case PAD_FR_VISIBLE: color = g_PadCMPColor; break;
case PAD_BK_VISIBLE: color = g_PadCUColor; break;
@ -434,8 +484,8 @@ void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor )
case VIA_BBLIND_VISIBLE: m_BoardSettings->m_ViaColor[VIA_BLIND_BURIED] = aColor; break;
case VIA_THROUGH_VISIBLE: g_ModuleTextCUColor = aColor; break;
case MOD_TEXT_FR_VISIBLE: g_ModuleTextCUColor = aColor; break;
case MOD_TEXT_BK_VISIBLE: g_ModuleTextCUColor = aColor; break;
case MOD_TEXT_INVISIBLE: g_ModuleTextNOVColor = aColor; break;
case MOD_TEXT_BK_VISIBLE: g_ModuleTextCUColor = aColor; break;
case MOD_TEXT_INVISIBLE: g_ModuleTextNOVColor = aColor; break;
case ANCHOR_VISIBLE: g_AnchorColor = aColor; break;
case PAD_FR_VISIBLE: g_PadCMPColor = aColor; break;
case PAD_BK_VISIBLE: g_PadCUColor = aColor; break;

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();