| Prev | Next
Menu: Products - Portfolio - Services - Download - Order - Company

 
Topic #1.1.1.1.1.
Part II
   Definition  
   AppOnUpdate  
*

  

Browsing >>AppOnUpdate

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;


 
Path:  www.href.com to; Services to; Tech Talk Archive to; PanelWare to; Part II to; AppOnUpdate

Copyright © 1995-2012 HREF Tools Corp. All Rights Reserved Worldwide.
Running: WebHub-v2.167 compiled with d16_win32 on Microsoft-IIS/7.5,
Local Time: Wed, 23 May 2012 22:41:17.
Session 452429792, 41 pages sent to CCBot/1.0 (+http://www.commoncrawl.org/bot.html) at 38.107.179.226;
Time to produce this page: 0msec.