home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 March / Chip_1999-03_cd.bin / zkuste / delphi / INFO / DI9806FN.ZIP / source / prjid_lb.pas < prev    next >
Pascal/Delphi Source File  |  1998-02-11  |  974b  |  47 lines

  1. unit PrjID_LB;
  2.  
  3. interface
  4.  
  5. uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  6.   Buttons, ExtCtrls;
  7.  
  8. type
  9.     TSelectIdentifierDlg = class(TForm)
  10.     CDK_Container1: TPanel;
  11.     ListBox1: TListBox;
  12.     BitBtn1: TBitBtn;
  13.     BitBtn2: TBitBtn;
  14.     Label1: TLabel;
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.     function Execute(var SelectedItem : string;
  20.           TempStrings : TStringList): boolean;
  21.   end;
  22.  
  23. var
  24.   SelectIdentifierDlg: TSelectIdentifierDlg;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29. function TSelectIdentifierDlg.Execute(var SelectedItem : string;
  30.           TempStrings : TStringList): boolean;
  31. begin
  32.  
  33. ListBox1.Clear;
  34. ListBox1.Items.Assign(TempStrings);
  35. SelectedItem := '';
  36. ShowModal;
  37. if ModalResult=mrOK then
  38.   begin
  39.     if ListBox1.ItemIndex>=0 then
  40.        SelectedItem := ListBox1.Items[ListBox1.ItemIndex];
  41.     Result := true;
  42.     end
  43.   else
  44.     result := False;
  45. end;
  46. end.
  47.