home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Examples / Controls / Tray / MAIN.CPP next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  2.2 KB  |  71 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1998 Inprise Corporation. All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "main.h"
  10. //---------------------------------------------------------------------------
  11. #pragma package(smart_init)
  12. #pragma link "TrayComp"
  13. #pragma link "CSPIN"
  14. #pragma resource "*.dfm"
  15. TForm1 *Form1;
  16. //---------------------------------------------------------------------------
  17. __fastcall TForm1::TForm1(TComponent* Owner)
  18.         : TForm(Owner)
  19. {
  20. }
  21. //---------------------------------------------------------------------------
  22. void __fastcall TForm1::HideCheckClick(TObject *Sender)
  23. {
  24.   TrayComp1->Hide = HideCheck->Checked;
  25.   Update();
  26. }
  27. //---------------------------------------------------------------------------
  28.  
  29. void __fastcall TForm1::VisibleCheckClick(TObject *Sender)
  30. {
  31.   TrayComp1->Visible = VisibleCheck->Checked;
  32.   HideCheck->Enabled = VisibleCheck->Checked;
  33.   AnimateCheck->Enabled = VisibleCheck->Checked;
  34.   Update();
  35. }
  36. //---------------------------------------------------------------------------
  37.  
  38. void __fastcall TForm1::Restore1Click(TObject *Sender)
  39. {
  40.   Application->Restore();
  41. }
  42. //---------------------------------------------------------------------------
  43.  
  44. void __fastcall TForm1::Exit1Click(TObject *Sender)
  45. {
  46.   Close();
  47. }
  48. //---------------------------------------------------------------------------
  49.  
  50. void __fastcall TForm1::AnimateCheckClick(TObject *Sender)
  51. {
  52.   TrayComp1->Animate = AnimateCheck->Checked;
  53.   if (AnimateCheck->Checked == false)
  54.     TrayComp1->IconIndex = 0;
  55.   Update();
  56. }
  57. //---------------------------------------------------------------------------
  58.  
  59.  
  60.  
  61. void __fastcall TForm1::IntervalUpDownClick(TObject *Sender,
  62.       TUDBtnType Button)
  63. {
  64.   IntervalText->Caption = AnsiString ("Interval: ") + IntToStr (IntervalUpDown->Position);
  65.   TrayComp1->Interval = IntervalUpDown->Position;
  66.   Update();
  67.         
  68. }
  69. //---------------------------------------------------------------------------
  70.  
  71.