summaryrefslogtreecommitdiff
path: root/extras/tiopf/demos/Common/Model_View.pas
blob: ceac389f163bbdb4af88f4b6ab282bebddafa898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
unit Model_View;

{$IFDEF FPC}
  {$mode objfpc}{$H+}
{$ENDIF}

interface

uses
  Classes
  ,tiMediators
  ;

type
  { TMemo - Name }
  TPerson_Name_Memo_Mediator = class(TtiMemoMediatorView)
  protected
    procedure SetupGUIandObject; override;
  end;
  

implementation

uses
  Model, tiBaseMediator;
  
  
procedure RegisterMediators;
begin
  // Fallbacks (generic)
  RegisterFallBackMediators;

  // Specific
  gMediatorManager.RegisterMediator(TPerson_Name_Memo_Mediator, TPerson, 'Name');
end;


{ TPerson_Name_Memo_Mediator }

procedure TPerson_Name_Memo_Mediator.SetupGUIandObject;
begin
  inherited SetupGUIandObject;
  View.Enabled := False; // fpGUI doesn't have a ReadOnly property yet
end;


initialization
  { Register all your Mediator Views here }
  RegisterMediators;
  
end.