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

Delphi控件源码

开发平台:

Delphi

  1. unit PanelDemo;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   StdCtrls, fcCombo, fctreecombo, fcLabel, fcpanel, fcColorCombo, fcImager,
  6.   ComCtrls;
  7. type
  8.   TPanelDemoForm = class(TForm)
  9.     fcGroupBox1: TfcGroupBox;
  10.     fcLabel3: TfcLabel;
  11.     fcLabel2: TfcLabel;
  12.     fcLabel1: TfcLabel;
  13.     fcTreeCombo3: TfcTreeCombo;
  14.     fcTreeCombo2: TfcTreeCombo;
  15.     fcTreeCombo1: TfcTreeCombo;
  16.     fcGroupBox2: TfcGroupBox;
  17.     fcLabel8: TfcLabel;
  18.     fcLabel9: TfcLabel;
  19.     fcTreeCombo4: TfcTreeCombo;
  20.     fcTreeCombo5: TfcTreeCombo;
  21.     fcGroupBox3: TfcGroupBox;
  22.     fcImager1: TfcImager;
  23.     fcColorCombo1: TfcColorCombo;
  24.     fcColorCombo2: TfcColorCombo;
  25.     fcLabel4: TfcLabel;
  26.     fcLabel5: TfcLabel;
  27.     CheckBox1: TCheckBox;
  28.     FullBorderCheckbox: TCheckBox;
  29.     Edit1: TEdit;
  30.     fcLabel6: TfcLabel;
  31.     UpDown1: TUpDown;
  32.     procedure fcColorCombo1Change(Sender: TObject);
  33.     procedure fcColorCombo2Change(Sender: TObject);
  34.     procedure CheckBox1Click(Sender: TObject);
  35.     procedure FullBorderCheckboxClick(Sender: TObject);
  36.     procedure Edit1Change(Sender: TObject);
  37.   private
  38.     { Private declarations }
  39.   public
  40.     { Public declarations }
  41.   end;
  42. var
  43.   PanelDemoForm: TPanelDemoForm;
  44. implementation
  45. {$R *.DFM}
  46. procedure TPanelDemoForm.fcColorCombo1Change(Sender: TObject);
  47. begin
  48.   fcgroupbox1.Frame.nonfocuscolor:=fccolorcombo1.selectedcolor;
  49.   fcgroupbox2.Frame.nonfocuscolor:=fccolorcombo1.selectedcolor;
  50.   fcgroupbox1.invalidate;
  51.   fcgroupbox2.invalidate;
  52. end;
  53. procedure TPanelDemoForm.fcColorCombo2Change(Sender: TObject);
  54. begin
  55.   fcgroupbox1.color:=fccolorcombo2.selectedcolor;
  56.   fcgroupbox2.color:=fccolorcombo2.selectedcolor;
  57.   fcgroupbox1.invalidate;
  58.   fcgroupbox2.invalidate;
  59. end;
  60. procedure TPanelDemoForm.CheckBox1Click(Sender: TObject);
  61. begin
  62.   with (Sender as TCheckbox) do
  63.   begin
  64.      fcGroupbox1.transparent:= checked;
  65.      fcGroupbox2.transparent:= checked;
  66.      fcColorCombo1.enabled:= not checked;
  67.      fcColorCombo2.enabled:= not checked;
  68.   end;
  69. end;
  70. procedure TPanelDemoForm.FullBorderCheckboxClick(Sender: TObject);
  71. begin
  72.   with (Sender as TCheckbox) do
  73.   begin
  74.      fcGroupbox1.FullBorder := checked;
  75.      fcGroupbox2.FullBorder := checked;
  76.   end;
  77.   invalidate;
  78. end;
  79. procedure TPanelDemoForm.Edit1Change(Sender: TObject);
  80. begin
  81.    fcGroupBox1.CaptionIndent := UpDown1.Position;
  82.    fcGroupBox2.CaptionIndent := UpDown1.Position;
  83.    invalidate;
  84. end;
  85. end.