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

Delphi控件源码

开发平台:

Delphi

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "shapeu.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "fcButton"
  8. #pragma link "fcDemoRichEdit"
  9. #pragma link "fcImgBtn"
  10. #pragma link "fcLabel"
  11. #pragma link "fcShapeBtn"
  12. #pragma resource "*.dfm"
  13. TShapeBtnDemoForm *ShapeBtnDemoForm;
  14. //---------------------------------------------------------------------------
  15. __fastcall TShapeBtnDemoForm::TShapeBtnDemoForm(TComponent* Owner)
  16.         : TForm(Owner)
  17. {
  18. }
  19. //---------------------------------------------------------------------------
  20. void __fastcall TShapeBtnDemoForm::RightButton1Click(TObject *Sender)
  21. {
  22.   PageControl1->ActivePage = PageControl1->FindNextPage(PageControl1->ActivePage,True,False);
  23. }
  24. //---------------------------------------------------------------------------
  25. void __fastcall TShapeBtnDemoForm::LeftButton1Click(TObject *Sender)
  26. {
  27.   PageControl1->ActivePage = PageControl1->FindNextPage(PageControl1->ActivePage,False,False);
  28. }
  29. //---------------------------------------------------------------------------
  30. void __fastcall TShapeBtnDemoForm::RadioGroup1Click(TObject *Sender)
  31. {
  32.    switch (RadioGroup1->ItemIndex) {
  33.    case 0: CustomLButton1->Orientation = soDown;
  34.            CustomLButton2->Orientation = soDown;
  35.            CustomLButton3->Orientation = soDown;
  36.            CustomArrowButton->Orientation = soDown;
  37.            CustomLButton2->Top = CustomLButton3->Top;
  38.            CustomLButton1->Top = CustomLButton3->Top;
  39.            CustomLButton2->Left = CustomLButton3->Left;
  40.            CustomLButton1->Left = CustomLButton3->Left;
  41.            break;
  42.    case 1: CustomLButton1->Orientation = soUp;
  43.            CustomLButton2->Orientation = soUp;
  44.            CustomLButton3->Orientation = soUp;
  45.            CustomArrowButton->Orientation = soUp;
  46.            CustomLButton2->Top = CustomLButton3->Top+15;
  47.            CustomLButton1->Top = CustomLButton2->Top+15;
  48.            CustomLButton2->Left = CustomLButton3->Left+15;
  49.            CustomLButton1->Left = CustomLButton2->Left+15;
  50.            break;
  51.    case 2: CustomLButton1->Orientation = soLeft;
  52.            CustomLButton2->Orientation = soLeft;
  53.            CustomLButton3->Orientation = soLeft;
  54.            CustomArrowButton->Orientation = soLeft;
  55.            CustomLButton2->Top = CustomLButton3->Top;
  56.            CustomLButton1->Top = CustomLButton3->Top;
  57.            CustomLButton2->Left = CustomLButton3->Left+15;
  58.            CustomLButton1->Left = CustomLButton2->Left+15;
  59.            break;
  60.    case 3: CustomLButton1->Orientation = soRight;
  61.            CustomLButton2->Orientation = soRight;
  62.            CustomLButton3->Orientation = soRight;
  63.            CustomArrowButton->Orientation = soRight;
  64.            CustomLButton2->Top = CustomLButton3->Top+15;
  65.            CustomLButton1->Top = CustomLButton2->Top+15;
  66.            CustomLButton2->Left = CustomLButton3->Left;
  67.            CustomLButton1->Left = CustomLButton3->Left;
  68.    }
  69. }
  70. //---------------------------------------------------------------------------
  71. void __fastcall TShapeBtnDemoForm::ButtonColoredMouseLeave(TObject *Sender)
  72. {
  73.   ((TfcShapeBtn *)Sender)->Font->Color = clWhite;
  74. }
  75. //---------------------------------------------------------------------------
  76. void __fastcall TShapeBtnDemoForm::ButtonGlyphHotTrackMouseEnter(
  77.       TObject *Sender)
  78. {
  79.   ((TfcShapeBtn *)Sender)->Font->Color = clRed;
  80. }
  81. //---------------------------------------------------------------------------
  82. void __fastcall TShapeBtnDemoForm::ButtonGlyphHotTrackMouseLeave(
  83.       TObject *Sender)
  84. {
  85.   ((TfcShapeBtn *)Sender)->Font->Color = clBlack;
  86. }
  87. //---------------------------------------------------------------------------
  88. void __fastcall TShapeBtnDemoForm::ButtonHotTrackMouseEnter(
  89.       TObject *Sender)
  90. {
  91.      ((TfcShapeBtn *)Sender)->Color = clRed;
  92.      ((TfcShapeBtn *)Sender)->UpdateShadeColors(clRed);
  93.      ((TfcShapeBtn *)Sender)->Font->Color = clWhite;
  94.      ((TfcShapeBtn *)Sender)->TextOptions->HighlightColor = 0x00A0A0FF;
  95.      ((TfcShapeBtn *)Sender)->TextOptions->ShadeColor = clMaroon;
  96. }
  97. //---------------------------------------------------------------------------
  98. void __fastcall TShapeBtnDemoForm::ButtonHotTrackMouseLeave(
  99.       TObject *Sender)
  100. {
  101.      ((TfcShapeBtn *)Sender)->Color = clBtnFace;
  102.      ((TfcShapeBtn *)Sender)->UpdateShadeColors(Color);
  103.      ((TfcShapeBtn *)Sender)->Font->Color = clBlack;
  104.      ((TfcShapeBtn *)Sender)->TextOptions->HighlightColor = clBtnHighlight;
  105.      ((TfcShapeBtn *)Sender)->TextOptions->ShadeColor = clBtnShadow;
  106.      ((TfcShapeBtn *)Sender)->ShadeColors->Btn3DLight = cl3DLight;
  107. }
  108. //---------------------------------------------------------------------------