statusbaru.cpp
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:4k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "statusbaru.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "fcButton"
  8. #pragma link "fcButtonGroup"
  9. #pragma link "fcClearPanel"
  10. #pragma link "fcDemoRichEdit"
  11. #pragma link "fcImgBtn"
  12. #pragma link "fcLabel"
  13. #pragma link "fcStatusBar"
  14. #pragma link "CGAUGES"
  15. #pragma resource "*.dfm"
  16. TStatusBarDemoForm *StatusBarDemoForm;
  17. //---------------------------------------------------------------------------
  18. __fastcall TStatusBarDemoForm::TStatusBarDemoForm(TComponent* Owner)
  19.         : TForm(Owner)
  20. {
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TStatusBarDemoForm::fcButtonGroup1Change(
  24.       TfcCustomButtonGroup *ButtonGroup, TfcButtonGroupItem *OldSelected,
  25.       TfcButtonGroupItem *Selected)
  26. {
  27.   if (OldSelected->Button != NULL)
  28.       OldSelected->Button->Font->Color = clBlack;
  29.   Selected->Button->Font->Color = clRed;
  30.   PageControl1->ActivePage =
  31.      ((TTabSheet *)FindComponent("TabSheet"+IntToStr(Selected->Button->Tag)));
  32. }
  33. //---------------------------------------------------------------------------
  34. void __fastcall TStatusBarDemoForm::Close1Click(TObject *Sender)
  35. {
  36. Close();        
  37. }
  38. //---------------------------------------------------------------------------
  39. void __fastcall TStatusBarDemoForm::fcLabel1Click(TObject *Sender)
  40. {
  41.  ShellExecute(Handle, "OPEN",
  42.    PChar("https://www.he.net/cgi-bin/suid/~wol2wol/ordering/order.cgi"), 0, 0, SW_SHOWNORMAL);
  43. }
  44. //---------------------------------------------------------------------------
  45. void __fastcall TStatusBarDemoForm::fcLabel1MouseEnter(TObject *Sender)
  46. {
  47.   ((TfcLabel *)Sender)->Font->Color = clBlue;        
  48. }
  49. //---------------------------------------------------------------------------
  50. void __fastcall TStatusBarDemoForm::fcLabel1MouseLeave(TObject *Sender)
  51. {
  52.   ((TfcLabel *)Sender)->Font->Color = clBlack;        
  53. }
  54. //---------------------------------------------------------------------------
  55. void __fastcall TStatusBarDemoForm::fcStatusBar7Panels0DrawText(
  56.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  57. {
  58.   Text = "Current Line is: "+IntToStr(Panel->Row+1);        
  59. }
  60. //---------------------------------------------------------------------------
  61. void __fastcall TStatusBarDemoForm::fcStatusBar7Panels1DrawText(
  62.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  63. {
  64.   Text = "Current Column is: "+IntToStr(Panel->Col);        
  65. }
  66. //---------------------------------------------------------------------------
  67. void __fastcall TStatusBarDemoForm::fcStatusBar7Panels3DrawText(
  68.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  69. {
  70.   Text = "("+IntToStr(Panel->Row+1)+","+IntToStr(Panel->Col)+")";
  71. }
  72. //---------------------------------------------------------------------------
  73. void __fastcall TStatusBarDemoForm::fcStatusBar4Panels0DrawText(
  74.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  75. {
  76.  Text = "Computer Name: "+Text;
  77. }
  78. //---------------------------------------------------------------------------
  79. void __fastcall TStatusBarDemoForm::fcStatusBar4Panels1DrawText(
  80.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  81. {
  82.  Text = "User Name: "+Text;
  83. }
  84. //---------------------------------------------------------------------------
  85. void __fastcall TStatusBarDemoForm::fcStatusBar3Panels3DrawText(
  86.       TfcStatusPanel *Panel, AnsiString &Text, bool &Enabled)
  87. {
  88.   Text = FormatDateTime("dddddd",Date());        
  89. }
  90. //---------------------------------------------------------------------------
  91. void __fastcall TStatusBarDemoForm::Timer1Timer(TObject *Sender)
  92. {
  93.  ProgressBar1->StepIt();        
  94. }
  95. //---------------------------------------------------------------------------
  96. void __fastcall TStatusBarDemoForm::FormActivate(TObject *Sender)
  97. {
  98.  Animate1->Active = True;        
  99. }
  100. //---------------------------------------------------------------------------
  101. void __fastcall TStatusBarDemoForm::FormClose(TObject *Sender,
  102.       TCloseAction &Action)
  103. {
  104.  Animate1->Active = False;        
  105. }
  106. //---------------------------------------------------------------------------
  107. void __fastcall TStatusBarDemoForm::Control1Click(TObject *Sender)
  108. {
  109.   fcButtonGroup1->ButtonItems->Items[((TMenuItem *)Sender)->Tag]->Button->Down = True;
  110. }
  111. //---------------------------------------------------------------------------