[go: up one dir, main page]

Menu

[r505]: / trunk / hor_combobox.pas  Maximize  Restore  History

Download this file

94 lines (71 with data), 2.2 kB

 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
{
Health Organizer (http://sourceforge.net/projects/hor/,
http://hor.sourceforge.net/)
Copyright (C) 2014-2024 Andrea Urbani ( matfanjol@mail.com )
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
}
unit hor_combobox;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, db, sqldb, FileUtil, Forms, Controls, Graphics, Dialogs,
DbCtrls, StdCtrls, Buttons, hor_base;
type
{ TfrmComboBox }
TfrmComboBox = class(TFrmBase)
bbtnAdd: TBitBtn;
btnOk: TButton;
btnCancel: TButton;
dsList: TDataSource;
dlCombobox: TDBLookupComboBox;
lblTitle: TLabel;
qList: TSQLQuery;
procedure btnOkClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
frmComboBox: TfrmComboBox;
implementation
{$R *.lfm}
{ TfrmComboBox }
Uses hor_messages;
procedure TfrmComboBox.btnOkClick(Sender: TObject);
begin
if ( dlCombobox.Text = '' ) then
begin
MessageDlg( rsMsgError, rsMsgSelectAvalue, mtError, [ mbOk ], 0 );
ModalResult:=mrNone;
Abort;
end;
end;
procedure TfrmComboBox.FormClose(Sender: TObject; var CloseAction: TCloseAction
);
begin
inherited;
CloseAction := caHide;
end;
procedure TfrmComboBox.FormCreate(Sender: TObject);
begin
inherited;
end;
procedure TfrmComboBox.FormShow(Sender: TObject);
begin
inherited;
qList.Open;
end;
end.