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

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

?? wwspeedbutton.pas

?? 勝天進銷存源碼,國產優秀的進銷存
?? PAS
字號:
{
//
// Components : TwwSpeedButton
//
// Copyright (c) 1998-2001 by Woll2Woll Software
//
// 10/7/98 - Fix paint problem with speedbutton when it is displayed the first time
//
// Enhancement requests
//   Add ability to specify glyph/caption relative positioning.
}

unit wwSpeedButton;

interface

{$i wwIfDef.pas}

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
     {$ifdef wwDelphi7Up}
     themes,
     {$endif}
     {$ifdef ThemeManager}
     thememgr, themesrv, uxtheme,
     {$endif}
  wwCommon, actnlist;

type
  TwwSpeedButton = class;

  TwwDisabledTextColors = class(TPersistent)
  private
    FShadeColor: TColor;
    FHighlightColor: TColor;
  published
    property ShadeColor : TColor read FShadeColor write FShadeColor;
    property HighlightColor : TColor read FHighlightColor write FHighlightColor;
  end;

  TwwSpeedButton = class(TGraphicControl, IUnknown)
  private
    FTransparent: Boolean;
    FFlat: Boolean;
    FImageIndex: Integer;
    FImageList: TImageList;
    FMargin: Integer;
    FNumGlyphs: Integer;
    FShowText: Boolean;
    FSpacing: Integer;
    FDisabledTextColors: TwwDisabledTextColors;

    FMouseInControl: Boolean;

    procedure SetTransparent(Value: Boolean);
    procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
    procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
  protected
    procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
    function GetImageIndex: Integer; virtual;
    procedure SetFlat(Value: Boolean);
    procedure SetImageIndex(Value: Integer); virtual;
    procedure SetImageList(Value: TImageList);
    procedure SetMargin(Value: Integer);
    procedure SetNumGlyphs(Value: Integer);
    procedure SetShowText(Value: Boolean);
    procedure SetSpacing(Value: Integer);

    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure Paint; override;

    // IUnknown
    {$ifdef ver110}
    function QueryInterface(const IID: TGUID; out Obj): HRESULT; reintroduce; stdcall;
    {$else}
    function QueryInterface(const IID: TGUID; out Obj): {$ifdef wwDelphi4Up}HRESULT; reintroduce{$else}Integer{$endif}; stdcall;
    {$endif}
    function _AddRef: Integer; stdcall;
    function _Release: Integer; stdcall;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    property ImageList: TImageList read FImageList write SetImageList;
    property Flat: Boolean read FFlat write SetFlat;
  published
    property Action;
    property ImageIndex: Integer read GetImageIndex write SetImageIndex;
    property Margin: Integer read FMargin write SetMargin default -1;
    property NumGlyphs: Integer read FNumGlyphs write SetNumGlyphs;
    property ShowText: Boolean read FShowText write SetShowText default False;
    property Spacing: Integer read FSpacing write SetSpacing;
    property Transparent: Boolean read FTransparent write SetTransparent default True;

    property Caption;
    property Enabled;
    property DisabledTextColors: TwwDisabledTextColors read FDisabledTextColors write FDisabledTextColors;
    property Font;
    property ParentFont;
    property ParentShowHint;
    property ShowHint;

    property OnClick;
    property OnMouseDown;
    property OnMouseUp;
    property OnMouseMove;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('IP Controls', [TwwSpeedButton]);
end;

// IUnknown

{$ifdef ver110}
function TwwSpeedButton.QueryInterface(const IID: TGUID; out Obj): HRESULT;
{$else}
function TwwSpeedButton.QueryInterface(const IID: TGUID; out Obj): {$ifdef wwDelphi4Up}HRESULT{$else}Integer{$endif};
{$endif}
const
  E_NOINTERFACE = $80004002;
begin
{$WARNINGS OFF}
  if GetInterface(IID, Obj) then Result := 0 else Result := E_NOINTERFACE;
{$WARNINGS ON}
end;

function TwwSpeedButton._AddRef: Integer;
begin
  Result := 1;
end;

function TwwSpeedButton._Release: Integer;
begin
  Result := 0;
end;

constructor TwwSpeedButton.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FImageIndex := -1;
  FMargin := -1;
  FNumGlyphs := 1;
  FSpacing := 4;
  Width := 25;
  Height := 25;
  ControlStyle := ControlStyle - [csDoubleClicks];
  FDisabledTextColors:= TwwDisabledTextColors.create;
  FDisabledTextColors.HighlightColor:= clBtnHighlight;
  FDisabledTextColors.ShadeColor:= clGray;
end;

destructor TwwSpeedButton.Destroy;
begin
  FDisabledTextColors.Free;
  inherited Destroy;
end;

procedure TwwSpeedButton.CMMouseEnter(var Message: TMessage);
begin
  inherited;
  FMouseInControl := True;
  Invalidate;
end;

procedure TwwSpeedButton.CMMouseLeave(var Message: TMessage);
begin
  inherited;
  FMouseInControl := False;
  Invalidate;
end;

function TwwSpeedButton.GetImageIndex: Integer;
begin
  result := FImageIndex;
end;

procedure TwwSpeedButton.SetFlat(Value: Boolean);
begin
  if FFlat <> Value then
  begin
    FFlat := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetImageIndex(Value: Integer);
begin
  if FImageIndex <> Value then
  begin
    FImageIndex := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetImageList(Value: TImageList);
begin
  if FImageList <> Value then
  begin
    FImageList := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetMargin(Value: Integer);
begin
  if FMargin <> Value then
  begin
    FMargin := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetNumGlyphs(Value: Integer);
begin
  if FNumGlyphs <> Value then
  begin
    FNumGlyphs := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetShowText(Value: Boolean);
begin
  if FShowText <> Value then
  begin
    FShowText := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.SetSpacing(Value: Integer);
begin
  if FSpacing <> Value then
  begin
    FSpacing := Value;
    Invalidate;
  end;
end;

procedure TwwSpeedButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  inherited;
  Invalidate;
end;

procedure TwwSpeedButton.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  inherited;
  Invalidate;
end;

type TwwBtnCanvas = class(TCanvas)
//  procedure DrawText(Caption: string; var Rect: TRect; Style: Integer);
end;

{procedure TwwBtnCanvas.DrawText(Caption: string; var Rect: TRect; Style: Integer);
begin
  // Used by DrawText API Function when "Item" has focus.
  SetBkColor(Handle, ColorToRGB(Brush.Color));
  SetTextColor(Handle, ColorToRGB(Font.Color));
  Refresh;
  Windows.DrawTextEx(Handle, PChar(Caption), Length(Caption), Rect, Style, nil);
end;
}
procedure TwwSpeedButton.Paint;
var CurImageIndex: Integer;
  function UseCaption: Boolean;
  begin
    result := (Caption <> '') and FShowText;
  end;
  function UseGlyph: Boolean;
  begin
    result := ((FImageList <> nil) and (CurImageIndex <> -1));
  end;
  function ButtonDown: Boolean;
  begin
    result := (csLButtonDown in ControlState) and FMouseInControl;
  end;
  function CenterRect(r: TRect; AWidth, AHeight: Integer): TRect;
  begin
    result := r;

    result.Left := ((r.Right - r.Left) - AWidth) div 2;
    result.Right := result.Right - result.Left;
    result.Left := result.Left + r.Left;
    result.Top := ((r.Bottom - r.Top) - AHeight) div 2;
    result.Bottom := result.Bottom - result.Top;
    result.Top := result.Top + r.Top;
  end;
const
    DownStyles: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER);
    FillStyles: array[Boolean] of Integer = (BF_MIDDLE, 0);
var CaptionRect: TRect;
    GlyphRect: TRect;
    DrawFlags: Integer;
    r: TRect;
    OffSet: Integer;

{$ifdef wwUseThemeManager}
  Button: TThemedButton;
  ToolButton: TThemedToolBar;
  Details: TThemedElementDetails;
{$endif}

{$ifdef wwUseThemeManager}
 procedure DoThemes;
 var PaintRect: TRect;
     Offset: TPoint;
 begin
  if ThemeServices.ThemesEnabled then
  begin
    {$ifdef wwDelphi7Up}
    PerformEraseBackground(Self, Canvas.Handle);
    {$endif}

    if not Enabled then
      Button := tbPushButtonDisabled
    else
      if ButtonDown then
        Button := tbPushButtonPressed
      else
        if FMouseInControl then
          Button := tbPushButtonHot
        else
          Button := tbPushButtonNormal;

    ToolButton := ttbToolbarDontCare;
    if FFlat then
    begin
      case Button of
        tbPushButtonDisabled:
          Toolbutton := ttbButtonDisabled;
        tbPushButtonPressed:
          Toolbutton := ttbButtonPressed;
        tbPushButtonHot:
          Toolbutton := ttbButtonHot;
        tbPushButtonNormal:
          Toolbutton := ttbButtonNormal;
      end;
    end;

    PaintRect := ClientRect;
    if ToolButton = ttbToolbarDontCare then
    begin
      Details := ThemeServices.GetElementDetails(Button);
      ThemeServices.DrawElement(Canvas.Handle, Details, PaintRect);
      PaintRect := ThemeServices.ContentRect(Canvas.Handle, Details, PaintRect);
    end
    else
    begin
      Details := ThemeServices.GetElementDetails(ToolButton);
      ThemeServices.DrawElement(Canvas.Handle, Details, PaintRect);
      PaintRect := ThemeServices.ContentRect(Canvas.Handle, Details, PaintRect);
    end;

    if Button = tbPushButtonPressed then
    begin
      // A pressed speed button has a white text. This applies however only to flat buttons.
      if ToolButton <> ttbToolbarDontCare then
        Canvas.Font.Color := clHighlightText;
      Offset := Point(1, 0);
    end
    else
      Offset := Point(0, 0);
  end
 end;
{$endif}

begin

{$ifdef wwUseThemeManager}
  if wwUseThemes(parent) and not wwGetAlwaysTransparent(parent) then
  begin
    DoThemes;
  end;
{$endif}

  CurImageIndex := FImageIndex;
  if not Enabled then inc(CurImageIndex, ord(FNumGlyphs > 1))
  else if ButtonDown and (FNumGlyphs > 2) then
    inc(CurImageIndex, 2)
  else if FMouseInControl and (FNumGlyphs > 3) then
    inc(CurImageIndex, 3);

  r := ClientRect;

  if not FFlat then
  begin
    DrawFlags := DFCS_BUTTONPUSH or DFCS_ADJUSTRECT;
    if ButtonDown then DrawFlags := DrawFlags or DFCS_PUSHED;
    if not wwUseThemes(parent) then
       DrawFrameControl(Canvas.Handle, r, DFC_BUTTON, DrawFlags);
    Offset := 2;
  end else begin
    if FMouseInControl and Enabled or (csDesigning in ComponentState) then
      if not wwUseThemes(parent) then
        DrawEdge(Canvas.Handle, r, DownStyles[ButtonDown],
          FillStyles[FFlat] or BF_RECT);
    OffSet := 1;
  end;

  Canvas.Brush.Style := bsClear;

  if FMargin <> -1 then OffsetRect(r, FMargin, FMargin);
  if ButtonDown then
    OffsetRect(r, Offset, Offset);
  if FMargin = -1 then
  begin
    if (FImageList <> nil) then GlyphRect := CenterRect(r, FImageList.Width, FImageList.Height);
  end else GlyphRect := r;

  OffsetRect(GlyphRect, ord(odd(GlyphRect.Right - GlyphRect.Left)), 1);
  if UseCaption then begin
     Canvas.Font.Assign(Font); { 10/7/98 - Assign canvas.font immediately instead of later }
     OffsetRect(GlyphRect, 0, -((Canvas.TextHeight(Caption) div 2) + (FSpacing div 2)));
  end;
  if FMargin = -1 then CaptionRect := CenterRect(r, Canvas.TextWidth(Caption), Canvas.TextHeight(Caption))
  else CaptionRect := r;
  if UseGlyph then OffsetRect(CaptionRect, 0, (Canvas.TextHeight(Caption) div 2) + (FSpacing div 2));

  if UseGlyph then
    FImageList.Draw(Canvas, GlyphRect.Left, GlyphRect.Top, CurImageIndex);
  if UseCaption then
  begin
//    Canvas.Font.Assign(Font); { 10/7/98 - Already have set this with fix above }
    if Enabled then
      DrawText(Canvas.Handle, PChar(Caption), Length(Caption), CaptionRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE)
    else begin
      OffsetRect(CaptionRect, 1, 1);
      Canvas.Font.Color:= DisabledTextColors.HighlightColor;
      DrawText(Canvas.Handle, PChar(Caption), Length(Caption), CaptionRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE);
      OffsetRect(CaptionRect, -1, -1);
      Canvas.Font.Color:= DisabledTextColors.ShadeColor;
      DrawText(Canvas.Handle, PChar(Caption), Length(Caption), CaptionRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE)
    end
  end;
end;

procedure TwwSpeedButton.SetTransparent(Value: Boolean);
begin
  if Value <> FTransparent then
  begin
    FTransparent := Value;
    if Value then
      ControlStyle := ControlStyle - [csOpaque] else
      ControlStyle := ControlStyle + [csOpaque];
    Invalidate;
  end;
end;

procedure TwwSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
  inherited ActionChange(Sender, CheckDefaults);
  if Sender is TCustomAction then
    with TCustomAction(Sender) do
    begin
      { Copy image from action's imagelist }
      if (ActionList <> nil) and (ActionList.Images <> nil) and
        (ActionList.Images=self.ImageList) and
        (ImageIndex >= 0) and (ImageIndex < ActionList.Images.Count) then
        self.ImageIndex:= ImageIndex;
    end;
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区 二区 三区 久久精品| 粉嫩一区二区三区性色av| 欧美日韩一区二区不卡| 丝袜美腿成人在线| 欧美一区二区国产| 国产精品亚洲第一区在线暖暖韩国| 久久久久国产精品免费免费搜索| 国产在线看一区| 中文字幕精品三区| 在线免费一区三区| 天天综合色天天综合色h| 日韩免费性生活视频播放| 国产寡妇亲子伦一区二区| 最新国产精品久久精品| 欧洲视频一区二区| 另类综合日韩欧美亚洲| 欧美激情在线看| 在线观看91视频| 麻豆成人av在线| 中文字幕欧美一| 欧美午夜不卡在线观看免费| 蜜桃av噜噜一区| 国产精品美女久久久久久久网站| 91啪亚洲精品| 久久精品免费看| 综合久久久久综合| 欧美一级高清大全免费观看| 成人深夜视频在线观看| 亚洲电影一区二区三区| 久久综合狠狠综合久久激情 | 欧美日本在线观看| 久久国产精品色婷婷| 中文字幕制服丝袜成人av| 欧美三级视频在线观看| 成人小视频免费在线观看| 亚洲国产精品嫩草影院| 国产亚洲综合av| 欧美日韩一级二级| www.综合网.com| 久久精品噜噜噜成人88aⅴ| 亚洲激情图片一区| 久久众筹精品私拍模特| 欧美精品在欧美一区二区少妇| 国产毛片精品视频| 青青草视频一区| 亚洲精品成人悠悠色影视| 久久久久久久久97黄色工厂| 欧美日韩成人高清| 99re这里只有精品首页| 国产成人精品免费一区二区| 日韩二区在线观看| 亚洲国产综合视频在线观看| 欧美精彩视频一区二区三区| 日韩一区二区三区视频在线| 色婷婷国产精品| 成人av网站在线观看免费| 毛片av中文字幕一区二区| 亚洲乱码精品一二三四区日韩在线| 久久亚洲捆绑美女| 精品国免费一区二区三区| 欧美日韩国产大片| 在线观看91视频| 色999日韩国产欧美一区二区| 国产91精品一区二区| 国产精品一区二区免费不卡| 久久成人久久爱| 久久99精品国产91久久来源| 日韩精品免费专区| 亚洲高清免费视频| 亚洲国产精品一区二区久久恐怖片| 亚洲三级在线免费观看| 成人免费一区二区三区在线观看| 欧美国产欧美综合| 中文字幕乱码亚洲精品一区 | 国产99久久久国产精品潘金 | 国产精品影视网| 精品亚洲porn| 激情综合网av| 国产乱子伦视频一区二区三区 | 亚洲不卡av一区二区三区| 一区二区三区免费网站| 一区二区三区四区在线播放| 亚洲精品免费在线| 亚洲国产精品影院| 视频在线观看91| 蜜臀久久久久久久| 麻豆91在线播放免费| 国产一区二区影院| aa级大片欧美| 色噜噜久久综合| 欧美福利视频导航| 这里只有精品99re| 精品国产伦一区二区三区免费| 精品日韩成人av| 国产精品少妇自拍| 自拍偷拍欧美精品| 日韩精品一卡二卡三卡四卡无卡| 青青草原综合久久大伊人精品优势| 美腿丝袜亚洲一区| 国产成人免费网站| 在线看一区二区| 日韩免费一区二区三区在线播放| 久久精品视频免费观看| 亚洲日本一区二区| 三级在线观看一区二区| 国产一区91精品张津瑜| 99精品热视频| 884aa四虎影成人精品一区| 久久亚洲综合色一区二区三区| 国产精品网友自拍| 亚洲.国产.中文慕字在线| 激情综合色综合久久| 91视视频在线直接观看在线看网页在线看 | 欧美经典三级视频一区二区三区| 亚洲欧洲日韩一区二区三区| 婷婷成人激情在线网| 精品日韩一区二区三区免费视频| 26uuu国产在线精品一区二区| 国产精品久久久久影院亚瑟| 亚洲不卡一区二区三区| 国产一区福利在线| 欧美在线一二三| 国产日韩欧美精品一区| 亚洲一卡二卡三卡四卡无卡久久 | 久久久综合九色合综国产精品| 国产精品国产三级国产aⅴ入口| 亚洲成人午夜电影| 国产99久久精品| 欧美一级视频精品观看| 亚洲欧美日韩国产另类专区| 精品一区二区在线观看| 欧美亚洲另类激情小说| 国产亚洲成av人在线观看导航| 午夜天堂影视香蕉久久| 99视频国产精品| 久久影院午夜论| 日韩精品免费专区| 色偷偷久久人人79超碰人人澡| 欧美成人video| 午夜久久久久久久久久一区二区| 成人av在线影院| 日韩午夜精品电影| 亚洲一区二区精品视频| www.一区二区| 久久蜜桃一区二区| 久久精品国产99| 正在播放亚洲一区| 性久久久久久久久| 在线观看国产91| 亚洲日本丝袜连裤袜办公室| 高清在线不卡av| 精品福利一区二区三区免费视频| 亚洲成人资源网| 91国产成人在线| 国产精品美女久久久久久久| 国产真实精品久久二三区| 日韩女优视频免费观看| 视频精品一区二区| 欧美日韩国产高清一区二区三区| 最新欧美精品一区二区三区| www..com久久爱| 国产精品国模大尺度视频| 成人国产精品视频| 国产精品污污网站在线观看| 国产精品一区二区久久不卡| 精品三级在线看| 激情深爱一区二区| 日韩久久久精品| 麻豆一区二区99久久久久| 日韩一区二区三区精品视频 | 国产一区欧美二区| 26uuu另类欧美| 国产一区日韩二区欧美三区| 久久久精品国产免费观看同学| 国产精品一区二区视频| 中文字幕的久久| 99re8在线精品视频免费播放| 18欧美乱大交hd1984| 色哟哟一区二区三区| 国产在线日韩欧美| 欧美国产日韩亚洲一区| 91一区二区三区在线观看| 亚洲摸摸操操av| 欧美日韩一二区| 麻豆一区二区三区| 久久久久亚洲蜜桃| 91在线精品一区二区| 一级做a爱片久久| 欧美精品九九99久久| 看电视剧不卡顿的网站| 日本一区二区视频在线| 91在线观看美女| 日韩和欧美的一区| 2欧美一区二区三区在线观看视频| 国产高清无密码一区二区三区| 中文字幕综合网| 欧美一区二区三区白人| 成人一区二区三区视频在线观看| 亚洲欧美成人一区二区三区| 91麻豆精品国产综合久久久久久|