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

Delphi控件源码

开发平台:

Delphi

  1. unit trackdemo;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  5.   Dialogs, dbcgrids, DB, DBTables, ExtCtrls, fcpanel,
  6.   fctrackbar, ComCtrls, fcLabel, StdCtrls, fcDemoRichEdit, Grids;
  7. type
  8.   TTrackbarForm = class(TForm)
  9.     fcGroupBox1: TfcGroupBox;
  10.     fcDemoRichEdit1: TfcDemoRichEdit;
  11.     fcLabel1: TfcLabel;
  12.     fcGroupBox2: TfcGroupBox;
  13.     fcLabel2: TfcLabel;
  14.     fcTrackBar1: TfcTrackBar;
  15.     fcTrackBar7: TfcTrackBar;
  16.     fcDemoRichEdit2: TfcDemoRichEdit;
  17.     fcTrackBar5: TfcTrackBar;
  18.     fcTrackBar4: TfcTrackBar;
  19.     fcGroupBox3: TfcGroupBox;
  20.     fcTrackBar6: TfcTrackBar;
  21.     fcDemoRichEdit3: TfcDemoRichEdit;
  22.     fcGroupBox4: TfcGroupBox;
  23.     DBCtrlGrid1: TDBCtrlGrid;
  24.     fcTrackBar2: TfcTrackBar;
  25.     DataSource1: TDataSource;
  26.     Table1: TTable;
  27.     procedure fcTrackBar6DrawTickText(Sender: TObject; TickValue: Double;
  28.       var ATickText: String; var ARect: TRect; var DoDefault: Boolean);
  29.   private
  30.     { Private declarations }
  31.   public
  32.     { Public declarations }
  33.   end;
  34. var
  35.   TrackbarForm: TTrackbarForm;
  36. implementation
  37. {$R *.dfm}
  38. procedure TTrackbarForm.fcTrackBar6DrawTickText(Sender: TObject;
  39.   TickValue: Double; var ATickText: String; var ARect: TRect;
  40.   var DoDefault: Boolean);
  41. var TickInt: integer;
  42. begin
  43.   TickInt:= Round(TickValue);
  44.   if (abs(TickValue-TickInt)<0.01) then
  45.   begin
  46.     case TickInt of
  47.       0: ATickText:= 'Low';
  48.       1: ATickText:= 'Medium';
  49.       2: ATickText:= 'High';
  50.       3: ATickText:= 'Top Priority';
  51.     end;
  52.   end;
  53. end;
  54. end.