⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 condlist.pas

📁 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
💻 PAS
字号:
unit CondList;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TfrmConds = class(TForm)
    Label1: TLabel;
    lstCond0: TListBox;
    Label2: TLabel;
    lstCond1: TListBox;
    Label3: TLabel;
    lstCond2: TListBox;
    Label4: TLabel;
    lstCond3: TListBox;
    Label5: TLabel;
    lstCond4: TListBox;
    Label6: TLabel;
    lstCond5: TListBox;
    Label7: TLabel;
    lstCond6: TListBox;
    Label8: TLabel;
    lstCond7: TListBox;
    Label9: TLabel;
    lstCond8: TListBox;
    Label10: TLabel;
    lstCond9: TListBox;
    Label11: TLabel;
    lstCond10: TListBox;
    Label12: TLabel;
    lstCond11: TListBox;
    Label13: TLabel;
    lstCond12: TListBox;
    Label14: TLabel;
    lstCond13: TListBox;
    Label15: TLabel;
    lstCond14: TListBox;
    Label16: TLabel;
    lstCond15: TListBox;
    butCancel: TButton;
    butOk: TButton;
    procedure FormCreate(Sender: TObject);
    procedure butOkClick(Sender: TObject);
    procedure butCancelClick(Sender: TObject);

    Function EnableSelection( iStart : integer; iStop : integer;
                              bEnable : boolean) : integer;

  private
    { Private declarations }
  public
    { Public declarations }
    glstCond  : array [0..15] of ^TListBox;
    gbOkPushed : Boolean;      {Does press th OK button}

  end;

var
  frmConds: TfrmConds;

implementation

{$R *.DFM}
{******************************************************************************
 * Function : Enable/disable the Condition List.
 * Paramater: iStar, input, start working channel. start from 0
 *            iStop, input, stop active channel(included). between 0 to 15.
 *            bEnable, input, Enable or disable the List.
 * retunrn:   Count of action list
 ******************************************************************************}
Function TfrmConds.EnableSelection( iStart : integer;
                                    iStop : integer;
                                    bEnable : boolean ) : integer;
var
  i : integer;
begin
  if iStop > 15 then iStop := 15;
  i := 0;

  while iStart <= iStop do
  begin
    glstCond[iStart]^.Enabled := bEnable;
    iStart := iStart + 1;
    i := i + 1;
  end;
  EnableSelection := i;
end;


procedure TfrmConds.FormCreate(Sender: TObject);
begin
  {Setting the condition list}
  glstCond[0]  := @lstCond0;
  glstCond[1]  := @lstCond1;
  glstCond[2]  := @lstCond2;
  glstCond[3]  := @lstCond3;
  glstCond[4]  := @lstCond4;
  glstCond[5]  := @lstCond5;
  glstCond[6]  := @lstCond6;
  glstCond[7]  := @lstCond7;
  glstCond[8]  := @lstCond8;
  glstCond[9]  := @lstCond9;
  glstCond[10] := @lstCond10;
  glstCond[11] := @lstCond11;
  glstCond[12] := @lstCond12;
  glstCond[13] := @lstCond13;
  glstCond[14] := @lstCond14;
  glstCond[15] := @lstCond15;
end;

procedure TfrmConds.butOkClick(Sender: TObject);
begin
  gbOkPushed := True;
  close;
end;

procedure TfrmConds.butCancelClick(Sender: TObject);
begin
  gbOkPushed := False;
  close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -