Autore Topic: Propagazione di eventi e ShowModal.  (Letto 332 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.316
  • Ne mors quidem nos iunget
    • Mostra profilo
Propagazione di eventi e ShowModal.
« il: 28 Ottobre 2014, 02:37:12 »
Vi riporto questa discussione:


" I have a User help routine based in Key F1 keyrelease.
The code is in form FMain Form_KeyRelease() Event.
This event is nicely propagated to all forms in FMain.Controls collection
and all works fine.
Today I've noticed that doesn't work on modal forms (opened with ShowModal).

If copy/paste the FMain code to Form_KeyRelease of modal form all works
again but I thought that ShowModal it's only related with  the way that
"Visual Focus" (if such thing exists) is managed.

In ShowModal a form is non-dependant of FMain? I mean, by example: can
FMain be closed since a showmodal form?
If a showmodal form open a new form an closed himself after,  the form
created is closed too?

This are things that I could try in a moment, but I don't know if that
gives me the solution to the question:

What means, really, Showmodal?

(Perhaps 5 A.M. o'clock its not the best time to make this questions...)

Regards
Jorge
"


" 'Modal' means that the window takes all the mouse and keyboard events of
the application (it has its own event loop).

A window cannot be closed if there is a "child" modal window open. The
modal window must be closed first.

As for your history about Form_KeyRelease, I don't understand what you
are talking about. Please be more descriptive.

Regards,

--
Benoît Minisini
"


" >As for your history about Form_KeyRelease, I don't understand what you
>are talking about. Please be more descriptive.


It's simple: on fMain, the F1 key open a contextual help for the user based
on wich control has the Focus.
This event is propagated to all forms opened from fMain Menu and works fine
(you give me the clue about how this can be done a few months ago). But I
haven't noticed that it isn't propagated in Modal opened forms, so I didn't
know if that were a 3.6 issue or a expected behaviour. Your answer makes
all clear.
Thanks Benoit.

Regards
Jorge
"
« Ultima modifica: 28 Ottobre 2014, 11:41:22 da vuott »
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »