亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tflatchecklistboxunit.pas

?? Oracle數據庫備份 寫入日志文件;并附有要使用的控件。
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit TFlatCheckListBoxUnit;

interface

{$I DFS.inc}

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, ExtCtrls, FlatUtilitys;

type
  TFlatCheckListBox = class(TCustomControl)
  private
    FSelected: Integer;
    FTransparent: TTransparentMode;
    FOnClickCheck: TNotifyEvent;
    cWheelMessage: Cardinal;
    scrollType: TScrollType;
    firstItem: Integer;
    maxItems: Integer;
    FSorted: Boolean;
    FItems: TStringList;
    FItemsRect: TList;
    FItemsHeight: Integer;
    FChecked: set of Byte;
    FScrollBars: Boolean;
    FUseAdvColors: Boolean;
    FAdvColorBorder: TAdvColors;
    FArrowColor: TColor;
    FCheckColor: TColor;
    FBorderColor: TColor;
    FItemsRectColor: TColor;
    FItemsSelectColor: TColor;
    procedure SetColors (Index: Integer; Value: TColor);
    procedure SetAdvColors (Index: Integer; Value: TAdvColors);
    procedure SetUseAdvColors (Value: Boolean);
    procedure SetSorted (Value: Boolean);
    procedure SetItems (Value: TStringList);
    procedure SetItemsRect;
    procedure SetItemsHeight (Value: Integer);
    function GetChecked (Index: Integer): Boolean;
    procedure SetChecked (Index: Integer; Value: Boolean);
    function GetSelCount: Integer;
    procedure SetScrollBars (Value: Boolean);
    function GetItemIndex: Integer;
    procedure SetItemIndex (Value: Integer);
    procedure WMSize (var Message: TWMSize); message WM_SIZE;
    procedure WMMove (var Message: TWMMove); message WM_MOVE;
    procedure CMEnabledChanged (var Message: TMessage); message CM_ENABLEDCHANGED;
    procedure CMSysColorChange (var Message: TMessage); message CM_SYSCOLORCHANGE;
    procedure CMParentColorChanged (var Message: TWMNoParams); message CM_PARENTCOLORCHANGED;
    procedure ScrollTimerHandler (Sender: TObject);
    procedure ItemsChanged (Sender: TObject);
    procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS;
    procedure WMKillFocus (var Message: TWMKillFocus); message WM_KILLFOCUS;
    procedure CNKeyDown (var Message: TWMKeyDown); message CN_KEYDOWN;
    procedure WMMouseWheel (var Message: TMessage); message WM_MOUSEWHEEL;
    procedure SetTransparent (const Value: TTransparentMode);
  protected
    procedure CalcAdvColors;
    procedure DrawCheckRect (canvas: TCanvas; start: TPoint; checked: Boolean);
    procedure DrawScrollBar (canvas: TCanvas);
    procedure Paint; override;
    procedure Loaded; override;
    procedure MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure MouseUp (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure WndProc (var Message: TMessage); override;
   {$IFDEF DFS_COMPILER_4_UP}
    procedure SetBiDiMode(Value: TBiDiMode); override;
   {$ENDIF}
  public
    constructor Create (AOwner: TComponent); override;
    destructor Destroy; override;
    property Checked [Index: Integer]: Boolean read GetChecked write SetChecked;
    property SelCount: Integer read GetSelCount;
    procedure Clear;
    property ItemIndex: Integer read GetItemIndex write SetItemIndex;
  published
    property Items: TStringList read FItems write SetItems;
    property ItemHeight: Integer read FItemsHeight write SetItemsHeight default 17;
    property ScrollBars: Boolean read FScrollBars write SetScrollBars default false;
    property Color default $00E1EAEB;
    property ColorArrow: TColor index 0 read FArrowColor write SetColors default clBlack;
    property ColorBorder: TColor index 1 read FBorderColor write SetColors default $008396A0;
    property ColorItemsRect: TColor index 2 read FItemsRectColor write SetColors default clWhite;
    property ColorItemsSelect: TColor index 3 read FItemsSelectColor write SetColors default $009CDEF7;
    property ColorCheck: TColor index 4 read FCheckColor write SetColors default clBlack;
    property AdvColorBorder: TAdvColors index 0 read FAdvColorBorder write SetAdvColors default 40;
    property UseAdvColors: Boolean read FUseAdvColors write SetUseAdvColors default false;
    property Sorted: Boolean read FSorted write SetSorted default false;
    property TransparentMode: TTransparentMode read FTransparent write SetTransparent default tmNone;
    property Align;
    property Font;
    property ParentFont;
    property ParentColor;
    property ParentShowHint;
    property Enabled;
    property Visible;
    property PopupMenu;
    property ShowHint;

    property OnClick;
    property OnClickCheck: TNotifyEvent read FOnClickCheck write FOnClickCheck;
    property OnMouseMove;
    property OnMouseDown;
    property OnMouseUp;
   {$IFDEF DFS_COMPILER_4_UP}
    property Anchors;
    property BiDiMode write SetBidiMode;
    property Constraints;
    property DragKind;
    property ParentBiDiMode;
    property OnEndDock;
    property OnStartDock;
   {$ENDIF}
  end;

implementation

var
  ScrollTimer: TTimer = nil;

const
  FTimerInterval = 600; 
  FScrollSpeed = 100;

constructor TFlatCheckListBox.Create (AOwner: TComponent);
begin
  inherited;
  if ScrollTimer = nil then
  begin
    ScrollTimer := TTimer.Create(nil);
    ScrollTimer.Enabled := False;
    ScrollTimer.Interval := FTimerInterval;
  end;
  ControlStyle := ControlStyle + [csOpaque];
  SetBounds(Left, Top, 137, 99);
  FItems := TStringList.Create;
  FItemsRect := TList.Create;
  FItemsHeight := 17;

  TStringList(FItems).OnChange := ItemsChanged;

  FScrollBars := false;
  firstItem := 0;
  FArrowColor := clBlack;
  FBorderColor := $008396A0;
  FItemsRectColor := clWhite;
  FItemsSelectColor := $009CDEF7;
  FCheckColor := clBlack;
  ParentColor := True;
  ParentFont := True;
  Enabled := true;
  Visible := true;
  FUseAdvColors := false;
  FAdvColorBorder := 40;
  FSorted := false;
  FTransparent := tmNone;
  FSelected := -1;
  cWheelMessage:= RegisterWindowMessage(MSH_MOUSEWHEEL);
end;

destructor TFlatCheckListBox.Destroy;
var
  counter: Integer;
begin
  ScrollTimer.Free;
  ScrollTimer := nil;
  FItems.Free;
  for counter := 0 to FItemsRect.Count - 1 do
    Dispose(FItemsRect.Items[counter]);
  FItemsRect.Free;
  inherited;
end;

procedure TFlatCheckListBox.WndProc (var Message: TMessage);
begin
  if Message.Msg = cWheelMessage then
  begin
    SendMessage (Self.Handle, WM_MOUSEWHEEL, Message.wParam, Message.lParam);
  end;
  inherited;
end;

procedure TFlatCheckListBox.WMMouseWheel (var Message: TMessage);
var
  fScrollLines: Integer;
begin
  if not(csDesigning in ComponentState) then
  begin
    SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, @fScrollLines, 0);

    if (fScrollLines = 0) then
      fScrollLines := maxItems;

    if ShortInt(Message.WParamHi) = -WHEEL_DELTA then
      if firstItem + maxItems + fScrollLines <= FItems.Count then
        Inc(firstItem, fScrollLines)
      else
        if FItems.Count - maxItems < 0 then
          firstItem := 0
        else
          firstItem := FItems.Count - maxItems
    else
      if ShortInt(Message.WParamHi) = WHEEL_DELTA then
        if firstItem - fScrollLines < 0 then
          firstItem := 0
        else
          dec(firstItem, fScrollLines);
    Invalidate;
  end;
end;

procedure TFlatCheckListBox.ItemsChanged (Sender: TObject);
begin
  if Enabled then
  begin
    FChecked := FChecked - [0..High(Byte)];
    Invalidate;
  end;
end;

procedure TFlatCheckListBox.SetColors (Index: Integer; Value: TColor);
begin
  case Index of
    0: FArrowColor := Value;
    1: FBorderColor := Value;
    2: FItemsRectColor := Value;
    3: FItemsSelectColor := Value;
    4: FCheckColor := Value;
  end;
  Invalidate;       
end;

procedure TFlatCheckListBox.CalcAdvColors;
begin
  if FUseAdvColors then
  begin
    FBorderColor := CalcAdvancedColor(Color, FBorderColor, FAdvColorBorder, darken);
  end;
end;

procedure TFlatCheckListBox.SetAdvColors (Index: Integer; Value: TAdvColors);
begin
  case Index of
    0: FAdvColorBorder := Value;
  end;
  CalcAdvColors;
  Invalidate;
end;

procedure TFlatCheckListBox.SetUseAdvColors (Value: Boolean);
begin
  if Value <> FUseAdvColors then
  begin
    FUseAdvColors := Value;
    ParentColor := Value;
    CalcAdvColors;
    Invalidate;
  end;
end;

procedure TFlatCheckListBox.SetSorted (Value: Boolean);
begin
  if Value <> FSorted then
  begin
    FSorted := Value;
    FItems.Sorted := Value;
    FChecked := FChecked - [0..High(Byte)];
    Invalidate;
  end;
end;

procedure TFlatCheckListBox.SetItems (Value: TStringList);
var
  counter: Integer;
begin
  if Value.Count - 1 > High(Byte) then
    Exit;

  // delete all spaces at left and right
  for counter := 0 to Value.Count - 1 do
    Value[counter] := Trim(Value[counter]);

  FItems.Assign(Value);

  Invalidate;
end;

procedure TFlatCheckListBox.SetItemsRect;
var
  counter: Integer;
  ItemRect: ^TRect;
  position: TPoint;
begin
  // Delete all curent Rects
  FItemsRect.Clear;

  // calculate the maximum items to draw
  if ScrollBars then
    maxItems := (Height - 24) div (FItemsHeight + 2)
  else
    maxItems := (Height - 4) div (FItemsHeight + 2);

  // set left/top position for the the first item
  if ScrollBars then
   position := Point(ClientRect.left + 3, ClientRect.top + 13)
  else
    position := Point(ClientRect.left + 3, ClientRect.top + 3);

  for counter := 0 to maxItems - 1 do
  begin
    // create a new Item-Rect
    New(ItemRect);
    // calculate the Item-Rect
    ItemRect^ := Rect(position.x, position.y, ClientRect.Right - 3, position.y + FItemsHeight);
    // set left/top position for next Item-Rect
    position := Point(position.x, position.y + FItemsHeight + 2);
    // add the Item-Rect to the Items-Rect-List
    FItemsRect.Add(ItemRect);
  end;
  Invalidate;
end;

procedure TFlatCheckListBox.SetItemsHeight (Value: Integer);
begin
  if Value < 1 then
    Value := 1;

  FItemsHeight := Value;

  if not (csLoading in ComponentState) then
    if ScrollBars then
      SetBounds(Left, Top, Width, maxItems * (FItemsHeight + 2) + 24)
    else
      SetBounds(Left, Top, Width, maxItems * (FItemsHeight + 2) + 4);
      
  SetItemsRect;
end;

function TFlatCheckListBox.GetChecked (Index: Integer): Boolean;
begin
  Result := Index in FChecked;
end;

procedure TFlatCheckListBox.SetChecked (Index: Integer; Value: Boolean);
begin
  if Value then
    Include(FChecked, Index)
  else
    Exclude(FChecked, Index);
  Invalidate;
end;

{$IFDEF DFS_COMPILER_4_UP}
procedure TFlatCheckListBox.SetBiDiMode(Value: TBiDiMode);
begin
  inherited;
  Invalidate;
end;
{$ENDIF}

function TFlatCheckListBox.GetSelCount: Integer;
var
  counter: Integer;
begin
  Result := 0;
  for counter := 0 to High(Byte) do
    if counter in FChecked then
      Inc(Result);
end;

procedure TFlatCheckListBox.SetScrollBars (Value: Boolean);
begin
  if FScrollBars <> Value then
  begin
    FScrollBars := Value;
    if not (csLoading in ComponentState) then
      if Value then
        Height := Height + 20
      else
        Height := Height - 20;
    SetItemsRect;
  end;
end;

procedure TFlatCheckListBox.DrawScrollBar (canvas: TCanvas);
var
  x, y: Integer;
begin
  // Draw the ScrollBar background
  canvas.Brush.Color := Color;
  canvas.FillRect(Rect(ClientRect.Left, ClientRect.Top, ClientRect.Right, ClientRect.Top + 11));
  canvas.FillRect(Rect(ClientRect.Left, ClientRect.Bottom - 11, ClientRect.Right, ClientRect.Bottom));

  // Draw the ScrollBar border
  canvas.Brush.Color := FBorderColor;
  canvas.FrameRect(Rect(ClientRect.Left, ClientRect.Top, ClientRect.Right, ClientRect.Top + 11));
  canvas.FrameRect(Rect(ClientRect.Left, ClientRect.Bottom - 11, ClientRect.Right, ClientRect.Bottom));

  // Draw the up arrow
  x := (ClientRect.Right - ClientRect.Left) div 2 - 6;
  y := ClientRect.Top + 4;

  if (firstItem <> 0) and Enabled then
  begin
    canvas.Brush.Color := FArrowColor;
    canvas.Pen.Color := FArrowColor;
    canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)]);
  end
  else
  begin
    canvas.Brush.Color := clWhite;
    canvas.Pen.Color := clWhite;
    Inc(x); Inc(y);
    canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)]);
    Dec(x); Dec(y);
    canvas.Brush.Color := clGray;
    canvas.Pen.Color := clGray;
    canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)]);
  end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
偷窥国产亚洲免费视频| 欧美羞羞免费网站| 色哟哟国产精品| 日韩精品中午字幕| 亚洲免费观看高清| 国产精品亚洲а∨天堂免在线| 亚洲精品免费播放| 国产精品一区二区在线观看网站| 欧洲视频一区二区| 中文字幕在线播放不卡一区| 久久69国产一区二区蜜臀| 欧美在线观看视频一区二区三区| 久久久99精品久久| 久久精品国产成人一区二区三区| 欧美天堂亚洲电影院在线播放| 中文字幕一区二区三区在线观看 | 人人超碰91尤物精品国产| 高清免费成人av| 久久综合久久综合久久综合| 日韩电影一区二区三区| 欧美色综合天天久久综合精品| 国产精品国产精品国产专区不片| 国产伦精品一区二区三区在线观看| 在线成人免费观看| 亚洲福利视频导航| 精品视频色一区| 亚洲午夜视频在线| 欧美日韩精品二区第二页| 亚洲综合在线视频| 在线亚洲+欧美+日本专区| 亚洲欧美日韩人成在线播放| 99视频一区二区| 一色桃子久久精品亚洲| 91在线无精精品入口| 亚洲色图另类专区| 色域天天综合网| 亚洲国产乱码最新视频 | 久久99国产精品成人| 欧美一级高清大全免费观看| 秋霞国产午夜精品免费视频| 欧美一区二区视频在线观看| 日本午夜一本久久久综合| 欧美一区二区三区四区视频| 麻豆国产欧美日韩综合精品二区| 欧美一区二区三区电影| 精品亚洲国内自在自线福利| 久久精品一区二区三区不卡| www.亚洲精品| 亚洲综合区在线| 6080日韩午夜伦伦午夜伦| 91在线视频免费观看| 亚洲欧美一区二区视频| 日本道精品一区二区三区| 亚洲bt欧美bt精品777| 日韩一级完整毛片| 黑人精品欧美一区二区蜜桃| 国产精品卡一卡二卡三| 在线精品视频小说1| 裸体健美xxxx欧美裸体表演| 国产日韩v精品一区二区| 91国产视频在线观看| 日本成人在线一区| 国产精品视频麻豆| 欧美精品粉嫩高潮一区二区| 国产真实乱子伦精品视频| 亚洲日本在线天堂| 日韩视频中午一区| 99精品国产99久久久久久白柏 | 色综合久久88色综合天天| 日本女优在线视频一区二区| 久久久精品天堂| 欧美影院一区二区| 九色porny丨国产精品| 亚洲欧美在线aaa| 精品欧美久久久| 欧美羞羞免费网站| 国产二区国产一区在线观看| 亚洲成人综合视频| 国产偷国产偷精品高清尤物| 欧美色国产精品| 岛国一区二区三区| 麻豆精品国产传媒mv男同| 伊人开心综合网| 国产精品视频看| 日韩免费高清电影| 欧美日韩精品免费观看视频| 成人听书哪个软件好| 久久99九九99精品| 爽好多水快深点欧美视频| 亚洲欧洲国产日本综合| 精品三级在线看| 91精品国产色综合久久| 一本色道久久综合狠狠躁的推荐| 国产乱理伦片在线观看夜一区| 视频在线观看国产精品| 亚洲狼人国产精品| 国产精品免费aⅴ片在线观看| 欧美变态凌虐bdsm| 欧美日韩精品一区二区天天拍小说 | 欧美精品久久天天躁| 99re66热这里只有精品3直播| 国产自产2019最新不卡| 青青草国产精品97视觉盛宴| 亚洲图片欧美色图| 亚洲综合色丁香婷婷六月图片| 欧美激情资源网| 久久久久久**毛片大全| 久久一二三国产| 精品91自产拍在线观看一区| 日韩免费在线观看| 欧美tickling挠脚心丨vk| 欧美大尺度电影在线| 日韩一级视频免费观看在线| 日韩一区二区三区高清免费看看| 91精品国产综合久久精品麻豆| 欧美人xxxx| 欧美一区二区三区不卡| 欧美一卡二卡三卡四卡| 日韩视频免费观看高清完整版在线观看 | 国产白丝网站精品污在线入口| 久久不见久久见免费视频1| 久久福利视频一区二区| 国模娜娜一区二区三区| 粉嫩av一区二区三区在线播放 | 免费观看91视频大全| 欧美bbbbb| 国产在线精品一区二区夜色| 国产一区二区美女| 成人av电影在线| 色婷婷综合久久久中文一区二区| 91国产丝袜在线播放| 欧美精品777| 久久女同互慰一区二区三区| 欧美国产1区2区| 一区二区三区资源| 日韩国产高清影视| 国产精品亚洲第一区在线暖暖韩国| 成人黄色网址在线观看| 欧美在线播放高清精品| 欧美一级视频精品观看| 国产亚洲午夜高清国产拍精品| 国产精品国产三级国产普通话三级| 亚洲视频在线一区观看| 日韩专区一卡二卡| 国产**成人网毛片九色| 欧美中文一区二区三区| 2022国产精品视频| 亚洲女子a中天字幕| 青青草伊人久久| av影院午夜一区| 欧美一区二区精品久久911| 久久久国产午夜精品| 亚洲国产视频网站| 国产精品 日产精品 欧美精品| 日本道精品一区二区三区 | 久久国产剧场电影| 91丨国产丨九色丨pron| 欧美一级淫片007| 成人欧美一区二区三区视频网页| 五月天久久比比资源色| 成人app下载| 欧美成人vr18sexvr| 亚洲综合精品久久| 成人一级片在线观看| 91精品午夜视频| 一区二区三区中文免费| 成人一二三区视频| 日韩欧美区一区二| 亚洲一区在线电影| 92精品国产成人观看免费| 久久亚洲精精品中文字幕早川悠里| 亚洲国产毛片aaaaa无费看| www.亚洲在线| 国产日产欧美一区二区视频| 日韩av电影一区| 欧洲色大大久久| 亚洲激情五月婷婷| 成人动漫av在线| 欧美国产精品一区二区三区| 久久国产人妖系列| 欧美一二区视频| 婷婷综合五月天| 欧美日韩国产高清一区二区| 国产精品大尺度| 成人在线视频首页| 国产三级欧美三级| 国产精品一级片在线观看| 日韩精品一区二区三区视频播放 | 欧美精品久久一区| 亚洲高清免费观看高清完整版在线观看 | 国产一区二区在线观看免费| 91精品国产综合久久久久久久久久 | 91精品国产色综合久久不卡电影| 一区二区欧美精品| 日本精品一区二区三区四区的功能| 亚洲国产精品国自产拍av| 国产成人午夜精品影院观看视频 | 亚洲欧洲国产专区| 91在线免费看| 亚洲乱码日产精品bd|