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

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

?? tflatcomboboxunit.pas

?? 工程管理部門配件倉庫屬于生產輔助倉庫
?? PAS
字號:
unit TFlatComboBoxUnit;

interface

{$I Version.inc}

uses
  Windows, Messages, Classes, Forms, Controls, Graphics, StdCtrls, FlatUtilitys,
  SysUtils, ShellApi, Commctrl, Consts;

type
  TFlatComboBox = class(TCustomComboBox)
  private
    // Colors
    FArrowColor: TColor;
    FArrowBackgroundColor: TColor;
    FBorderColor: TColor;
    // AdvColors
    FUseAdvColors: Boolean;
    FAdvColorArrowBackground: TAdvColors;
    FAdvColorBorder: TAdvColors;
    //
    FButtonWidth: Integer;
    FChildHandle: HWND;
    FDefListProc: Pointer;
    FListHandle: HWND;
    FListInstance: Pointer;
    FSysBtnWidth: Integer;
    FSolidBorder: Boolean;
    // Colors
    procedure SetColors (Index: Integer; Value: TColor);
    // AdvColors
    procedure SetAdvColors (Index: Integer; Value: TAdvColors);
    procedure SetUseAdvColors (Value: Boolean);
    //
    function GetButtonRect: TRect;
    procedure PaintButton;
    procedure PaintBorder;
    procedure RedrawBorders;
    procedure InvalidateSelection;
    function GetSolidBorder: Boolean;
    procedure SetSolidBorder;
    procedure ListWndProc (var Message: TMessage);
    procedure WMSetFocus (var Message: TMessage); message WM_SETFOCUS;
    procedure WMKillFocus (var Message: TMessage); message WM_KILLFOCUS;
    procedure WMKeyDown (var Message: TMessage); message WM_KEYDOWN;
    procedure WMPaint (var Message: TWMPaint); message WM_PAINT;
    procedure WMNCPaint (var Message: TMessage); message WM_NCPAINT;
    procedure CMEnabledChanged (var Msg: TMessage); message CM_ENABLEDCHANGED;
    procedure CNCommand (var Message: TWMCommand); message CN_COMMAND;
    procedure CMFontChanged (var Message: TMessage); message CM_FONTCHANGED;
    procedure CMSysColorChange (var Message: TMessage); message CM_SYSCOLORCHANGE;
    procedure CMParentColorChanged (var Message: TWMNoParams); message CM_PARENTCOLORCHANGED;
  protected
    procedure CalcAdvColors;
    procedure WndProc (var Message: TMessage); override;
    procedure ComboWndProc (var Message: TMessage; ComboWnd: HWnd; ComboProc: Pointer); override;
    property SolidBorder: Boolean read FSolidBorder;
  public
    constructor Create (AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Style;
    // Colors
    property Color default $00E1EAEB;
    property ColorArrow: TColor index 0 read FArrowColor write SetColors default clBlack;
    property ColorArrowBackground: TColor index 1 read FArrowBackgroundColor write SetColors default $00C5D6D9;
    property ColorBorder: TColor index 2 read FBorderColor write SetColors default $008396A0;
    // AdvColors
    property AdvColorBorder: TAdvColors index 0 read FAdvColorBorder write SetAdvColors default 50;
    property AdvColorArrowBackground: TAdvColors index 1 read FAdvColorArrowBackground write SetAdvColors default 10;
    property UseAdvColors: Boolean read FUseAdvColors write SetUseAdvColors default false;
    //
    property DragMode;
    property DragCursor;
    property DropDownCount;
    property Enabled;
    property Font;
    property ItemHeight;
    property Items;
    property MaxLength;
    property ParentFont;
    property ParentShowHint;
    property PopupMenu;
    property ShowHint;
    property Sorted;
    property TabOrder;
    property TabStop;
    property Text;
    property Visible;
    property ItemIndex;
    property OnChange;
    property OnClick;
    property OnDblClick;
    property OnDragDrop;
    property OnDragOver;
    property OnDrawItem;
    property OnDropDown;
    property OnEndDrag;
    property OnEnter;
    property OnExit;
    property OnKeyDown;
    property OnKeyPress;
    property OnKeyUp;
    property OnMeasureItem;
    property OnStartDrag;
   {$IFDEF D4CB4}
    property Anchors;
    property BiDiMode;
    property Constraints;
    property DragKind;
    property ParentBiDiMode;
    property OnEndDock;
    property OnStartDock;
   {$ENDIF}
  end;

implementation

constructor TFlatComboBox.Create (AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := ControlStyle - [csFixedHeight] + [csOpaque];
  TControlCanvas(Canvas).Control := self;
  FButtonWidth := 11;
  FSysBtnWidth := GetSystemMetrics(SM_CXVSCROLL);
  FListInstance := MakeObjectInstance(ListWndProc);
  FDefListProc := nil;
  ItemHeight := 13;
  // Colors
  FArrowColor := clBlack;
  FArrowBackgroundColor := $00C5D6D9;
  FBorderColor := $008396A0;
  // AdvColors
  FUseAdvColors := False;
  FAdvColorBorder := 50;
  FAdvColorArrowBackground := 10;
end;

destructor TFlatComboBox.Destroy;
begin
  FreeObjectInstance(FListInstance);
  inherited;
end;

procedure TFlatComboBox.SetColors (Index: Integer; Value: TColor);
begin
  case Index of
    0: FArrowColor := Value;
    1: FArrowBackgroundColor := Value;
    2: FBorderColor := Value;
  end;
  Invalidate;
end;

procedure TFlatComboBox.CalcAdvColors;
begin
  if FUseAdvColors then
  begin
    FBorderColor := CalcAdvancedColor(TForm(Parent).Color, FBorderColor, FAdvColorBorder, darken);
    FArrowBackgroundColor := CalcAdvancedColor(TForm(Parent).Color, FArrowBackgroundColor, FAdvColorArrowBackground, darken);
  end;
end;

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

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

procedure TFlatComboBox.CMSysColorChange (var Message: TMessage);
begin
  if FUseAdvColors then
    CalcAdvColors;
  Invalidate;
end;

procedure TFlatComboBox.CMParentColorChanged (var Message: TWMNoParams);
begin
  if FUseAdvColors then
    CalcAdvColors;
  Invalidate;
end;

procedure TFlatComboBox.WndProc (var Message: TMessage);
begin
  if (Message.Msg = WM_PARENTNOTIFY) then
    case LoWord(Message.wParam) of
      WM_CREATE:
        if FDefListProc <> nil then
        begin
          SetWindowLong(FListHandle, GWL_WNDPROC, Longint(FDefListProc));
          FDefListProc := nil;
          FChildHandle := Message.lParam;
        end
        else
          if FChildHandle = 0 then
            FChildHandle := Message.lParam
          else
            FListHandle := Message.lParam;
      end
  else
    if (Message.Msg = WM_WINDOWPOSCHANGING) then
      if Style in [csDropDown, csSimple] then
        SetWindowPos( EditHandle, 0,
          0, 0, ClientWidth - FButtonWidth - 2 * 2 - 4, Height - 2 * 2 - 2,
          SWP_NOMOVE + SWP_NOZORDER + SWP_NOACTIVATE + SWP_NOREDRAW);
  inherited;
  if Message.Msg = WM_CTLCOLORLISTBOX then
  begin
    SetBkColor(Message.wParam, ColorToRGB(Color));
    Message.Result := CreateSolidBrush(ColorToRGB(Color));
  end;
end;

procedure TFlatComboBox.ListWndProc (var Message: TMessage);
begin
  case Message.Msg of
    WM_WINDOWPOSCHANGING:
      with TWMWindowPosMsg(Message).WindowPos^ do
      begin
        // size of the drop down list
        if Style in [csDropDown, csDropDownList] then
          cy := (GetFontHeight(Font)-2) * Min(DropDownCount, Items.Count) + 4
        else
          cy := (ItemHeight) * Min(DropDownCount, Items.Count) + 4;
        if cy <= 4  then
          cy := 10;
      end;
    else
      with Message do
        Result := CallWindowProc(FDefListProc, FListHandle, Msg, WParam, LParam);
  end;
end;

procedure TFlatComboBox.ComboWndProc (var Message: TMessage; ComboWnd: HWnd; ComboProc: Pointer);
begin
  inherited;
  if (ComboWnd = EditHandle) then
    case Message.Msg of
      WM_SETFOCUS, WM_KILLFOCUS:
        SetSolidBorder;
    end;
end;

procedure TFlatComboBox.WMSetFocus (var Message: TMessage);
begin
  inherited;
  if not (csDesigning in ComponentState) then
  begin
    SetSolidBorder;
    if not (Style in [csSimple, csDropDown]) then
      InvalidateSelection;
  end;
end;

procedure TFlatComboBox.WMKillFocus (var Message: TMessage);
begin
  inherited;
  if not (csDesigning in ComponentState) then
  begin
    SetSolidBorder;
    if not (Style in [csSimple, csDropDown]) then
      InvalidateSelection;
  end;
end;

procedure TFlatComboBox.CMEnabledChanged (var Msg: TMessage);
begin
  inherited;
  Invalidate;
end;

procedure TFlatComboBox.CNCommand (var Message: TWMCommand);
var
  R: TRect;
begin
  inherited;
  if Message.NotifyCode in [1, 9, CBN_DROPDOWN, CBN_SELCHANGE] then
  begin
    if not (Style in [csSimple, csDropDown]) then
      InvalidateSelection;
  end;
  if (Message.NotifyCode in [CBN_CLOSEUP]) then
  begin
    R := GetButtonRect;
    Dec(R.Left, 2);
    InvalidateRect(Handle, @R, FALSE);
  end;
end;

procedure TFlatComboBox.WMKeyDown (var Message: TMessage);
var
  S: String;
begin
  S := Text;
  inherited;
  if not (Style in [csSimple, csDropDown]) and (Text <> S) then
    InvalidateSelection;
end;

procedure TFlatComboBox.WMPaint (var Message: TWMPaint);
var
  R: TRect;
  DC: HDC;
  PS: TPaintStruct;
begin
  DC := BeginPaint(Handle, PS);
  try
    R := PS.rcPaint;
    if R.Right > Width - FButtonWidth - 4 then
      R.Right := Width - FButtonWidth - 4;
    FillRect(DC, R, Brush.Handle);
    if RectInRect(GetButtonRect, PS.rcPaint) then
      PaintButton;
    ExcludeClipRect(DC, ClientWidth - FSysBtnWidth - 2, 0, ClientWidth, ClientHeight);
    PaintWindow(DC);
    if (Style = csDropDown) and DroppedDown then
    begin
      R := ClientRect;
      InflateRect(R, -2, -2);
      R.Right := Width - FButtonWidth - 3;
      Canvas.Brush.Color := clWindow;
      Canvas.FrameRect(R);
    end
    else
      if Style <> csDropDown then
        InvalidateSelection;
  finally
    EndPaint(Handle, PS);
  end;
  RedrawBorders;
  Message.Result := 0;
end;

procedure TFlatComboBox.WMNCPaint (var Message: TMessage);
begin
  inherited;
  RedrawBorders;
end;

procedure TFlatComboBox.CMFontChanged (var Message: TMessage);
begin
  inherited;
  ItemHeight := 13;
  RecreateWnd;
end;

procedure TFlatComboBox.InvalidateSelection;
var
  R: TRect;
begin
  R := ClientRect;
  InflateRect(R, -2, -3);
  R.Left := R.Right - FButtonWidth - 8;
  Dec(R.Right, FButtonWidth + 3);
  if (GetFocus = Handle) and not DroppedDown then
    Canvas.Brush.Color := clHighlight
  else
    Canvas.Brush.Color := Color;
  Canvas.Brush.Style := bsSolid;
  Canvas.FillRect(R);
  if (GetFocus = Handle) and not DroppedDown then
  begin
    R := ClientRect;
    InflateRect(R, -3, -3);
    Dec(R.Right, FButtonWidth + 2);
    Canvas.FrameRect(R);
    Canvas.Brush.Color := clWindow;
  end;
  ExcludeClipRect(Canvas.Handle, ClientWidth - FSysBtnWidth - 2, 0, ClientWidth, ClientHeight);
end;

function TFlatComboBox.GetButtonRect: TRect;
begin
  GetWindowRect(Handle, Result);
  OffsetRect(Result, -Result.Left, -Result.Top);
  Inc(Result.Left, ClientWidth - FButtonWidth);
  OffsetRect(Result, -1, 0);
end;

procedure TFlatComboBox.PaintButton;
var
  R: TRect;
  x, y: Integer;
begin
  R := GetButtonRect;
  InflateRect(R, 1, 0);

  Canvas.Brush.Color := FArrowBackgroundColor;
  Canvas.FillRect(R);
  Canvas.Brush.Color := FBorderColor;
  Canvas.FrameRect(R);

  x := (R.Right - R.Left) div 2 - 6 + R.Left;
  if DroppedDown then
    y := (R.Bottom - R.Top) div 2 - 1 + R.Top
  else
    y := (R.Bottom - R.Top) div 2 - 1 + R.Top;

  if Enabled then
  begin
    canvas.Brush.Color := FArrowColor;
    canvas.Pen.Color := FArrowColor;
    if DroppedDown then
      canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)])
    else
      canvas.Polygon([Point(x + 4, y), Point(x + 8, y), Point(x + 6, y + 2)]);
  end
  else
  begin
    canvas.Brush.Color := clWhite;
    canvas.Pen.Color := clWhite;
    Inc(x); Inc(y);
    if DroppedDown then
      canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)])
    else
      canvas.Polygon([Point(x + 4, y), Point(x + 8, y), Point(x + 6, y + 2)]);
    Dec(x); Dec(y);
    canvas.Brush.Color := clGray;
    canvas.Pen.Color := clGray;
    if DroppedDown then
      canvas.Polygon([Point(x + 4, y + 2), Point(x + 8, y + 2), Point(x + 6, y)])
    else
      canvas.Polygon([Point(x + 4, y), Point(x + 8, y), Point(x + 6, y + 2)]);
  end;
  ExcludeClipRect(Canvas.Handle, ClientWidth - FSysBtnWidth, 0, ClientWidth, ClientHeight);
end;

procedure TFlatComboBox.PaintBorder;
var
  DC: HDC;
  R: TRect;
  BtnFaceBrush, WindowBrush: HBRUSH;
begin
  DC := GetWindowDC(Handle);

  GetWindowRect(Handle, R);
  OffsetRect(R, -R.Left, -R.Top);
  Dec(R.Right, FButtonWidth + 1);
  try
    BtnFaceBrush := CreateSolidBrush(ColorToRGB(FBorderColor));
    WindowBrush := CreateSolidBrush(ColorToRGB(Color));

    FrameRect(DC, R, BtnFaceBrush);
    InflateRect(R, -1, -1);
    FrameRect(DC, R, WindowBrush);
    InflateRect(R, -1, -1);
    FrameRect(DC, R, WindowBrush);
  finally
    ReleaseDC(Handle, DC);
  end;
  DeleteObject(WindowBrush);
  DeleteObject(BtnFaceBrush);
end;

function TFlatComboBox.GetSolidBorder: Boolean;
begin
  Result := ( (csDesigning in ComponentState) and Enabled) or
    (not(csDesigning in ComponentState) and
    (DroppedDown or (GetFocus = Handle) or (GetFocus = EditHandle)) );
end;

procedure TFlatComboBox.SetSolidBorder;
var
  sb: Boolean;
begin
  sb := GetSolidBorder;
  if sb <> FSolidBorder then
  begin
    FSolidBorder := sb;
    RedrawBorders;
  end;
end;

procedure TFlatComboBox.RedrawBorders;
begin
  PaintBorder;
  if Style <> csSimple then
    PaintButton;
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆精品国产91| 在线视频欧美区| 午夜电影一区二区| 一区av在线播放| 亚洲六月丁香色婷婷综合久久 | 日韩综合小视频| 一区二区三区成人在线视频| 亚洲美女淫视频| 一区二区在线观看视频| 一区二区三区在线视频观看58| 亚洲日本护士毛茸茸| 亚洲人成7777| 五月综合激情网| 久久机这里只有精品| 狠狠色狠狠色综合系列| 丁香亚洲综合激情啪啪综合| 色综合久久综合| 色拍拍在线精品视频8848| 色偷偷久久人人79超碰人人澡| 91国偷自产一区二区使用方法| 91美女片黄在线| 91麻豆精品91久久久久同性| 久久久另类综合| 亚洲男人的天堂一区二区| 亚洲一区二区欧美激情| 蜜臀av亚洲一区中文字幕| 国产精品18久久久久久久久久久久| 处破女av一区二区| 欧美日韩免费一区二区三区视频| 精品国产人成亚洲区| 综合自拍亚洲综合图不卡区| 日韩中文字幕91| 国产福利一区二区三区在线视频| 色吧成人激情小说| 欧美成人激情免费网| 亚洲色大成网站www久久九九| 日本女人一区二区三区| 91一区二区三区在线播放| 日韩欧美国产成人一区二区| 亚洲免费在线看| 精品影院一区二区久久久| 日本电影欧美片| 久久久精品影视| 日本午夜一本久久久综合| www.欧美亚洲| 久久奇米777| 香蕉加勒比综合久久| 99精品一区二区| 精品国产1区2区3区| 午夜精品久久久久久久蜜桃app| 成人精品免费网站| 久久综合九色综合欧美98| 五月天网站亚洲| 91免费国产在线| 国产精品拍天天在线| 精品一区二区免费在线观看| 这里是久久伊人| 亚洲一区二区在线播放相泽| 成人性视频网站| 久久久久久久久久电影| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美三级在线看| 亚洲欧洲中文日韩久久av乱码| 国产乱码精品一区二区三区av| 91精品中文字幕一区二区三区| 亚洲影视在线播放| 91啪九色porn原创视频在线观看| 国产三级精品视频| 国产综合色在线视频区| 欧美成人综合网站| 另类调教123区| 精品国产一区二区三区四区四| 日本91福利区| 欧美xxxxx裸体时装秀| 蜜臀91精品一区二区三区| 5566中文字幕一区二区电影| 午夜日韩在线电影| 制服丝袜av成人在线看| 麻豆成人在线观看| 精品成人在线观看| 国产激情一区二区三区桃花岛亚洲| 久久久久久久电影| 成人免费三级在线| 亚洲免费观看高清完整版在线| 色综合中文综合网| 一区在线观看视频| 99久久久无码国产精品| 亚洲图片你懂的| 99久久久无码国产精品| 一二三区精品福利视频| 欧美精品色综合| 另类综合日韩欧美亚洲| 久久久久久免费网| 9l国产精品久久久久麻豆| 国产精品国产三级国产三级人妇 | 国产欧美视频一区二区| thepron国产精品| 亚洲午夜精品网| 91精品国产品国语在线不卡| 九色|91porny| 自拍视频在线观看一区二区| 欧美日韩另类国产亚洲欧美一级| 免费看黄色91| 国产精品青草久久| 在线播放中文字幕一区| 国产在线视视频有精品| 亚洲欧洲成人精品av97| 777午夜精品免费视频| 国产精品一区三区| 国产精品久久久久aaaa| 欧美日韩成人综合天天影院| 国产一区二区三区久久悠悠色av| 亚洲人吸女人奶水| 精品国产乱码久久| 色综合久久综合网97色综合| 国产一区中文字幕| 亚洲香肠在线观看| 国产亚洲欧美在线| 欧美军同video69gay| 成人永久看片免费视频天堂| 丝袜美腿亚洲色图| 亚洲欧洲三级电影| 欧美大片一区二区三区| 欧美亚洲图片小说| 国产高清精品网站| 久久激五月天综合精品| 亚洲综合男人的天堂| 国产精品色哟哟网站| 欧美电影免费观看高清完整版| 日本高清不卡视频| 99热99精品| 国产不卡在线视频| 久草在线在线精品观看| 天堂久久久久va久久久久| 国产精品精品国产色婷婷| 精品福利一二区| 日韩亚洲电影在线| 欧美日韩五月天| 日本高清不卡一区| 91在线观看地址| bt欧美亚洲午夜电影天堂| 国内精品久久久久影院色| 欧美bbbbb| 蜜臀av一级做a爰片久久| 日韩一区欧美二区| 午夜久久电影网| 亚洲国产裸拍裸体视频在线观看乱了 | 中文字幕亚洲一区二区av在线| 欧美mv和日韩mv的网站| 日韩欧美一卡二卡| 欧美变态tickling挠脚心| 日韩视频国产视频| 欧美一级午夜免费电影| 欧美久久一二区| 日韩一区二区影院| 91麻豆精品国产综合久久久久久| 欧美日韩一卡二卡三卡| 欧美精品免费视频| 久久精品在这里| 久久综合色综合88| 久久久电影一区二区三区| 日本一区二区三区免费乱视频| 国产视频不卡一区| 国产精品国产三级国产aⅴ入口| 国产精品青草综合久久久久99| 亚洲欧美中日韩| 亚洲一二三区不卡| 蜜臀久久久99精品久久久久久| 久久国产人妖系列| 国产91精品一区二区| a美女胸又www黄视频久久| 91成人在线精品| 欧美一区二区三区的| 久久久精品影视| 亚洲精品视频自拍| 日本aⅴ亚洲精品中文乱码| 国产精品亚洲午夜一区二区三区| 粉嫩av一区二区三区粉嫩| 一本一道久久a久久精品综合蜜臀| 在线看国产一区| 日韩欧美国产一区在线观看| 欧美国产成人在线| 亚洲一区二区欧美| 国产一二三精品| 色呦呦一区二区三区| 欧美一激情一区二区三区| 国产日产欧美一区二区三区| 亚洲美女一区二区三区| 免费成人你懂的| 成人av免费在线观看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 欧美一区二区三区免费| 国产人成亚洲第一网站在线播放| 亚洲精品视频在线观看网站| 久久99九九99精品| 在线日韩国产精品| 国产亚洲精久久久久久| 天堂成人免费av电影一区| 成人伦理片在线| 欧美va亚洲va香蕉在线|