home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 January / Chip_1999-01_cd.bin / zkuste / delphi / QDB / VANIMALS.ZIP / ani_main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-06-28  |  3.6 KB  |  93 lines

  1.  
  2. {*****************************************************************************}
  3. {                                                                             }
  4. {                            Animals Demo                                     }
  5. {                                                                             }
  6. {                     illustrating the use of the                             }
  7. {                                                                             }
  8. {            QDB v2.10 Visual Components for Delphi 1, 2, & 3                 }
  9. {                                                                             }
  10. {       Copyright (c) 1995, 1996, 1997, 1998, Robert R. Marsh, S.J.           }
  11. {             & the British Province of the Society of Jesus                  }
  12. {                                                                             }
  13. {                                                                             }
  14. {       You may use this demonstration application and modify it in           }
  15. {       whatever way you choose. You may not, however, sell it for            }
  16. {       profit unless the changes you have made are substantial (i.e.,        }
  17. {       more than 50% new code), in which case I'd appreciate                 }
  18. {       receiving a copy of your new work.                                    }
  19. {                                                                             }
  20. {       If you like Animals and find yourself using it please                 }
  21. {       consider making a donation to your favorite charity.                  }
  22. {                                                                             }
  23. {    Users of Animals must accept the following disclaimer of warranty:       }
  24. {                                                                             }
  25. {       Animals is supplied as is. The author disclaims all warranties,       }
  26. {       expressed or implied, including, without limitation, the              }
  27. {       warranties of merchantability and of fitness for any purpose.         }
  28. {       The author assumes no liability for damages, direct or                }
  29. {       consequential, which may result from the use of Animals.              }
  30. {                                                                             }
  31. {*****************************************************************************}
  32.  
  33. unit ani_main;
  34.  
  35. interface
  36.  
  37. uses
  38.   SysUtils, WinTypes, WinProcs, Graphics, Forms, Classes, StdCtrls, Buttons,
  39.   ExtCtrls, Controls, QDB, QDBView;
  40.  
  41. type
  42.   Tani_form = class(TForm)
  43.     Panel1: TPanel;
  44.     BitBtn1: TBitBtn;
  45.     Q: TQDBView;
  46.     QP: TPanel;
  47.     Label1: TLabel;
  48.     Name: TEdit;
  49.     Label2: TLabel;
  50.     Size: TEdit;
  51.     Label3: TLabel;
  52.     Weight: TEdit;
  53.     Label4: TLabel;
  54.     Image: TImage;
  55.     Panel3: TPanel;
  56.     QN: TQDBNavigator;
  57.     Found: TEdit;
  58.     procedure FormCreate(Sender: TObject);
  59.     procedure QNavigate(Sender: TObject);
  60.     procedure FormDestroy(Sender: TObject);
  61.   private
  62.   end;
  63.  
  64. var
  65.   ani_form: Tani_form;
  66.  
  67. implementation
  68.  
  69. {$R *.DFM}
  70.  
  71. procedure Tani_form.FormCreate(Sender: TObject);
  72. begin
  73. {locate and set the QDB file}
  74. Q.FileName:=ChangeFileExt(Application.ExeName,'.qdb');
  75. {we use a cache size that will hold all the items}
  76. Q.CacheSize:=128*1024;
  77. {we want to start at the beginning}
  78. Q.FirstItem;
  79. end;
  80.  
  81. {every time we move through the database we do this ...}
  82. procedure Tani_form.QNavigate(Sender: TObject);
  83. begin
  84. QP.Refresh;
  85. end;
  86.  
  87. procedure Tani_form.FormDestroy(Sender: TObject);
  88. begin
  89. Q.FileName:='';
  90. end;
  91.  
  92. end.
  93.