home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / delphi / dnarrays.lzh / ARRTEST8.PAS < prev    next >
Pascal/Delphi Source File  |  1995-06-04  |  1KB  |  51 lines

  1. unit Arrtest8;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TEnlargedViewDlg = class(TForm)
  11.     LstView: TListBox;
  12.     BtnClose: TButton;
  13.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  14.     procedure BtnCloseClick(Sender: TObject);
  15.     procedure FormResize(Sender: TObject);
  16.   private
  17.     { Private-Deklarationen }
  18.   public
  19.     { Public-Deklarationen }
  20.   end;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TEnlargedViewDlg.FormClose(Sender: TObject;
  27.   var Action: TCloseAction);
  28. begin
  29.   Action := caFree;
  30. end;
  31.  
  32. procedure TEnlargedViewDlg.BtnCloseClick(Sender: TObject);
  33. begin
  34.   Close;
  35. end;
  36.  
  37. procedure TEnlargedViewDlg.FormResize(Sender: TObject);
  38. Var
  39.   dy: Integer;
  40. begin
  41.   (* size the listbox so that it fills the client area with the exception
  42.      of an area at the bottom that has double the height of the button.
  43.      The button is centered in this space *)
  44.   dy := (3 * BtnClose.Height) shr 1;
  45.   LstView.Height := ClientHeight-dy;
  46.   BtnClose.Left := (ClientWidth - BtnClose.Width) shr 1;
  47.   Btnclose.Top  := ClientHeight - dy + BtnClose.Height shr 2 ;
  48. end;
  49.  
  50. end.
  51.