htWebApp.pas
The TwhApplication component defines procedures which let you
easily add event handlers for OnUpdate, OnUnUpdate, OnExecute,
OnAfterExecute and OnWebEvent.
{ from htWebApp.pas }
procedure AddAppUpdateHandler(Event: TNotifyEvent);
procedure AddAppUnUpdateHandler(Event: TNotifyEvent);
procedure AddAppExecuteHandler(Event: TWebAppExecuteNotify);
procedure AddAppAfterExecuteHandler(Event: TWebAppExecuteNotify); // bug fixed in v1.680
procedure AddAppEventMacroHandler(Event: TOnWebEventMacro);
whMail.pas
The Mail panel needs to run some code to refresh the information
in the grid relating to the TwhMailForm whenever the application
object refreshes. So it adds its own WebAppUpdate method to the
list of event handlers for the app.
{ from whMail.pas }
type
TfmWebMail = class(TutParentForm)
...
private
procedure WebAppUpdate(Sender: TObject);
...
function TfmWebMail.Init:Boolean;
begin
result:=inherited init;
if not result then
exit;
if not assigned(WebMailForm.WebApp) then
WebMailForm.WebApp:=pWebApp;
with WebMailform do
if not isUpdated then
Refresh;
if assigned(pWebApp) then
AddAppUpdateHandler(WebAppUpdate);
end;
...
procedure TfmWebMail.WebAppUpdate(Sender: TObject);
begin
TextGridRefresh;
end;