Changeset 52 for trunk/Modules


Ignore:
Timestamp:
May 1, 2011, 12:20:19 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Stránky přepracovány z metod na komponenty.
Location:
trunk/Modules
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/UMainModule.pas

    r51 r52  
    1414  TMainModule = class;
    1515
    16   TPageProducer = procedure(App: TMainModule; HandlerData: THTTPHandlerData);
    17 
    1816  TRegistredPage = class
    1917    Name: string;
    20     Producer: TPageProducer;
     18    Page: TWebPage;
    2119  end;
    2220
     
    6058    constructor Create(AOwner: TComponent); override;
    6159    destructor Destroy; override;
    62     procedure RegisterPage(Name: string; Producer: TPageProducer);
     60    procedure RegisterPage(Name: string; Page: TWebPage);
    6361  end;
    6462
     
    116114      HtmlDocument.Body.SubItems.Add(TitleTag);
    117115      TopMenu;
    118       Page.Producer(Self, HandlerData);
     116      Page.Page.OnProduce(HandlerData);
     117      HtmlDocument.Title := Page.Page.Caption;
    119118      TitleTag.Text := '<div class="TitlePanel"><span class="GlobalTitle">' + GlobalTitle +
    120119        '</span> - ' + HtmlDocument.Title + '</div>';
     
    131130end;
    132131
    133 procedure TMainModule.RegisterPage(Name: string; Producer: TPageProducer);
     132procedure TMainModule.RegisterPage(Name: string; Page: TWebPage);
    134133var
    135134  NewRegistredPage: TRegistredPage;
     
    137136  NewRegistredPage := TRegistredPage.Create;
    138137  NewRegistredPage.Name := Name;
    139   NewRegistredPage.Producer := Producer;
     138  NewRegistredPage.Page := Page;
    140139  Pages.Add(NewRegistredPage);
    141140end;
Note: See TracChangeset for help on using the changeset viewer.