Re: Non-modal dialogs. They work!


Subject: Re: Non-modal dialogs. They work!
From: Mike Nordell (tamlin@algonet.se)
Date: Thu May 11 2000 - 04:37:25 CDT


> Sorry can't contain myself. I just implemented a simple framework for
> non-modal dialogs, tested it with "insert Symbol" and it works! Yay!

Way to go!

> I remember frames rather than views for robustness reasons.

Good. Views can change within a frame, and hanging on to dangling
pointers "ain't no fun at all". "Been there, done that, and it wasn't a
pretty sight" :-)

> The next thing to do is to put in code to check to see if a dialog is
> currently running. These will be recorded in xap_App as a hash table
based
> on the dialog id.

Do you really think we're gonna have that many dialogs open at the same
time that it's worth a hash-map? :-)
I think a simple list with id, ptr pairs would do nicely. But it's a good
idea to base it on the dialog id.

With this kind of new approach, maybe it's better to redesign a bit to
let all non-modal dialogs have protected or private constructors, and
only allow them to be created from a factory. In that case, this new
dialog-activation-if-possible-else-creation-class could inherit the
dialog-creation-factory and override its public virtual createDialog
method. It could then check its internal map if the dialog exists and in
that case activate it, or else call the factory class' protected function
_createDialog to create it. This class of course have to be owned by
XAP_App (singleton).

Just an idea that struck me.

While at it, should we have two dialog baseclasses, one that is modal and
one that is non-modal, or should we have one baseclass that supports both
modal and non-modal dialogs?

Just my $0.02.
/Mike - please reply to AbiWord-dev only



This archive was generated by hypermail 2b25 : Thu May 11 2000 - 03:37:04 CDT