← Back to team overview

kicad-developers team mailing list archive

Re: KIWAY milestone A)

 

On 03/20/2014 02:27 AM, Lorenzo Marcantonio wrote:
> On Thu, Mar 20, 2014 at 01:58:54AM -0500, Dick Hollenbeck wrote:
>> I suggest you run using the Debug build for awhile.  This is necessary to smoke out any
>> dialogs which are not derived from DIALOG_SHIM.  There still could be some, and Debug
>> build will find them.  Otherwise there Kiway() window function will return NULL and you'll
>> get a crash.  wxformbuilder can be used to stuff DIALOG_SHIM under any dialog windows that
>> turn up this way.
> 
> Question: what does kiway have to do with the dialog shim?

KIWAY_HOLDER

It is held by either:

a) KIWAY_PLAYER for wxFrames, or
b) DIALOG_SHIM for wxDialogs

It is used to pass the notion of the "current KIWAY" down the instantiation wxWindow tree,
at least to wxDialogs and wxFrames, not wxWidgets.

You must bring back in DIALOG_SHIM [and conditionally compile the window coordinate
retention,] and keep the KIWAY_HOLDER support in your branch.


> I pulled out
> the shim in my build (since using regularly with different monitor sets
> it's really annoying) so I would be nice to know consequences :P


The tale of two trees:


1))))))))))))))))))))))))
There is a class inheritance tree, see this page in the "doxygen-docs" CMake target:

  Documentation/doxygen/html/classEDA__BASE__FRAME.html


with your browser, for wxFrame derivatives.  View the graphical inheritance diagram in
there.  *Note that KICAD_MANAGER frame is not a derivative of KIWAY_PLAYER.*  Instead it
is a *holder* of a KIWAY, rather than a holder of a pointer to one (a KIWAY_PLAYER).



2))))))))))))))))))))))))
There is also an instantiation tree.  The instantiation tree has major branches, with the
anchor of each major branch (a top KIWAY_PLAYER at some point) pertaining to a particular
KIWAY, which is tantamount to being pertinent to a particular PROJECT.  All child
wxDialogs and all wxFrames of this top KIWAY_PLAYER point to the same KIWAY/PROJECT.

Multiple KIWAY/PROJECTs exist for milestone C), until then only one exists.

The instantiation tree passes the KIWAY pointer down using the KIWAY_HOLDER logic, and it
is like mitochondrial DNA, which is inherited from the mother.



> 
> BTW I ripped out the main window sizing too, for the same exact
> reason...

Your "reason" is not my reason.  If you want tuning knobs for wxFrame saving OR NOT, put
them in EDA_BASE_FRAME, this is a totally different subject.

> 
> *Why* there is a need to save these things? shouldn't that be a window
> manager issue?

See my last paragraph.  Seems all your problems can be solved by conditionally compiling
portions of EDA_BASE_FRAME::SaveSettings()/LoadSettings().

That is a separate subject however, not pertaining to the KIWAY DNA which is managed bt
other facilities of KIWAY_HOLDER, KIWAY_PLAYER, and DIALOG_SHIM.








Follow ups

References