-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUnitPinMode.pas
60 lines (48 loc) · 1.45 KB
/
UnitPinMode.pas
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
unit UnitPinMode;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, ValEdit, Buttons;
type
TconfigForm = class(TForm)
ValueListEditor1: TValueListEditor;
OKConfigBtn: TBitBtn;
procedure OKConfigBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
configForm: TconfigForm;
implementation
{$R *.dfm}
procedure TconfigForm.OKConfigBtnClick(Sender: TObject);
begin
configForm.Visible:=false
end;
procedure TconfigForm.FormCreate(Sender: TObject);
var i:0..13;
ItensList, ItensList2:TStrings;
begin
ItensList:=TStringList.Create; ItensList2:=TStringList.Create;
ItensList.Text:='entrada digital'+chr(13)+'saída digital';
ItensList2.Text:='entrada digital'+chr(13)+'saída digital'+chr(13)+'saída PWM';
with ValueListEditor1 do
begin
for i:=0 to 13 do
begin
InsertRow('pin '+chr($20+$11*(i div 10))+chr($30+i mod 10),'',true);
ItemProps[i].ReadOnly:=true;
if i>1 then ItemProps[i].EditStyle:=esPickList;
case i of
2,4,7,8,12,13: ItemProps[i].PickList:=ItensList;
3,5,6,9,10,11: ItemProps[i].PickList:=ItensList2;
end;
end;
Cells[1,1]:='Rx'; Cells[1,2]:='Tx';
end;
ItensList.Free; ItensList2.Free
end;
end.