www.pudn.com > d4psp31.zip > fmPatchDetails.pas, change:1998-11-03,size:1612b


unit fmPatchDetails; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
  StdCtrls, Buttons, ComCtrls, cmpInstrument; 
 
type 
  TPatchDetailsForm = class(TForm) 
    btnOk: TBitBtn; 
    btnCancel: TBitBtn; 
    Label1: TLabel; 
    edBankNo: TEdit; 
    UpDown1: TUpDown; 
    Label2: TLabel; 
    edPatchNo: TEdit; 
    UpDown2: TUpDown; 
    Label3: TLabel; 
    edPatchName: TEdit; 
    Label4: TLabel; 
    edComment: TEdit; 
    GroupBox1: TGroupBox; 
    elvPatchTypes: TListView; 
    procedure FormShow(Sender: TObject); 
    procedure FormClose(Sender: TObject; var Action: TCloseAction); 
  private 
    { Private declarations } 
  public 
    SelectedPatchType : TPatchType; 
    { Public declarations } 
  end; 
 
var 
  PatchDetailsForm: TPatchDetailsForm; 
 
implementation 
 
{$R *.DFM} 
 
procedure TPatchDetailsForm.FormShow(Sender: TObject); 
var 
  PatchType : TPatchType; 
  Item : TListItem; 
begin 
  for PatchType := Low (TPatchType) to High (TpatchType) do 
  begin 
    item := elvPatchTypes.Items.Add; 
    item.ImageIndex := Ord (PatchType); 
    item.Caption := PatchTypeNames [PatchType] 
  end; 
  elvPatchTypes.Selected := elvPatchTypes.Items.Item [Ord (SelectedPatchType)]; 
  elvPatchTypes.ScrollBy (0, 100); 
end;                     
                    
procedure TPatchDetailsForm.FormClose(Sender: TObject; 
  var Action: TCloseAction); 
begin 
  if Assigned (elvPatchTypes.Selected) then 
    SelectedPatchType := TPatchType (elvPatchTypes.Selected.Index) 
  else 
    SelectedPatchType := Low (TPatchType); 
end; 
 
end.