← Back to team overview

kicad-developers team mailing list archive

Re: wxAUI woes

 

Le 28/10/2017 à 04:02, hauptmech a écrit :
> On 28/10/17 01:00, Wayne Stambaugh wrote:
>>> If the pane is mandatory (no view toggle) you probably need to hard-code
>>> unhiding it after LoadPerspective to be nice to users upgrading with
>>> config files in place.
>> You will most likely have to force the change in the perspective to
>> ensure that you can unhide panes.  I would be careful about what aui
>> behavior you enable.  If I recall, detachable panes was also broken but
>> that make have been fixed.  Have you tried testing with wx 3.1?  Maybe
>> the wx project fixed some of these issues.
>>
> Internal to Aui, there is no such thing as a perspective. It's just just the name used to load and
> save all the pane (and dock) info.
> 
> It's been a long time but my recollection is that Aui worked fine once I read the [aui] code and got
> an understanding of how it was designed to be used. The written documentation was sparse and kicad
> authors had misinterpreted some of how Aui is supposed to work. EDA_PANEINFO
> (kicad/include/wxstruct.h) captured much of what I learned. My goal at the time was detachable
> panes, which worked without problem once the panes were configured properly. My patch left out the
> final setting for detachable panes because everyone was gunshy about aui at the time and it was too
> big a step.
> 

I also don't think Aui is broken, but (as you said) it suffers from a lot of missing doc, so when
something goes wrong, it is hard to know what really happens.

>From my experience:

- Load/Save perspective works fine *only* when there is no change in widgets (toolbars and their
items) because it saves/restore all setup, and this setup can create conflicts if a config has
changed after the last save.
Especially, we have issues in main toolbar of the footprint viewer because one tool (export tool)
was displayed or not.
In this case, the kicad code must handle some parameters (size for instance)
- Detachable panes seriously modify the way events are managed inside the pane, especially in modal
dialogs or wxFrames:
For instance the main toolbar of the footprint viewer can be detached.
When it is detached, it is inside something like a miniframe.
Now consider what happens in modal frames: the wxWidgets (and the initial Kicad code in ShowModal()
) disables all windows but the modal frame itself (and changes the event loop).

Therefore the "miniframe" is disabled and cannot be used.
However this is not a Aui issue.

I fixed that in kicad code by reenabling all top level windows that are child of the Kicad frame
shown in modal mode ( in fact the miniframe containing the detached pane ).
This is a kind of issue easy to fix but tricky to understand, and in this case the first idea is
often: AUI is broken.

Using detachable panes can have an interest in complex cases because when used in a miniframe, I am
thinking this miniframe (a top level frame) receive all EVT_CHAR_HOOK, and I am not sure this is the
case when the pane is not detached (is docked) because accelerator keys capture some key events.

But how EVT_CHAR_HOOK is exactly managed depend on the platform.

-- 
Jean-Pierre CHARRAS


References