summaryrefslogtreecommitdiff
path: root/docview/src/frm_note.pas
blob: 310cc2520784c2e26c9f6f8588fdc8e0cef7e402 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
unit frm_note;

{$mode objfpc}{$H+}

interface

uses
  SysUtils,
  Classes,
  fpg_base,
  fpg_main,
  fpg_form,
  fpg_memo,
  fpg_button;

type

  TNoteForm = class(TfpgForm)
  private
    {@VFD_HEAD_BEGIN: NoteForm}
    Memo1: TfpgMemo;
    btnOK: TfpgButton;
    btnHelp: TfpgButton;
    btnCancel: TfpgButton;
    btnDelete: TfpgButton;
    {@VFD_HEAD_END: NoteForm}
    FCanDelete: Boolean;
    procedure   FormShow(Sender: TObject);
    function    GetText: TfpgString;
    procedure   SetText(const AValue: TfpgString);
    procedure   SetCanDelete(const AValue: boolean);
    procedure   btnHelpClicked(Sender: TObject);
  public
    procedure   AfterCreate; override;
    property    Text: TfpgString read GetText write SetText;
    property    CanDelete: boolean read FCanDelete write SetCanDelete;
  end;

{@VFD_NEWFORM_DECL}

implementation

{@VFD_NEWFORM_IMPL}

procedure TNoteForm.FormShow(Sender: TObject);
begin
  Memo1.SetFocus;
end;

function TNoteForm.GetText: TfpgString;
begin
  Result := Memo1.Text;
end;

procedure TNoteForm.SetText(const AValue: TfpgString);
begin
  Memo1.Text := AValue;
end;

procedure TNoteForm.SetCanDelete(const AValue: boolean);
begin
  FCanDelete := AValue;
  btnDelete.Enabled := FCanDelete;
end;

procedure TNoteForm.btnHelpClicked(Sender: TObject);
begin
  InvokeHelp;
end;

procedure TNoteForm.AfterCreate;
begin
  {%region 'Auto-generated GUI code' -fold}
  {@VFD_BODY_BEGIN: NoteForm}
  Name := 'NoteForm';
  SetPosition(349, 186, 420, 191);
  WindowTitle := 'Notes';
  Hint := '';
  OnShow := @FormShow;
  HelpType := htContext;
  HelpContext := 7;

  Memo1 := TfpgMemo.Create(self);
  with Memo1 do
  begin
    Name := 'Memo1';
    SetPosition(4, 4, 412, 149);
    Anchors := [anLeft,anRight,anTop,anBottom];
    FontDesc := '#Edit1';
    Hint := '';
    TabOrder := 1;
  end;

  btnOK := TfpgButton.Create(self);
  with btnOK do
  begin
    Name := 'btnOK';
    SetPosition(252, 161, 80, 24);
    Anchors := [anRight,anBottom];
    Text := 'OK';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    ModalResult := mrOK;
    TabOrder := 2;
  end;

  btnHelp := TfpgButton.Create(self);
  with btnHelp do
  begin
    Name := 'btnHelp';
    SetPosition(4, 161, 80, 24);
    Anchors := [anLeft,anBottom];
    Text := 'Help';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    TabOrder := 3;
    OnClick := @btnHelpClicked;
  end;

  btnCancel := TfpgButton.Create(self);
  with btnCancel do
  begin
    Name := 'btnCancel';
    SetPosition(336, 161, 80, 24);
    Anchors := [anRight,anBottom];
    Text := 'Cancel';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    ModalResult := mrCancel;
    TabOrder := 4;
  end;

  btnDelete := TfpgButton.Create(self);
  with btnDelete do
  begin
    Name := 'btnDelete';
    SetPosition(92, 161, 80, 24);
    Anchors := [anLeft,anBottom];
    Text := 'Delete';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    ModalResult := mrAbort;
    TabOrder := 5;
  end;

  {@VFD_BODY_END: NoteForm}
  {%endregion}
end;


end.