← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH/RFC] Transfer user settings to child frames

 

On 12/6/2014 4:29 PM, John Beard wrote:
> Attached is a patch to import settings from a parent frame to child
> frames. This is in response to a bug reported in IRC that the
> warp-on-zoom behaviour in pcbnew was not being transferred to modedit.
> 
> This patch provides a generic way of importing settings from a wxWindow
> parent in impure virtual EDA_BASE_FRAME::ImportFrameSettings() method.
> EDA_BASE_FRAME derivatives can then override this to import settings
> that they know about from the parent frame.
> 
> This also fixes the issue in other EDA_DRAW_FRAME children, such as the
> module browser in pcbnew and the symbol browser in eeschema.
> 
> I have added an overridden method like this for EDA_DRAW_FRAME, which
> transfers the settings GetEnableZoomNoCenter, GetMiddleButtonPanLimited,
> GetEnableAutoPan and GetEnableMiddleButtonPan.
> 
> This method is then called from KIWAY::Player(), on creation. However, I
> am not sure when best to send settings changes when the child frame
> exists already - should this be push out to child frames whenever
> settings are changed, in order to maintain consistency between a parent
> and the children? At the moment, you have to close the child and re-open
> to get the changes. Adding the call to ImportFrameSettings() in the
> Player() function also for no-create calls won't help if the user
> Alt-Tabs to the other window rather than requesting it via KiWay.

I think you should update any of the child windows setting when settings
that effect all children are changed.  I'm not sure the best way do this
as I didn't write the kiway code.  It should not be too difficult since
most of kicad runs in a single process.

> 
> Incidentally, I changed EDA_DRAW_PANEL::GetCanvas() to be a const
> method, because as a getter method, it should not be able to change the
> object.
> 
> Cheers,
> 
> John
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 



References