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

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

?? tntbuttons.pas

?? Delphi知道現在也沒有提供Unicode支持
?? PAS
?? 第 1 頁 / 共 3 頁
字號:

{*****************************************************************************}
{                                                                             }
{    Tnt Delphi Unicode Controls                                              }
{      http://www.tntware.com/delphicontrols/unicode/                         }
{        Version: 2.3.0                                                       }
{                                                                             }
{    Copyright (c) 2002-2007, Troy Wolbrink (troy.wolbrink@tntware.com)       }
{                                                                             }
{*****************************************************************************}

unit TntButtons;

{$INCLUDE TntCompilers.inc}

interface

uses
  Windows, Messages, Classes, Controls, Graphics, StdCtrls,
  ExtCtrls, CommCtrl, Buttons,
  TntControls;

type
  ITntGlyphButton = interface
    ['{15D7E501-1E33-4293-8B45-716FB3B14504}']
    function GetButtonGlyph: Pointer;
    procedure UpdateInternalGlyphList;
  end;

{TNT-WARN TSpeedButton}
  TTntSpeedButton = class(TSpeedButton {TNT-ALLOW TSpeedButton}, ITntGlyphButton)
  private
    FPaintInherited: Boolean;
    function GetCaption: TWideCaption;
    procedure SetCaption(const Value: TWideCaption);
    function GetHint: WideString;
    procedure SetHint(const Value: WideString);
    function IsCaptionStored: Boolean;
    function IsHintStored: Boolean;
    procedure CMHintShow(var Message: TMessage); message CM_HINTSHOW;
    procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
  protected
    function GetButtonGlyph: Pointer;
    procedure UpdateInternalGlyphList; dynamic;
    procedure PaintButton; dynamic;
    procedure Paint; override;
    procedure DefineProperties(Filer: TFiler); override;
    function GetActionLinkClass: TControlActionLinkClass; override;
    procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
  published
    property Caption: TWideCaption read GetCaption write SetCaption stored IsCaptionStored;
    property Hint: WideString read GetHint write SetHint stored IsHintStored;
  end;

{TNT-WARN TBitBtn}
  TTntBitBtn = class(TBitBtn {TNT-ALLOW TBitBtn}, ITntGlyphButton)
  private
    FPaintInherited: Boolean;
    FMouseInControl: Boolean;
    function IsCaptionStored: Boolean;
    function GetCaption: TWideCaption;
    procedure SetCaption(const Value: TWideCaption);
    function IsHintStored: Boolean;
    function GetHint: WideString;
    procedure SetHint(const Value: WideString);
    procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
    procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
    procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
  protected
    function GetButtonGlyph: Pointer;
    procedure UpdateInternalGlyphList; dynamic;
    procedure DrawItem(const DrawItemStruct: TDrawItemStruct); dynamic;
    procedure CreateWindowHandle(const Params: TCreateParams); override;
    procedure DefineProperties(Filer: TFiler); override;
    function GetActionLinkClass: TControlActionLinkClass; override;
    procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
  published
    property Caption: TWideCaption read GetCaption write SetCaption stored IsCaptionStored;
    property Hint: WideString read GetHint write SetHint stored IsHintStored;
  end;

procedure TButtonGlyph_CalcButtonLayout(Control: TControl; DC: HDC; const Client: TRect;
  const Offset: TPoint; const Caption: WideString; Layout: TButtonLayout;
    Margin, Spacing: Integer; var GlyphPos: TPoint; var TextBounds: TRect;
    BiDiFlags: Integer {$IFDEF COMPILER_7_UP}; WordWrap: Boolean {$ENDIF});

function TButtonGlyph_Draw(Control: TControl; Canvas: TCanvas; const Client: TRect;
  const Offset: TPoint; const Caption: WideString; Layout: TButtonLayout; Margin: Integer;
    Spacing: Integer; State: TButtonState; Transparent: Boolean;
    BiDiFlags: Longint {$IFDEF COMPILER_7_UP}; WordWrap: Boolean {$ENDIF}): TRect;

implementation

uses                                      
  SysUtils, ActnList, TntForms, TntStdCtrls, TypInfo, RTLConsts, TntWindows,
  {$IFDEF THEME_7_UP} Themes, {$ENDIF} TntClasses, TntActnList, TntSysUtils;

type
  EAbortPaint = class(EAbort);

// Many routines in this unit are nearly the same as those found in Buttons.pas.  They are
//   included here because the VCL implementation of TButtonGlyph is completetly inaccessible.

type
  THackButtonGlyph_D6_D7_D9 = class
  protected
    FOriginal: TBitmap;
    FGlyphList: TImageList;
    FIndexs: array[TButtonState] of Integer;
    FxxxxTransparentColor: TColor;
    FNumGlyphs: TNumGlyphs;
  end;

  THackBitBtn_D6_D7_D9 = class(TButton{TNT-ALLOW TButton})
  protected
    FCanvas: TCanvas;
    FGlyph: Pointer;
    FxxxxStyle: TButtonStyle;
    FxxxxKind: TBitBtnKind;
    FxxxxLayout: TButtonLayout;
    FxxxxSpacing: Integer;
    FxxxxMargin: Integer;
    IsFocused: Boolean;
  end;

  THackSpeedButton_D6_D7_D9 = class(TGraphicControl)
  protected
    FxxxxGroupIndex: Integer;
    FGlyph: Pointer;
    FxxxxDown: Boolean;
    FDragging: Boolean;
  end;

  {$IFDEF COMPILER_6} // verified against VCL source in Delphi 6 and BCB 6
  THackButtonGlyph = THackButtonGlyph_D6_D7_D9;
  THackBitBtn      = THackBitBtn_D6_D7_D9;
  THackSpeedButton = THackSpeedButton_D6_D7_D9;
  {$ENDIF}
  {$IFDEF DELPHI_7} // verified against VCL source in Delphi 7
  THackButtonGlyph = THackButtonGlyph_D6_D7_D9;
  THackBitBtn      = THackBitBtn_D6_D7_D9;
  THackSpeedButton = THackSpeedButton_D6_D7_D9;
  {$ENDIF}
  {$IFDEF DELPHI_9} // verified against VCL source in Delphi 9
  THackButtonGlyph = THackButtonGlyph_D6_D7_D9;
  THackBitBtn      = THackBitBtn_D6_D7_D9;
  THackSpeedButton = THackSpeedButton_D6_D7_D9;
  {$ENDIF}
  {$IFDEF DELPHI_10} // verified against VCL source in Delphi 10
  THackButtonGlyph = THackButtonGlyph_D6_D7_D9;
  THackBitBtn      = THackBitBtn_D6_D7_D9;
  THackSpeedButton = THackSpeedButton_D6_D7_D9;
  {$ENDIF}

function GetButtonGlyph(Control: TControl): THackButtonGlyph;
var
  GlyphButton: ITntGlyphButton;
begin
  if Control.GetInterface(ITntGlyphButton, GlyphButton) then
    Result := GlyphButton.GetButtonGlyph
  else
    raise ETntInternalError.Create('Internal Error: Control does not support ITntGlyphButton.');
end;

procedure UpdateInternalGlyphList(Control: TControl);
var
  GlyphButton: ITntGlyphButton;
begin
  if Control.GetInterface(ITntGlyphButton, GlyphButton) then
    GlyphButton.UpdateInternalGlyphList
  else
    raise ETntInternalError.Create('Internal Error: Control does not support ITntGlyphButton.');
end;

function TButtonGlyph_CreateButtonGlyph(Control: TControl; State: TButtonState): Integer;
var
  ButtonGlyph: THackButtonGlyph;
  NumGlyphs: Integer;
begin
  ButtonGlyph := GetButtonGlyph(Control);
  NumGlyphs := ButtonGlyph.FNumGlyphs;

  if (State = bsDown) and (NumGlyphs < 3) then State := bsUp;
  Result := ButtonGlyph.FIndexs[State];
  if (Result = -1) then begin
    UpdateInternalGlyphList(Control);
    Result := ButtonGlyph.FIndexs[State];
  end;
end;

procedure TButtonGlyph_DrawButtonGlyph(Control: TControl; Canvas: TCanvas; const GlyphPos: TPoint;
  State: TButtonState; Transparent: Boolean);
var
  ButtonGlyph: THackButtonGlyph;
  Glyph: TBitmap;
  GlyphList: TImageList;
  Index: Integer;
  {$IFDEF THEME_7_UP}
  Details: TThemedElementDetails;
  R: TRect;
  Button: TThemedButton;
  {$ENDIF}
begin
  ButtonGlyph := GetButtonGlyph(Control);
  Glyph := ButtonGlyph.FOriginal;
  GlyphList := ButtonGlyph.FGlyphList;
  if Glyph = nil then Exit;
  if (Glyph.Width = 0) or (Glyph.Height = 0) then Exit;
  Index := TButtonGlyph_CreateButtonGlyph(Control, State);
  with GlyphPos do
  {$IFDEF THEME_7_UP}
  if ThemeServices.ThemesEnabled then begin
    R.TopLeft := GlyphPos;
    R.Right := R.Left + Glyph.Width div ButtonGlyph.FNumGlyphs;
    R.Bottom := R.Top + Glyph.Height;
    case State of
      bsDisabled:
        Button := tbPushButtonDisabled;
      bsDown,
      bsExclusive:
        Button := tbPushButtonPressed;
    else
      // bsUp
      Button := tbPushButtonNormal;
    end;
    Details := ThemeServices.GetElementDetails(Button);
    ThemeServices.DrawIcon(Canvas.Handle, Details, R, GlyphList.Handle, Index);
  end else
  {$ENDIF}
    if Transparent or (State = bsExclusive) then
      ImageList_DrawEx(GlyphList.Handle, Index, Canvas.Handle, X, Y, 0, 0,
        clNone, clNone, ILD_Transparent)
    else
      ImageList_DrawEx(GlyphList.Handle, Index, Canvas.Handle, X, Y, 0, 0,
        ColorToRGB(clBtnFace), clNone, ILD_Normal);
end;

procedure TButtonGlyph_DrawButtonText(Canvas: TCanvas; const Caption: WideString;
  TextBounds: TRect; State: TButtonState;
    BiDiFlags: LongInt {$IFDEF COMPILER_7_UP}; WordWrap: Boolean {$ENDIF});
begin
  with Canvas do
  begin
    Brush.Style := bsClear;
    if State = bsDisabled then
    begin
      OffsetRect(TextBounds, 1, 1);
      Font.Color := clBtnHighlight;

      {$IFDEF COMPILER_7_UP}
      if WordWrap then
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_VCENTER or BiDiFlags or DT_WORDBREAK) 
      else
      {$ENDIF}
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_VCENTER or BiDiFlags);

      OffsetRect(TextBounds, -1, -1);
      Font.Color := clBtnShadow;

      {$IFDEF COMPILER_7_UP}
      if WordWrap then
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_WORDBREAK or BiDiFlags) { TODO: Figure out why DT_VCENTER is not used }
      else
      {$ENDIF}
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_VCENTER or BiDiFlags);

    end else
    begin
      {$IFDEF COMPILER_7_UP}
      if WordWrap then
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_WORDBREAK or BiDiFlags) { TODO: Figure out why DT_VCENTER is not used }
      else
      {$ENDIF}
        Tnt_DrawTextW(Handle, PWideChar(Caption), Length(Caption), TextBounds,
          DT_CENTER or DT_VCENTER or BiDiFlags);
    end;
  end;
end;

procedure TButtonGlyph_CalcButtonLayout(Control: TControl; DC: HDC; const Client: TRect;
  const Offset: TPoint; const Caption: WideString; Layout: TButtonLayout;
    Margin, Spacing: Integer; var GlyphPos: TPoint; var TextBounds: TRect;
      BiDiFlags: Integer {$IFDEF COMPILER_7_UP}; WordWrap: Boolean {$ENDIF});
var
  TextPos: TPoint;
  ClientSize,
  GlyphSize,
  TextSize: TPoint;
  TotalSize: TPoint;
  Glyph: TBitmap;
  NumGlyphs: Integer;
  ButtonGlyph: THackButtonGlyph;
begin
  ButtonGlyph := GetButtonGlyph(Control);
  Glyph := ButtonGlyph.FOriginal;
  NumGlyphs := ButtonGlyph.FNumGlyphs;

  if (BiDiFlags and DT_RIGHT) = DT_RIGHT then
    if Layout = blGlyphLeft then
      Layout := blGlyphRight
    else
      if Layout = blGlyphRight then
        Layout := blGlyphLeft;

  // Calculate the item sizes.
  ClientSize := Point(Client.Right - Client.Left, Client.Bottom - Client.Top);

  if Assigned(Glyph) then
    GlyphSize := Point(Glyph.Width div NumGlyphs, Glyph.Height)
  else
    GlyphSize := Point(0, 0);

  if Length(Caption) > 0 then
  begin
    {$IFDEF COMPILER_7_UP}
    TextBounds := Rect(0, 0, Client.Right - Client.Left - GlyphSize.X - 3, 0); { TODO: Figure out why GlyphSize.X is in here. }
    {$ELSE}
    TextBounds := Rect(0, 0, Client.Right - Client.Left, 0);
    {$ENDIF}

    {$IFDEF COMPILER_7_UP}
    if WordWrap then

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产最新精品免费| 亚洲黄色免费网站| 日日夜夜精品视频天天综合网| 久久电影国产免费久久电影| 欧美性大战久久久久久久| 日本一区二区高清| 国产一区二区美女| 精品国产伦一区二区三区观看体验| 亚洲一区二区三区国产| 91香蕉视频mp4| 最新国产成人在线观看| 国产成人精品免费一区二区| 日韩欧美一级精品久久| 午夜激情一区二区三区| 欧美日韩一级二级| 亚洲一二三区不卡| 欧美日韩成人综合| 粉嫩av一区二区三区粉嫩| 欧美一区二区黄色| 黄色成人免费在线| 国产日本欧美一区二区| 成人性生交大片免费看中文| 久久久www免费人成精品| 国产成人欧美日韩在线电影| 中文字幕av不卡| 91啪亚洲精品| 午夜精品福利一区二区蜜股av| 91精品中文字幕一区二区三区| 日韩高清欧美激情| 精品久久久久久最新网址| 国产精品一区二区黑丝| 中文字幕在线不卡一区| 欧美日韩免费电影| 精品写真视频在线观看| 国产精品麻豆网站| 欧美日韩精品一区二区三区| 蜜桃久久久久久| 中文字幕制服丝袜成人av| 欧美吻胸吃奶大尺度电影| 日韩精品亚洲专区| 国产精品欧美一区喷水| 欧美日韩视频在线观看一区二区三区| 日韩综合小视频| 欧美国产一区二区在线观看| 欧美三级电影在线看| 国产在线精品一区二区不卡了| 国产日韩精品一区| 7799精品视频| 成人动漫在线一区| 蜜桃av噜噜一区| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲男帅同性gay1069| 欧美一级淫片007| 欧洲一区在线电影| 成人av在线播放网址| 激情五月播播久久久精品| 国产一区在线观看视频| 亚洲欧美日韩国产成人精品影院 | 91在线观看污| 丁香天五香天堂综合| 日本va欧美va欧美va精品| 亚洲日本va午夜在线影院| 久久综合狠狠综合久久激情 | 综合av第一页| 中文字幕不卡在线| 久久久久久99精品| 26uuuu精品一区二区| 日韩欧美激情一区| 日韩视频免费直播| 日韩亚洲欧美综合| 日韩三级视频在线看| 69堂国产成人免费视频| 91精品国产综合久久久久久漫画| 日本道在线观看一区二区| 不卡的av中国片| 99在线视频精品| 91免费在线播放| 欧美性受极品xxxx喷水| 欧美日韩色综合| 欧美一区二区三区人| 欧美一区二区三区免费观看视频| 日韩一区二区在线看| 精品国产1区二区| 中文字幕不卡在线播放| 国产精品二三区| 午夜亚洲福利老司机| 蜜桃视频在线一区| 成人午夜短视频| 91丨九色丨蝌蚪富婆spa| 欧美亚洲另类激情小说| 日韩手机在线导航| 国产精品国产精品国产专区不片| 一区二区三区波多野结衣在线观看 | 色噜噜狠狠色综合中国| 欧美精品少妇一区二区三区| 精品精品国产高清一毛片一天堂| 国产丝袜在线精品| 五月天中文字幕一区二区| 国产精品主播直播| 欧美日韩国产精品成人| 国产夜色精品一区二区av| 亚洲综合区在线| 国产精品1024| 欧美日韩国产123区| 亚洲精品在线电影| 国产精品午夜久久| 亚洲va中文字幕| 国产乱码精品1区2区3区| 一本一道波多野结衣一区二区| 国产成人精品免费视频网站| 色八戒一区二区三区| 日本精品一区二区三区四区的功能| 337p亚洲精品色噜噜噜| 国产精品初高中害羞小美女文| 午夜精品久久久久久久99水蜜桃 | 日韩亚洲欧美综合| 亚洲天天做日日做天天谢日日欢 | 久久综合资源网| 一区二区免费在线播放| 久久精品免费观看| 欧美在线一二三四区| 国产亚洲综合av| 日本aⅴ精品一区二区三区| 9久草视频在线视频精品| 91精品中文字幕一区二区三区 | 精品午夜一区二区三区在线观看| 一本久道中文字幕精品亚洲嫩| 欧美精品一区二区久久久| 亚洲一区二区三区四区在线观看 | 精品久久久久香蕉网| 亚洲高清免费视频| 色婷婷综合视频在线观看| 国产亚洲精久久久久久| 另类专区欧美蜜桃臀第一页| 欧美日韩你懂的| 一区二区三国产精华液| 色综合夜色一区| 亚洲少妇最新在线视频| 久久www免费人成看片高清| 欧美日韩国产精选| 日韩av一区二区在线影视| 欧美性猛片aaaaaaa做受| 一区二区三区自拍| 精品视频1区2区| 日韩中文字幕av电影| 91精品国产91热久久久做人人| 日韩电影在线观看电影| 日本韩国精品一区二区在线观看| 亚洲区小说区图片区qvod| 日本精品视频一区二区| 午夜精品一区二区三区电影天堂| 欧美日本国产视频| 美女mm1313爽爽久久久蜜臀| 久久亚洲影视婷婷| 粉嫩高潮美女一区二区三区| 亚洲欧洲精品一区二区三区| 91浏览器在线视频| 天堂成人国产精品一区| 久久综合狠狠综合| 国产高清一区日本| 一区二区三区毛片| 欧美一级午夜免费电影| 国产91丝袜在线播放0| 一级女性全黄久久生活片免费| 欧美午夜电影网| 国产精品亚洲专一区二区三区 | 岛国av在线一区| 亚洲国产sm捆绑调教视频 | 激情丁香综合五月| 亚洲免费电影在线| 欧美大度的电影原声| 91在线观看视频| 国产一区激情在线| 亚洲高清免费观看高清完整版在线观看| 日韩精品一区在线观看| 日本韩国一区二区| 风流少妇一区二区| 中文字幕字幕中文在线中不卡视频| 欧美精品123区| 国产传媒欧美日韩成人| 日韩精品一级中文字幕精品视频免费观看 | 亚洲永久免费av| 欧美激情一区二区三区| 欧美色视频在线观看| 成人黄色小视频在线观看| 三级一区在线视频先锋| 亚洲欧美精品午睡沙发| 久久综合狠狠综合| 欧美日韩美女一区二区| 成人性生交大合| 黑人巨大精品欧美黑白配亚洲| 亚洲图片一区二区| 亚洲一区二区三区视频在线播放 | 国产精品电影院| 久久精品欧美日韩| 欧美吞精做爰啪啪高潮| 色一情一乱一乱一91av| 不卡的av网站| 99精品一区二区| 成人av午夜电影|