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

Delphi控件源码

开发平台:

Delphi

  1. unit Frameu;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   fcImager, fcImage, fcImageForm, ExtCtrls, StdCtrls, Buttons, Mask,
  6.   ComCtrls, fcOutlookList, fcButton, fcImgBtn, fcShapeBtn, fcClearPanel,
  7.   fcButtonGroup, fcCombo, fctreecombo, ImgList, fcLabel, fcFrame,
  8.   fcDemoRichEdit, fcpanel;
  9. type
  10.   TFrameDemo = class(TForm)
  11.     fcImageForm1: TfcImageForm;
  12.     Shape1: TShape;
  13.     BitBtn1: TBitBtn;
  14.     Label1: TLabel;
  15.     ImageList1: TImageList;
  16.     fcShapeBtn1: TfcShapeBtn;
  17.     Label18: TLabel;
  18.     Image1: TImage;
  19.     BackgroundCombo: TfcTreeCombo;
  20.     fcLabel5: TfcLabel;
  21.     FrameCombo: TfcTreeCombo;
  22.     fcLabel7: TfcLabel;
  23.     fcDemoRichEdit1: TfcDemoRichEdit;
  24.     fcImager6: TfcImager;
  25.     TileImager: TfcImager;
  26.     MosaicImager: TfcImager;
  27.     WrinkleImager: TfcImager;
  28.     LinenImager: TfcImager;
  29.     ParchmentImager: TfcImager;
  30.     fcGroupBox1: TfcGroupBox;
  31.     fcTreeCombo3: TfcTreeCombo;
  32.     fcLabel3: TfcLabel;
  33.     fcTreeCombo2: TfcTreeCombo;
  34.     fcLabel2: TfcLabel;
  35.     fcTreeCombo1: TfcTreeCombo;
  36.     fcLabel1: TfcLabel;
  37.     fcGroupBox2: TfcGroupBox;
  38.     fcTreeCombo4: TfcTreeCombo;
  39.     fcLabel8: TfcLabel;
  40.     fcTreeCombo5: TfcTreeCombo;
  41.     fcLabel9: TfcLabel;
  42.     procedure BitBtn1Click(Sender: TObject);
  43.     procedure fcTreeCombo4Exit(Sender: TObject);
  44.     procedure fcShapeBtn1Click(Sender: TObject);
  45.     procedure BackgroundComboChange(Sender: TObject);
  46.     procedure FrameComboChange(Sender: TObject);
  47.     procedure FormShow(Sender: TObject);
  48.   private
  49.     { Private declarations }
  50.   public
  51.     { Public declarations }
  52.   end;
  53. var
  54.   FrameDemo: TFrameDemo;
  55. implementation
  56. {$R *.DFM}
  57. procedure TFrameDemo.BitBtn1Click(Sender: TObject);
  58. begin
  59.   Close;
  60. end;
  61. procedure TFrameDemo.fcTreeCombo4Exit(Sender: TObject);
  62. begin
  63.    with (Sender as TfcTreeCombo) do begin
  64.      if items.FindNode(text,False) = nil then begin
  65.         TreeView.Items.Add(nil,Text);
  66.         Treeview.AlphaSort;
  67.      end;
  68.    end;
  69. end;
  70. procedure TFrameDemo.fcShapeBtn1Click(Sender: TObject);
  71. begin
  72.    ShowMessage('Put code here to send results of poll.');
  73. end;
  74. procedure TFrameDemo.BackgroundComboChange(Sender: TObject);
  75. var TempImager:TfcImager;
  76. begin
  77.   if ((Sender as TfcTreeCombo).Text = 'Plain') then begin
  78.      TileImager.Visible := False;
  79.      exit;
  80.   end;
  81.   TempImager := nil;
  82.   if ((Sender as TfcTreeCombo).Text = 'Wrinkle') then
  83.      TempImager := WrinkleImager
  84.   else if ((Sender as TfcTreeCombo).Text = 'Linen') then
  85.      TempImager := LinenImager
  86.   else if ((Sender as TfcTreeCombo).Text = 'Parchment') then
  87.      TempImager := ParchmentImager
  88.   else if ((Sender as TfcTreeCombo).Text = 'Mosaic') then
  89.      TempImager := MosaicImager;
  90.   if TempImager <> nil then begin
  91.      TempImager.UpdateWorkBitmap;
  92.      TileImager.Picture.Assign(TempImager.WorkBitmap);
  93.   end;
  94.   TileImager.Visible := True;
  95. end;
  96. procedure TFrameDemo.FrameComboChange(Sender: TObject);
  97. var i:integer;
  98. begin
  99.   for i:= 0 to Controlcount-1 do begin
  100.      if (Controls[i] is TfcTreeCombo) then begin
  101.        TfcTreeCombo(Controls[i]).Frame.FocusStyle := efsFrameBox;
  102.        TfcTreeCombo(Controls[i]).Frame.NonFocusStyle := efsFrameBox;
  103.        TfcTreeCombo(Controls[i]).Frame.NonFocusBorders := [efLeftBorder,efTopBorder,efRightBorder,efBottomBorder];
  104.        TfcTreeCombo(Controls[i]).ButtonEffects.Flat := False;
  105.        TfcTreeCombo(Controls[i]).ButtonEffects.Transparent := False;
  106.        TfcTreeCombo(Controls[i]).Frame.Enabled := True;
  107.        if ((Sender as TfcTreeCombo).Text = 'Underline') then begin
  108.           TfcTreeCombo(Controls[i]).Frame.NonFocusBorders := [efBottomBorder];
  109.        end
  110.        else if ((Sender as TfcTreeCombo).Text = 'FrameBox') then begin
  111.        end
  112.        else if ((Sender as TfcTreeCombo).Text = 'Flat Buttons') then begin
  113.           TfcTreeCombo(Controls[i]).Frame.NonFocusStyle := efsFrameSingle;
  114.           TfcTreeCombo(Controls[i]).ButtonEffects.Flat := True;
  115.           TfcTreeCombo(Controls[i]).ButtonEffects.Transparent := True;
  116.        end
  117.        else if ((Sender as TfcTreeCombo).Text = 'No Frame (Normal)') then begin
  118.           TfcTreeCombo(Controls[i]).Frame.Enabled := False;
  119.           TfcTreeCombo(Controls[i]).BorderStyle := bsSingle;
  120.        end
  121.        else if ((Sender as TfcTreeCombo).Text = 'Sunken Focus') then begin
  122.           TfcTreeCombo(Controls[i]).Frame.FocusStyle := efsFrameSunken;
  123.        end
  124.        else if ((Sender as TfcTreeCombo).Text = 'Raised Panel Focus') then begin
  125.           TfcTreeCombo(Controls[i]).Frame.FocusStyle := efsFrameRaised;
  126.        end
  127.        else if ((Sender as TfcTreeCombo).Text = 'Etched') then begin
  128.           TfcTreeCombo(Controls[i]).Frame.NonFocusStyle := efsFrameEtched;
  129.           TfcTreeCombo(Controls[i]).Frame.FocusStyle := efsFrameEtched;
  130.        end
  131.        else if ((Sender as TfcTreeCombo).Text = 'Bump') then begin
  132.           TfcTreeCombo(Controls[i]).Frame.NonFocusStyle := efsFrameBump;
  133.           TfcTreeCombo(Controls[i]).Frame.FocusStyle := efsFrameBump;
  134.        end
  135.      end;
  136.   end;
  137. end;
  138. procedure TFrameDemo.FormShow(Sender: TObject);
  139. begin
  140. //  fctreecombo4.TreeView.Color := clBtnFace;
  141.    ParchmentImager.UpdateWorkBitmap;
  142.    TileImager.Picture.Assign(ParchmentImager.WorkBitmap);
  143. end;
  144. end.