[Lazarus] MessageDlg() return type
Graeme Geldenhuys
graeme at geldenhuys.co.uk
Wed Sep 12 17:31:04 CEST 2012
On 12/09/12 16:09, Giuliano Colla wrote:
> mrAbort is a modal result which may derive from a dialog, but also from
> a custom modal form. It has nothing to do with mbAbort, which is a just
I don't know, from a developer point of those, those two seem to be a
lot related (or maybe that's just me).
> I believe that this has to do with Delphi compatibility, but it makes
> sense nonetheless.
I don't know, it all sounds pretty confusing to me! :)
Anyway... looking deeper into the widgetset implementations, it seems
internally TWidgetset.PromptUser must return a idButtonXXX type - yet
another type (plus more confusion)! Then later idButtonXXX gets
converted somewhere to a TModalResult (I think). So why couldn't
TWidgetset.PromptUser not simply return a TModalResult in the first place??
And to implement LCL-fpGUI's PromtUser() support, a mbHelp button click
must return a idButtonHelp, which then later gets translated to mrNone
(as far as I can see). The LCL-fpGUI's return results now finally seem
consistent with LCL-GTK2's implementation.
Simply defining two types (buttons and modal results with logical
mapping between them) and being consistent with those types throughout
the LCL would have been a MUCH CLEANER implementation than the mess I
currently see.
Anyway, I think I figure all this return types out now - using lots and
lots of trial and error.
Regards,
- Graeme -
More information about the Lazarus
mailing list