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

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

?? lbspeedbutton.pas

?? 一個delphi的第三方控件 XP按鈕一個delphi的第三方控件 XP按鈕一個delphi的第三方控件 XP按鈕
?? PAS
字號:
unit LbSpeedButton;

interface

uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LbButtons;

type
   TLbSpeedButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);
   TLbSpeedButtonStyle = (bsNormal, bsEncarta, bsModern);

   TLbSpeedButton = class(TGraphicControl)
   private
      FAlignment: TAlignment;
      FAllowAllUp: boolean;
      FCaption: TCaption;
      FColorWhenDown: TColor;
      FDown: boolean;
      FFlat: boolean;
      FGlyph: TBitmap;
      FGroupIndex: integer;
      FHotTrackColor: TColor;
      FLayout: TLbSpeedButtonLayout;
      FLightColor: TColor;
      FNumGlyphs: integer;
      FShadowColor: TColor;
      FStyle: TLbSpeedButtonStyle;
      FTransparent: boolean;
      FOnMouseEnter: TNotifyEvent;
      FOnMouseExit: TNotifyEvent;
      FDummyStyle: TLbColorStyle;

      bCursorOnButton: boolean;
   public
      constructor Create(aOwner: TComponent); override;
      destructor Destroy; override;
      procedure Click; override;
   protected
      procedure Paint; override;

      procedure SetAlignment(fNew: TAlignment);
      procedure SetFlat(fNew: boolean);
      procedure SetColorWhenDown(fNew: TColor);
      procedure SetColorStyle(fNew: TLbColorStyle);
      procedure SetDown(fNew: boolean);
      procedure SetCaption(const fNew: TCaption);
      procedure SetGlyph(fNew: TBitmap);
      procedure SetGroupIndex(fNew: integer);
      procedure SetLayout(fNew: TLbSpeedButtonLayout);
      procedure SetLightColor(fNew: TColor);
      procedure SetNumGlyphs(fNew: integer);
      procedure SetShadowColor(fNew: TColor);
      procedure SetStyle(fNew: TLbSpeedButtonStyle);
      procedure SetTransparent(fNew: boolean);

      procedure DoMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
      procedure DoMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
      procedure DoDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;

      procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
      procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
   published
      property Align;
      property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
      property AllowAllUp: boolean read FAllowAllUp write FAllowAllUp default false;
      property Caption: TCaption read FCaption write SetCaption;
      property Color;
      property ColorWhenDown: TColor read FColorWhenDown write SetColorWhenDown default clNone;
      property ColorStyle: TLbColorStyle read FDummyStyle write SetColorStyle default lcsCustom;
      property Down: boolean read FDown write SetDown default false;
      property Enabled;
      property Flat: boolean read FFlat write SetFlat default false;
      property Font;
      property Glyph: TBitmap read FGlyph write SetGlyph;
      property GroupIndex: integer read FGroupIndex write SetGroupIndex default 0;
      property HotTrackColor: TColor read FHotTrackColor write FHotTrackColor default clNone;
      property Hint;
      property Layout: TLbSpeedButtonLayout read FLayout write SetLayout default blGlyphLeft;
      property LightColor: TColor read FLightColor write SetLightColor default clWhite;
      property NumGlyphs: integer read FNumGlyphs write SetNumGlyphs default 0;
      property ParentColor;
      property ParentFont;
      property ParentShowHint;
      property PopupMenu;
      property ShadowColor: TColor read FShadowColor write SetShadowColor default clBlack;
      property ShowHint;
      property Style: TLbSpeedButtonStyle read FStyle write SetStyle default bsNormal;
      property Transparent: boolean read FTransparent write SetTransparent default false;
      property Visible;

      property OnClick;
      property OnDblClick;
      property OnMouseDown;
      property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
      property OnMouseExit: TNotifyEvent read FOnMouseExit write FOnMouseExit;
      property OnMouseMove;
      property OnMouseUp;
   end;

procedure Register;

implementation

{##############################################################################}

procedure Register;
begin
   RegisterComponents('MyControl', [TLbSpeedButton]);
end;

{##############################################################################}

constructor TLbSpeedButton.Create(aOwner: TComponent);
begin
   inherited;

   ControlStyle := ControlStyle + [csSetCaption];
   ControlStyle := ControlStyle - [csOpaque];

   Height := 23;
   Width := 100;
   Caption:='SpeedButton';
   bCursorOnButton := false;
   FLightColor := clWhite;
   FShadowColor := clBlack;
   FColorWhenDown := clNone;
   FHotTrackColor := clNone;
   FAlignment := taLeftJustify;
   FDummyStyle := lcsCustom;

   FGlyph := TBitmap.Create;
end;

{##############################################################################}

destructor TLbSpeedButton.Destroy;
begin
   FGlyph.Free;
   inherited;
end;

{##############################################################################}

procedure TLbSpeedButton.SetAlignment(fNew: TAlignment);
begin
   FAlignment := fNew;
   if FTransparent then invalidate else paint;  // Could have generally used invalidate, but why make it flicker if it is not transparent?
end;

{##############################################################################}

procedure TLbSpeedButton.SetCaption(const fNew: TCaption);
begin
   FCaption := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetColorWhenDown(fNew: TColor);
begin
   FColorWhenDown := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetColorStyle(fNew: TLbColorStyle);
var
   bModern: boolean;
   FColor: TColor;

begin
   if fNew = lcsCustom then exit;
   
   GetPreDefinedColors(fNew, FColor, FLightColor, FShadowColor, FColorWhenDown, FHotTrackColor, FFlat, bModern);
   Color := FColor;
   if bModern then FStyle := bsModern else FStyle := bsNormal;
   Paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetDown(fNew: boolean);
var
   i: integer;

begin
   if FDown = fNew then exit;

   // If grouped, set all siblings to down=false
   if GroupIndex <> 0 then
      for i := 0 to Parent.ControlCount-1 do
         if Parent.Controls[i] is TLbSpeedButton then
            if TLbSpeedButton(Parent.Controls[i]).GroupIndex = GroupIndex then
               if TLbSpeedButton(Parent.Controls[i]) <> self then
                  TLbSpeedButton(Parent.Controls[i]).Down := false;

   FDown := fNew;

   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetFlat(fNew: boolean);
begin
   FFlat := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetGlyph(fNew: TBitmap);
begin
   if fNew <> nil then
   begin
      FGlyph.Assign(fNew);
      if fNew.Height <> 0 then FNumGlyphs := fNew.Width div fNew.Height else FNumGlyphs := 0;
   end
   else
   begin
      FGlyph.Height := 0;
      FNumGlyphs := 0;
   end;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetGroupIndex(fNew: integer);
begin
   FGroupIndex := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetLayout(fNew: TLbSpeedButtonLayout);
begin
   FLayout := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetLightColor(fNew: TColor);
begin
   FLightColor := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetNumGlyphs(fNew: integer);
begin
   FNumGlyphs := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetShadowColor(fNew: TColor);
begin
   FShadowColor := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetStyle(fNew: TLbSpeedButtonStyle);
begin
   if GetDeviceCaps(Canvas.Handle, BITSPIXEL) <= 8 then if not (csDesigning in ComponentState) then fNew := bsNormal;
   FStyle := fNew;
   if fNew = bsModern then FAlignment := taCenter;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.SetTransparent(fNew: boolean);
begin
   FTransparent := fNew;
   if FTransparent then invalidate else paint;
end;

{##############################################################################}

procedure TLbSpeedButton.Paint;
var
   aStyle: TLbButtonStyle;
   aLayout: TLbButtonLayout;
   aBitmap: TBitmap;

begin
   if not (Visible or (csDesigning in ComponentState)) or (csLoading in ComponentState) then exit;

   aStyle := LbButtons.bsNormal;
   case FStyle of
      bsEncarta:  aStyle := LbButtons.bsEncarta;
      bsModern:   aStyle := LbButtons.bsModern;
   end;

   aLayout := LbButtons.blGlyphLeft;
   case FLayout of
      blGlyphTop:    aLayout := LbButtons.blGlyphTop;
      blGlyphRight:  aLayout := LbButtons.blGlyphRight;
      blGlyphBottom: aLayout := LbButtons.blGlyphBottom;
   end;

   if FTransparent or (FStyle = bsModern) then
   begin
      LbPaintButton(Canvas, Width, Height, FNumGlyphs, FGlyph, FDown, bCursorOnButton, FTransparent, Enabled, Flat, assigned(PopupMenu), aStyle, Color, FColorWhenDown, FHotTrackColor, FLightColor, FShadowColor, Font, aLayout, FCaption, FAlignment);
   end
   else
   begin
      // Draw on a Bitmap first, then just copy the Bitmap to the Canvas. Just to avoid flickering...
      aBitmap := TBitmap.Create;
      aBitmap.Height := Height;
      aBitmap.Width := Width;
      LbPaintButton(aBitmap.Canvas, Width, Height, FNumGlyphs, FGlyph, FDown, bCursorOnButton, false, Enabled, Flat, assigned(PopupMenu), aStyle, Color, FColorWhenDown, FHotTrackColor, FLightColor, FShadowColor, Font, aLayout, FCaption, FAlignment);
      Canvas.Draw(0, 0, aBitmap);
      aBitmap.Free;
   end;
end;

{##############################################################################}

procedure TLbSpeedButton.DoMouseEnter(var Msg: TMessage);
begin
   bCursorOnButton := true;
   if FTransparent then invalidate else paint;
   if assigned(FOnMouseEnter) then FOnMouseEnter(self);
end;

{##############################################################################}

procedure TLbSpeedButton.DoMouseLeave(var Msg: TMessage);
begin
   bCursorOnButton := false;
   if FTransparent then invalidate else paint;
   if assigned(FOnMouseExit) then FOnMouseExit(self);
end;

{##############################################################################}

procedure TLbSpeedButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   inherited;
   if GroupIndex = 0 then Down := true
   else
   begin
      if Down then
      begin
         if FAllowAllUp then Down := false;
      end
      else
         Down := true;
   end;
end;

{##############################################################################}

procedure TLbSpeedButton.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   inherited;
   if GroupIndex = 0 then Down := false;
end;

{##############################################################################}

procedure TLbSpeedButton.DoDialogChar(var Message: TCMDialogChar);
var
   bWasDown: boolean;

begin
   with Message do
   begin
      if IsAccel(CharCode, Caption) and Enabled and Visible and (Parent <> nil) and Parent.Showing then
      begin
         bWasDown := Down;
         Down := true;
         Paint;
         Click;
         Down := bWasDown;
         Paint;
         Result := 1;
      end
      else
         inherited;
   end;
end;

{##############################################################################}

procedure TLbSpeedButton.Click;
begin
   if assigned(PopupMenu) then PopupMenu.PopUp(ClientToScreen(Point(0, Height)).X, ClientToScreen(Point(0, Height)).Y);
   inherited;  // just to make it public :-)
end;

{##############################################################################}

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级生活片| 午夜激情一区二区三区| 亚洲高清免费在线| 国产精品影视天天线| 欧美唯美清纯偷拍| 亚洲国产精品成人综合| 久久精品久久久精品美女| 色婷婷综合中文久久一本| 国产亚洲精品超碰| 麻豆中文一区二区| 欧美日韩免费观看一区三区| 国产精品成人免费在线| 国产一区在线看| 日韩欧美电影在线| 免费看欧美美女黄的网站| 91黄色小视频| 一区二区三区视频在线观看| 波多野结衣在线一区| 26uuuu精品一区二区| 免费欧美高清视频| 日韩午夜av一区| 日韩二区在线观看| 538在线一区二区精品国产| 亚洲成人www| 欧美视频中文字幕| 亚洲电影你懂得| 欧美日韩第一区日日骚| 亚洲国产精品久久不卡毛片| 欧美三级乱人伦电影| 亚洲福利一二三区| 欧美日韩一区二区三区在线看| 亚洲自拍偷拍欧美| 欧美私人免费视频| 首页亚洲欧美制服丝腿| 91精品国产日韩91久久久久久| 日本亚洲电影天堂| 日韩精品一区二区三区四区| 久久av老司机精品网站导航| 久久精品欧美一区二区三区不卡 | 亚洲女人的天堂| av在线一区二区| 亚洲欧美日韩国产成人精品影院| 一本色道久久综合狠狠躁的推荐 | 欧美视频一区二区三区在线观看| 亚洲精品久久7777| 欧美日韩精品一区二区三区| 日本伊人色综合网| 久久久久久免费毛片精品| 国产精品一区二区三区99| 国产精品乱码久久久久久| 91黄色免费版| 奇米777欧美一区二区| 久久久五月婷婷| 99久久99久久综合| 亚洲成人在线网站| 久久久精品免费网站| 92精品国产成人观看免费 | 欧美一区二区免费视频| 激情小说亚洲一区| 日韩美女视频一区| 欧美日韩国产首页在线观看| 精品一区二区三区免费| 亚洲天堂中文字幕| 日韩一级免费观看| 97久久超碰国产精品电影| 日韩1区2区3区| 中文字幕五月欧美| 91精品国产高清一区二区三区| 国产美女一区二区三区| 亚洲综合免费观看高清完整版 | 国产91对白在线观看九色| 亚洲一二三区在线观看| 26uuu久久综合| 在线免费观看视频一区| 韩国一区二区在线观看| 一区二区激情小说| 久久久久久电影| 欧美日韩国产电影| 99免费精品视频| 国产一区二区三区四区在线观看| 亚洲影院理伦片| 国产日韩成人精品| 欧美一区二区观看视频| 91精品福利视频| 国产成人在线色| 免费成人在线网站| 一区二区三区精品视频| 国产精品免费网站在线观看| 日韩精品一区二区三区在线播放 | 日韩欧美在线网站| 91国产丝袜在线播放| 国产成人免费高清| 久久99久久久久| 日韩综合一区二区| 亚洲午夜羞羞片| 亚洲欧美色一区| 国产精品成人网| 国产日韩欧美一区二区三区乱码 | 精品视频在线看| 91视频com| 99久久夜色精品国产网站| 国产精品一二三| 狠狠久久亚洲欧美| 免费av网站大全久久| 五月婷婷综合激情| 亚洲国产日韩一区二区| 亚洲精选视频免费看| 亚洲人成影院在线观看| 国产精品理伦片| 亚洲欧洲国产日本综合| 国产精品色在线观看| 亚洲国产岛国毛片在线| 国产精品久久影院| 中文字幕一区二区三区色视频| 欧美极品美女视频| 国产精品久久久久久久久免费樱桃 | 亚洲精品国产a久久久久久| 综合网在线视频| 一区二区欧美视频| 亚洲成人久久影院| 秋霞午夜鲁丝一区二区老狼| 日本系列欧美系列| 精彩视频一区二区三区| 国产一区二区三区蝌蚪| 国产精品一区二区视频| 东方欧美亚洲色图在线| 波多野结衣中文字幕一区二区三区 | 欧美大肚乱孕交hd孕妇| 欧美精品一区二区三| 国产人伦精品一区二区| 亚洲欧洲美洲综合色网| 亚洲激情五月婷婷| 亚洲成av人在线观看| 蜜臀a∨国产成人精品| 激情文学综合网| 99久久久久久| 6080国产精品一区二区| 久久精品视频免费| 一区二区三区四区蜜桃| 视频一区二区不卡| 国产一区二区精品久久99| 成人久久18免费网站麻豆| 91麻豆精品视频| 91精品国产91久久综合桃花| 久久久99久久精品欧美| 亚洲免费大片在线观看| 美女视频一区二区| 成人免费视频一区| 欧美亚洲高清一区二区三区不卡| 精品理论电影在线观看| 一区二区日韩av| 国产一区二区中文字幕| 色婷婷av久久久久久久| 亚洲精品在线观看网站| 亚洲另类春色校园小说| 久久99九九99精品| 欧美色国产精品| 中文字幕欧美日韩一区| 日欧美一区二区| 99国内精品久久| 久久久久久久电影| 日日摸夜夜添夜夜添亚洲女人| 国产一区二区三区观看| 在线视频一区二区三| 欧美韩日一区二区三区四区| 日韩va欧美va亚洲va久久| 99re视频这里只有精品| 久久这里只有精品首页| 丝袜a∨在线一区二区三区不卡| 99精品国产91久久久久久| 2021国产精品久久精品| 日韩国产欧美一区二区三区| 色婷婷精品久久二区二区蜜臀av | 狠狠色综合色综合网络| 欧美私人免费视频| 亚洲色欲色欲www| 国产精品小仙女| 精品入口麻豆88视频| 视频一区在线播放| 色哦色哦哦色天天综合| 国产精品麻豆视频| 国产精品99久久久久久似苏梦涵| 欧美一区二区三区思思人| 亚洲一级不卡视频| 色94色欧美sute亚洲线路一ni | 国产女人水真多18毛片18精品视频 | 在线播放亚洲一区| www.亚洲免费av| 1024成人网| 国产乱码精品一区二区三| 欧美精品亚洲一区二区在线播放| 中文字幕在线观看不卡视频| 国内成人精品2018免费看| 日韩免费高清视频| 麻豆精品在线播放| 欧美一二三区在线观看| 蜜臀a∨国产成人精品| 日韩欧美一区二区久久婷婷| 蜜臀91精品一区二区三区| 日韩丝袜情趣美女图片|