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

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

?? unitascombobox.pas

?? 仿速達界面控件
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit UnitASComboBox;

interface
uses
  Buttons,
  UnitASBase, UnitASEdit, Types, StdCtrls, Dialogs, 
  Messages, Windows, SysUtils, Classes, Contnrs, Imm, Clipbrd,
  Controls, Forms, Menus, Graphics, UnitASUtils;

type
  TComboBoxButtonClick = procedure(Sender: TObject; ButtonIndex: Integer) of
    object;
  TComboBoxStyle = (cbDropDown, cbDropDownList);
type
  TDropDownWindow = class;

  TCustomASComboBox = class(TCustomASEdit)
  private
    FListBoxAutoWidth: Boolean;
    FIsDropDown: Boolean;
    FDropDownWindow: TDropDownWindow;
    FDropDownCount: Integer;
    FStyle: TComboBoxStyle;
    FOnButtonClick: TComboBoxButtonClick;
    function ButtonRect: TRect;
    procedure ButtonClick;
    function GetItems: TStrings;
    function GetButtons: TStrings;
    procedure SetButtons(const Value: TStrings);
    procedure SetItems(const Value: TStrings);
    procedure SetStyle(const Value: TComboBoxStyle);
    function GetItemIndex: Integer;
    procedure SetItemIndex(const Value: Integer);
  protected
    function GetEditRect: TRect; override;
    procedure PaintBuffer; override;
    procedure MouseMove(Shift: TShiftState; x: Integer; y: Integer);
      override;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X: Integer; Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; x: Integer;
      y: Integer); override;
    procedure DropDown;
    procedure CloseUp(Accept: Boolean);

    procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS;
    property ListBoxAutoWidth: Boolean read FListBoxAutoWidth write
      FListBoxAutoWidth;
    property Style: TComboBoxStyle read FStyle write SetStyle;
    procedure ShowCaret; override;
    procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;

    property DropDownCount: Integer read FDropDownCount write FDropDownCount;
    property Items: TStrings read GetItems write SetItems;
    property ItemIndex: Integer read GetItemIndex write SetItemIndex;
    property Buttons: TStrings read GetButtons write SetButtons;
    property OnButtonClick: TComboBoxButtonClick read FOnButtonClick
      write FOnButtonClick;
  end;

  TASComboBox = class(TCustomASComboBox)
  published
    property Borderstyle;
    property ListBoxAutoWidth;
    property DropDownCount;
    property Items;
    property Buttons;
    property OnButtonClick;
    property Style;
  end;

  TDropDownWindow = class(TForm)
  private
    FListBox: TCustomListBox;
    FToolBar: TASBase;
    function GetItems: TStrings;
    procedure WMMouseActivate(var Message: TMessage); message WM_MOUSEACTIVATE;
    procedure WMActivate(var Msg: TWMActivate); message WM_ACTIVATE;
    function GetForm: TWinControl;
    function GetButtons: TStrings;
  protected
    procedure CreateParams(var Params: TCreateParams); override;

  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    property Items: TStrings read GetItems;
    property Buttons: TStrings read GetButtons;
  end;

implementation

type
  TASListBox = class(TCustomListBox)
  private
    FComboBox: TCustomASComboBox;
  protected
    property ItemHeight;
    property Color;
    property Font;
    property IntegralHeight;
    procedure Click; override;
    procedure SetItemIndex(const Value: Integer); override;
    //procedure KeyDown(var Key: Word; Shift: TShiftState); override;

  public
    constructor Create(AOwner: TComponent); override;

  end;

  { TASListBox }

procedure TASListBox.Click;
begin
  inherited Click;
  FComboBox.CloseUp(True);
end;

constructor TASListBox.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FComboBox := TCustomASComboBox(AOwner.Owner);
  BorderStyle := bsNone;
end;

type
  TButtonsStatues = (bsDefault, bsAcitve, bsPressDown);

type
  TComboBoxToolBar = class(TASBase)
  private
    FComboBox: TCustomASComboBox;
    FButtons: TStrings;
    FActiveButtonIndex: Integer;
    FActiveButtonStatues: TButtonsStatues;
    FLBtnDown: Boolean;
    procedure ButtonsChange(Sender: TObject);

  protected
    function ButtonRect(Index: Integer): TRect;
    procedure Paint; override;
    procedure DoButtonClick(Index: Integer);
    property Buttons: TStrings read FButtons;
    procedure DrawButton(ACanvas: TCanvas; Index: Integer; Statues:
      TButtonsStatues);
    procedure CMMouseleave(var Message: TMessage); message CM_MOUSELEAVE;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X: Integer; Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X: Integer;
      Y: Integer); override;
    procedure MouseMove(Shift: TShiftState; X: Integer; Y: Integer);
      override;

  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

procedure TASListBox.SetItemIndex(const Value: Integer);
begin
  inherited SetItemIndex(Value);
  FComboBox.CloseUp(True);
end;

{ TComboBoxToolBar }

function TComboBoxToolBar.ButtonRect(Index: Integer): TRect;
var
  ButtonWidth       : Integer;
begin
  Result := ClientRect;
  Inc(Result.Top, 1);
  ButtonWidth := ClientWidth div FButtons.Count;
  Result.Left := Index * ButtonWidth;
  Result.Right := (Index + 1) * ButtonWidth;
end;

procedure TComboBoxToolBar.ButtonsChange(Sender: TObject);
begin
  if FButtons.Count = 0 then
    Self.Height := 0
  else
    Self.Height := 21;
end;

procedure TComboBoxToolBar.CMMouseleave(var Message: TMessage);
begin
  if FActiveButtonStatues <> bsPressDown then
  begin
    FActiveButtonIndex := -1;
    Invalidate;
  end;
end;

constructor TComboBoxToolBar.Create(AOwner: TComponent);
begin
  inherited;
  FActiveButtonIndex := -1;
  FActiveButtonStatues := bsDefault;
  FButtons := TStringList.Create;
  TStringList(FButtons).OnChange := ButtonsChange;
  FLBtnDown := False;
  FComboBox := TCustomASComboBox(AOwner.Owner);
end;

destructor TComboBoxToolBar.Destroy;
begin
  FButtons.Free;
  inherited;
end;

procedure TComboBoxToolBar.DoButtonClick(Index: Integer);
begin
  FComboBox.CloseUp(False);
  if Assigned(FComboBox.FOnButtonClick) then
    FComboBox.FOnButtonClick(FComboBox, Index);
end;

procedure TComboBoxToolBar.DrawButton(ACanvas: TCanvas; Index: Integer; Statues:
  TButtonsStatues);
var
  BtnRect           : TRect;
begin
  BtnRect := ButtonRect(Index);
  ACanvas.Brush.Color := clWhite;
  ACanvas.FillRect(BtnRect);
  case Statues of
    bsDefault:
      begin
        ACanvas.FillRect(BtnRect);
      end;
    bsAcitve:
      begin
        ACanvas.Pen.Color := clBlue;
        ACanvas.Rectangle(BtnRect);
        ACanvas.Pen.Color := clWhite;
        InflateRect(BtnRect, -1, -1);
        DrawButtonFace(ACanvas, BtnRect, 1, bsNew, False, False, False);
      end;
    bsPressDown:
      begin
        ACanvas.Pen.Color := clBlue;
        ACanvas.Rectangle(BtnRect);
        ACanvas.Pen.Color := clWhite;
        InflateRect(BtnRect, -1, -1);
        DrawButtonFace(ACanvas, BtnRect, 1, bsNew, False, True, False);
        //ACanvas.FillRect(BtnRect);
      end;
  end;
  ACanvas.Brush.Style := bsClear;
  DrawText(ACanvas, FButtons[Index], BtnRect, DT_CENTER or DT_SINGLELINE or
    DT_VCENTER);
end;

procedure TComboBoxToolBar.MouseDown(Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  I                 : Integer;
begin
  if Button <> mbLeft then
    Exit;
  for I := 0 to FButtons.Count - 1 do
  begin
    if PtInRect(ButtonRect(I), Point(X, Y)) then
    begin
      FActiveButtonIndex := I;
      FActiveButtonStatues := bsPressDown;
      FLBtnDown := True;
      Invalidate;
      Break;
    end;
  end;
end;

procedure TComboBoxToolBar.MouseMove(Shift: TShiftState; X, Y: Integer);
var
  I                 : Integer;
begin
  if not FLBtnDown then
  begin
    for I := 0 to FButtons.Count - 1 do
    begin
      if PtInRect(ButtonRect(I), Point(X, Y)) then
      begin
        if FActiveButtonIndex <> I then
        begin
          FActiveButtonIndex := I;

          FActiveButtonStatues := bsAcitve;

          Invalidate;
        end;
        Break;
      end;
    end;
  end;
end;

procedure TComboBoxToolBar.MouseUp(Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  I                 : Integer;
begin
  if Button <> mbLeft then
    Exit;
  if FLBtnDown then
  begin
    FActiveButtonStatues := bsDefault;
    for I := 0 to FButtons.Count - 1 do
    begin
      if PtInRect(ButtonRect(I), Point(X, Y)) then
      begin
        if FActiveButtonIndex = I then
        begin
          //ShowMessage(IntToStr(I));
          DoButtonClick(I);
        end;
        FActiveButtonStatues := bsAcitve;
        Break;
      end;
    end;
    FLBtnDown := False;
    Invalidate;
  end;
end;

procedure TComboBoxToolBar.Paint;
var
  I                 : Integer;
  DoubleBuffer      : TBitmap;
begin
  DoubleBuffer := TBitmap.Create;
  try
    DoubleBuffer.Height := ClientHeight;
    DoubleBuffer.Width := ClientWidth;
    DoubleBuffer.Canvas.MoveTo(0, 0);
    DoubleBuffer.Canvas.LineTo(ClientWidth, 0);
    DoubleBuffer.Canvas.Font.Assign(Self.Font);

    for I := 0 to FButtons.Count - 1 do
    begin
      if I = FActiveButtonIndex then
      begin
        DrawButton(DoubleBuffer.Canvas, I, FActiveButtonStatues);
      end
      else
      begin
        DrawButton(DoubleBuffer.Canvas, I, bsDefault);
      end;
    end;
  finally
    Canvas.CopyRect(ClientRect, DoubleBuffer.Canvas, ClientRect);
  end;
  DoubleBuffer.Free;
end;

{ TDropDownWindow }

constructor TDropDownWindow.Create(AOwner: TComponent);
begin
  inherited CreateNew(AOwner);
  FListBox := TASListBox.Create(Self);
  FListBox.Parent := Self;
  FListBox.Align := alClient;
  //TASListBox(FListBox).IntegralHeight := True;
  //TASListBox(FListBox).BorderStyle := bsSingle;
  BorderStyle := bsNone;
  FToolBar := TComboBoxToolBar.Create(Self);
  FToolBar.Parent := Self;
  FToolBar.Align := alBottom;

  ControlStyle := ControlStyle + [csNoDesignVisible, csReplicatable];
end;

destructor TDropDownWindow.Destroy;
begin
  FListBox.Free;
  inherited Destroy;
end;

procedure TDropDownWindow.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影在线一区| 色婷婷久久久久swag精品| 国产麻豆视频一区二区| av中文字幕亚洲| 欧美日本一区二区| 91黄色免费版| 欧美日韩中文字幕一区| 日韩欧美国产精品一区| 亚洲婷婷综合色高清在线| 日本成人在线电影网| 国产成人精品三级| 欧美理论在线播放| 欧美国产日韩亚洲一区| 日本不卡一区二区三区 | 国产精品福利在线播放| 日韩成人av影视| 91在线视频官网| 日韩一区二区免费电影| 亚洲精品欧美激情| 精品综合久久久久久8888| 欧美主播一区二区三区美女| 国产日韩精品一区二区浪潮av | 久久综合中文字幕| 亚洲激情校园春色| 国产精品99久久久久久宅男| 欧美日韩亚洲综合在线| 国产精品免费久久久久| 老司机一区二区| 91高清视频免费看| 国产精品欧美一级免费| 国内精品免费**视频| 91超碰这里只有精品国产| 1区2区3区欧美| 国产成人一区在线| 3atv在线一区二区三区| 国产精品美女久久久久久2018| 亚洲国产综合91精品麻豆| 不卡视频一二三| 国产精品第五页| 国产精品亚洲成人| 久久综合成人精品亚洲另类欧美| 国产精品美女久久久久久久网站| 国产综合色视频| 日韩一级高清毛片| 亚洲成a天堂v人片| 欧美日韩国产高清一区| 一区二区三区不卡在线观看| 91在线码无精品| 自拍偷在线精品自拍偷无码专区| 国产成人精品免费网站| 欧美国产日韩a欧美在线观看| 国产一区二区在线视频| 26uuu亚洲综合色| 精品无人码麻豆乱码1区2区| 日韩欧美成人一区二区| 青青草97国产精品免费观看 | 亚洲男同1069视频| 99麻豆久久久国产精品免费 | 精品国产一二三区| 国产美女精品人人做人人爽| 久久久噜噜噜久久人人看 | 日韩三级视频中文字幕| 蜜桃视频一区二区| 久久综合狠狠综合久久综合88| 国产一区二区0| 久久综合狠狠综合久久激情| 国产很黄免费观看久久| 国产视频一区在线观看 | 欧美午夜寂寞影院| 美女视频网站黄色亚洲| 精品人在线二区三区| 激情久久久久久久久久久久久久久久| 精品久久久网站| 国产揄拍国内精品对白| 久久久国产午夜精品| 成人免费视频国产在线观看| 亚洲女子a中天字幕| 欧美一区二区三区在线看| 极品少妇一区二区| 中文字幕一区二区三区不卡在线| 成人做爰69片免费看网站| 亚洲品质自拍视频网站| 91精品国产全国免费观看| 国精产品一区一区三区mba视频| 国产精品久久久久国产精品日日| 在线视频欧美精品| 久久福利视频一区二区| 国产亚洲婷婷免费| 欧美日韩三级一区二区| 国产高清不卡一区| 午夜不卡av在线| 国产欧美日韩一区二区三区在线观看| 在线亚洲免费视频| 久久国产精品72免费观看| 亚洲丝袜自拍清纯另类| 欧美mv日韩mv亚洲| 欧洲视频一区二区| 岛国精品在线播放| 男男视频亚洲欧美| 中文字幕字幕中文在线中不卡视频| 欧美亚洲国产bt| 成人av电影在线网| 亚洲自拍另类综合| 欧美xxxxx牲另类人与| 日本精品免费观看高清观看| 国产一区二区剧情av在线| 亚洲国产日韩在线一区模特| 久久精品一级爱片| 欧美一区二区三区四区高清 | 国产精品色在线| 日韩欧美中文一区| 欧洲av在线精品| 91一区一区三区| 国产剧情一区在线| 天堂在线亚洲视频| 国产精品少妇自拍| 国产亚洲欧洲一区高清在线观看| 欧美日韩一区二区三区视频| av电影天堂一区二区在线观看| 久久99九九99精品| 美洲天堂一区二卡三卡四卡视频 | www.欧美日韩| 国产成a人无v码亚洲福利| 午夜精品福利一区二区蜜股av | 亚洲va在线va天堂| 一区二区三区在线观看欧美| 国产精品女同一区二区三区| 久久久精品欧美丰满| 精品福利一区二区三区| 欧美电视剧免费全集观看| 色综合天天综合给合国产| 成人福利视频网站| a美女胸又www黄视频久久| www.av亚洲| 欧美日韩亚洲另类| 精品国产免费人成在线观看| 国产亚洲欧美日韩日本| 日韩美女精品在线| 日韩国产高清影视| 国产精品一区三区| 一本色道久久综合亚洲精品按摩| 精品视频在线免费看| 日韩一级大片在线观看| 国产精品免费网站在线观看| 亚洲国产精品视频| 久久精品噜噜噜成人88aⅴ| 国产成人精品免费在线| 日本丶国产丶欧美色综合| 91.麻豆视频| 国产精品免费人成网站| 亚洲成国产人片在线观看| 韩国三级电影一区二区| 色网综合在线观看| 日韩午夜av一区| 亚洲免费观看高清完整| 全国精品久久少妇| 99久久国产综合色|国产精品| 欧美精品在线观看一区二区| 国产亚洲一区二区三区四区 | 亚洲欧美日韩人成在线播放| 亚洲一区二区三区免费视频| 精品一区二区三区在线播放 | 欧美mv和日韩mv国产网站| 日韩理论在线观看| 黄色精品一二区| 色噜噜狠狠一区二区三区果冻| 日韩视频123| 一区二区成人在线观看| 国产精品一级片| 欧美日韩aaaaa| 国产精品久久久久久久岛一牛影视| 日本va欧美va精品| 91福利在线播放| 欧美高清在线视频| 精品无人码麻豆乱码1区2区 | 欧美在线啊v一区| 国产精品进线69影院| 国内外精品视频| 91精品免费观看| 亚洲国产婷婷综合在线精品| 成人av在线一区二区| 久久综合网色—综合色88| 亚洲超丰满肉感bbw| 一本色道a无线码一区v| 欧美激情艳妇裸体舞| 国产夫妻精品视频| 欧美mv和日韩mv国产网站| 日本成人在线视频网站| 欧美精品国产精品| 亚洲在线成人精品| 在线日韩av片| 一区二区三区 在线观看视频| 成人激情电影免费在线观看| 欧美精品一区二区久久久| 日本大胆欧美人术艺术动态| 91麻豆精品国产自产在线| 亚洲成a人在线观看| 欧美美女一区二区| 日韩黄色免费电影| 4438x成人网最大色成网站|