← Back to team overview

kicad-developers team mailing list archive

About ayer widget

 

Dick,
In my last commit, i wrote PCB_LAYER_WIDGET::RenderSynchronize( ) to update the check boxes state in the layer manager when an item visibility is changed outside the layer manager (from the left toolbar for instance, or some hot keys) I do not like the code I wrote, because i can be easily broken if the layer manager is modified.
But Checkboxes can be updated without calling Refill() that creates flicker.
The main problem I found is the fact it is not easy to reach the check boxes in the layer manager because the pointer to these check boxes exist only in sizers.

Because it could be interesting to update more easily these check boxes with very few new code, i believe an easy way to do that it to set (for check boxes we want to update) a wxValidator, and just call TransferDataToWindow to update all checkboxes

from PCB_LAYER_WIDGET class, the requirement is just use bools (and not a mask) to handle items visibility, but it should not be a problem.

Inside layer_widget the changes are small :
void AppendRenderRow and AppendLayerRow could return a pointer to the corresponding checkbox,
and AppendLayerRows and AppendRenderRows an array of pointers.
PCB_LAYER_WIDGET functions could set a wxValidator for check boxes (or store the list of checkboxes, if we do not use validators)

Inside the EDA_BoardDesignSettings class, use an array of bools to handle enabled and visible layers and items
but they are not directly acceded, so the cost is small.

I never used validators and TransferDataToWindow , so I like to know your thoughts about this.

--
Jean-Pierre CHARRAS

Maître de conférences
Directeur d'études 2ieme année.
Génie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex

Recherche :
GIPSA-LAB - INPG
Rue de la Houille Blanche
38400 Saint Martin d'Heres









Follow ups

References