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

Delphi控件源码

开发平台:

Delphi

  1. unit Shapeu;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   ExtCtrls, fcLabel, ComCtrls, StdCtrls, DBCtrls, Db, DBTables, fcButton,
  6.   fcImgBtn, fcShapeBtn, fcText, Buttons, fcDemoRichEdit, fcImager;
  7. type
  8.   TShapeBtnDemoForm = class(TForm)
  9.     PageControl1: TPageControl;
  10.     TabSheet1: TTabSheet;
  11.     TabSheet3: TTabSheet;
  12.     TabSheet4: TTabSheet;
  13.     TabSheet5: TTabSheet;
  14.     TabSheet6: TTabSheet;
  15.     Panel2: TPanel;
  16.     ButtonArrowLeft: TfcShapeBtn;
  17.     ButtonArrowRight: TfcShapeBtn;
  18.     ButtonDiamond: TfcShapeBtn;
  19.     ButtonRoundRect1: TfcShapeBtn;
  20.     ButtonEllipse: TfcShapeBtn;
  21.     ButtonRoundRect2: TfcShapeBtn;
  22.     ButtonStar: TfcShapeBtn;
  23.     ButtonRoundRect3: TfcShapeBtn;
  24.     ButtonTriangle: TfcShapeBtn;
  25.     ButtonTrapezoid: TfcShapeBtn;
  26.     fcDemoRichEdit1: TfcDemoRichEdit;
  27.     Panel3: TPanel;
  28.     CustomButton1: TfcShapeBtn;
  29.     CustomCrossButton: TfcShapeBtn;
  30.     CustomArrowButton: TfcShapeBtn;
  31.     RadioGroup1: TRadioGroup;
  32.     CustomLButton1: TfcShapeBtn;
  33.     CustomLButton2: TfcShapeBtn;
  34.     CustomLButton3: TfcShapeBtn;
  35.     CustomTriangleButton: TfcShapeBtn;
  36.     CustomTrapezoidButton: TfcShapeBtn;
  37.     fcDemoRichEdit2: TfcDemoRichEdit;
  38.     Panel4: TPanel;
  39.     ButtonMultiLine2: TfcShapeBtn;
  40.     ButtonTextEffects1: TfcShapeBtn;
  41.     ButtonMultiLine1: TfcShapeBtn;
  42.     fcDemoRichEdit3: TfcDemoRichEdit;
  43.     Panel5: TPanel;
  44.     Label1: TLabel;
  45.     ButtonSpeedStar: TfcShapeBtn;
  46.     ButtonSpeedArrow: TfcShapeBtn;
  47.     Label2: TLabel;
  48.     Label3: TLabel;
  49.     fcShapeBtn1: TfcShapeBtn;
  50.     fcShapeBtn2: TfcShapeBtn;
  51.     fcShapeBtn3: TfcShapeBtn;
  52.     fcShapeBtn7: TfcShapeBtn;
  53.     fcShapeBtn6: TfcShapeBtn;
  54.     fcShapeBtn5: TfcShapeBtn;
  55.     Edit1: TEdit;
  56.     fcDemoRichEdit4: TfcDemoRichEdit;
  57.     Panel6: TPanel;
  58.     ButtonGlyphHotTrack: TfcShapeBtn;
  59.     ButtonHotTrack: TfcShapeBtn;
  60.     ButtonColored: TfcShapeBtn;
  61.     fcDemoRichEdit5: TfcDemoRichEdit;
  62.     Bevel1: TBevel;
  63.     Label5: TLabel;
  64.     Label6: TLabel;
  65.     Bevel2: TBevel;
  66.     Bevel3: TBevel;
  67.     Bevel4: TBevel;
  68.     fcShapeBtn8: TfcShapeBtn;
  69.     fcShapeBtn9: TfcShapeBtn;
  70.     fcShapeBtn10: TfcShapeBtn;
  71.     fcLabel6: TfcLabel;
  72.     fcLabel7: TfcLabel;
  73.     Panel11: TPanel;
  74.     Panel12: TPanel;
  75.     Panel13: TPanel;
  76.     Panel14: TPanel;
  77.     Panel15: TPanel;
  78.     RightButton1: TfcShapeBtn;
  79.     RightButton2: TfcShapeBtn;
  80.     LeftButton1: TfcShapeBtn;
  81.     RightButton3: TfcShapeBtn;
  82.     LeftButton2: TfcShapeBtn;
  83.     RightButton4: TfcShapeBtn;
  84.     LeftButton3: TfcShapeBtn;
  85.     LeftButton4: TfcShapeBtn;
  86.     fcLabel8: TfcLabel;
  87.     fcLabel5: TfcLabel;
  88.     fcLabel3: TfcLabel;
  89.     fcLabel4: TfcLabel;
  90.     fcLabel9: TfcLabel;
  91.     fcLabel2: TfcLabel;
  92.     fcLabel1: TfcLabel;
  93.     fcImager1: TfcImager;
  94.     procedure LeftButton3Click(Sender: TObject);
  95.     procedure RightButton1Click(Sender: TObject);
  96.     procedure RadioGroup1Click(Sender: TObject);
  97.     procedure ButtonColoredMouseLeave(Sender: TObject);
  98.     procedure ButtonHotTrackMouseLeave(Sender: TObject);
  99.     procedure ButtonHotTrackMouseEnter(Sender: TObject);
  100.     procedure ButtonGlyphHotTrackMouseEnter(Sender: TObject);
  101.     procedure ButtonGlyphHotTrackMouseLeave(Sender: TObject);
  102.   private
  103.     { Private declarations }
  104.   public
  105.     { Public declarations }
  106.   end;
  107. var
  108.   ShapeBtnDemoForm: TShapeBtnDemoForm;
  109. implementation
  110. {$R *.DFM}
  111. procedure TShapeBtnDemoForm.LeftButton3Click(Sender: TObject);
  112. begin
  113.   with PageControl1 do ActivePage := FindNextPage(ActivePage,False,False);
  114. end;
  115. procedure TShapeBtnDemoForm.RightButton1Click(Sender: TObject);
  116. begin
  117.   with PageControl1 do ActivePage := FindNextPage(ActivePage,True,False);
  118. end;
  119. procedure TShapeBtnDemoForm.RadioGroup1Click(Sender: TObject);
  120. begin
  121.    case RadioGroup1.ItemIndex of
  122.       0: begin
  123.            CustomLButton1.Orientation := soDown;
  124.            CustomLButton2.Orientation := soDown;
  125.            CustomLButton3.Orientation := soDown;
  126.            CustomArrowButton.Orientation := soDown;
  127.            CustomLButton2.Top := CustomLButton3.Top;
  128.            CustomLButton1.Top := CustomLButton3.Top;
  129.            CustomLButton2.Left := CustomLButton3.Left;
  130.            CustomLButton1.Left := CustomLButton3.Left;
  131.          end;
  132.       1: begin
  133.            CustomLButton1.Orientation := soUp;
  134.            CustomLButton2.Orientation := soUp;
  135.            CustomLButton3.Orientation := soUp;
  136.            CustomArrowButton.Orientation := soUp;
  137.            CustomLButton2.Top := CustomLButton3.Top+15;
  138.            CustomLButton1.Top := CustomLButton2.Top+15;
  139.            CustomLButton2.Left := CustomLButton3.Left+15;
  140.            CustomLButton1.Left := CustomLButton2.Left+15;
  141.          end;
  142.       2: begin
  143.            CustomLButton1.Orientation := soLeft;
  144.            CustomLButton2.Orientation := soLeft;
  145.            CustomLButton3.Orientation := soLeft;
  146.            CustomArrowButton.Orientation := soLeft;
  147.            CustomLButton2.Top := CustomLButton3.Top;
  148.            CustomLButton1.Top := CustomLButton3.Top;
  149.            CustomLButton2.Left := CustomLButton3.Left+15;
  150.            CustomLButton1.Left := CustomLButton2.Left+15;
  151.          end;
  152.       3: begin
  153.            CustomLButton1.Orientation := soRight;
  154.            CustomLButton2.Orientation := soRight;
  155.            CustomLButton3.Orientation := soRight;
  156.            CustomArrowButton.Orientation := soRight;
  157.            CustomLButton2.Top := CustomLButton3.Top+15;
  158.            CustomLButton1.Top := CustomLButton2.Top+15;
  159.            CustomLButton2.Left := CustomLButton3.Left;
  160.            CustomLButton1.Left := CustomLButton3.Left;
  161.          end;
  162.    end;
  163. end;
  164. procedure TShapeBtnDemoForm.ButtonColoredMouseLeave(Sender: TObject);
  165. begin
  166.   (Sender as TfcShapeBtn).Font.Color := clWhite;
  167. end;
  168. procedure TShapeBtnDemoForm.ButtonHotTrackMouseLeave(Sender: TObject);
  169. begin
  170.   with (Sender as TfcShapeBtn) do begin
  171.     Color := clBtnFace;
  172.     UpdateShadeColors(Color);
  173.     Font.Color := clBlack;
  174.     TextOptions.ShadeColor := clBtnShadow;
  175.     TextOptions.HighlightColor := clBtnHighlight;
  176.     ShadeColors.Btn3DLight := cl3DLight;
  177.   end;
  178. end;
  179. procedure TShapeBtnDemoForm.ButtonHotTrackMouseEnter(Sender: TObject);
  180. begin
  181.   with (Sender as TfcShapeBtn) do begin
  182.      Color := clRed;
  183.      UpdateShadeColors(clRed);
  184.      Font.Color := clWhite;
  185.      TextOptions.HighlightColor := $00A0A0FF;
  186.      TextOptions.ShadeColor := clMaroon;
  187.   end;
  188. end;
  189. procedure TShapeBtnDemoForm.ButtonGlyphHotTrackMouseEnter(Sender: TObject);
  190. begin
  191.   (Sender as TfcShapeBtn).Font.Color := clRed;
  192. end;
  193. procedure TShapeBtnDemoForm.ButtonGlyphHotTrackMouseLeave(Sender: TObject);
  194. begin
  195.  (Sender as TfcShapeBtn).Font.Color := clBlack;
  196. end;
  197. end.