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

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

?? jvshapetypecombobox.pas

?? A diagram edit component for delphi/c++ builder with full source included
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit JvShapeTypeComboBox;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,extctrls;

type
  TJvShapeTypeComboBox = class(TCustomComboBox)
  private
    FHiliteColor:TColor;
    FHiliteText:TColor;

    function GetShapeType:TShapeType;
    procedure SetShapeType(value:TShapeType);

    procedure GetShapeTypes;
    function GetEnumName(AShape:TShapeType):string;
    function GetEnumValue(AName:String):TShapeType;
  protected
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
    procedure DrawItem(Index: Integer; R: TRect; State: TOwnerDrawState); override;
  public
    constructor Create(AOwner:TComponent);override;
  published
    property ShapeType:TShapeType read GetShapeType write SetShapeType;
    property OnChange;
  end;

  TJvBrushStyleComboBox = class(TCustomComboBox)
  private
    FHiliteColor:TColor;
    FHiliteText:TColor;

    function GetBrushStyle:TBrushStyle;
    procedure SetBrushStyle(value:TBrushStyle);

    procedure GetBrushStyles;
    function GetEnumName(AStyle:TBrushStyle):string;
    function GetEnumValue(AName:String):TBrushStyle;
  protected
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
    procedure DrawItem(Index: Integer; R: TRect; State: TOwnerDrawState); override;
  public
    constructor Create(AOwner:TComponent);override;
  published
    property BrushStyle:TBrushStyle read GetBrushStyle write SetBrushStyle;
    property OnChange;
  end;

  TJvPenStyleComboBox = class(TCustomComboBox)
  private
    FHiliteColor:TColor;
    FHiliteText:TColor;

    function GetPenStyle:TPenStyle;
    procedure SetPenStyle(value:TPenStyle);

    procedure GetPenStyles;
    function GetEnumName(AStyle:TPenStyle):string;
    function GetEnumValue(AName:String):TPenStyle;
  protected
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
    procedure DrawItem(Index: Integer; R: TRect; State: TOwnerDrawState); override;
  public
    constructor Create(AOwner:TComponent);override;
  published
    property PenStyle:TPenStyle read GetPenStyle write SetPenStyle;
    property OnChange;
  end;

  TJvPenWidthComboBox = class(TCustomComboBox)
  private
    FHiliteColor:TColor;
    FHiliteText:TColor;

    function GetPenWidth:integer;
    procedure SetPenWidth(value:integer);

    procedure GetPenWidths;
    function GetEnumName(AStyle:integer):string;
    function GetEnumValue(AName:String):integer;
  protected
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
    procedure DrawItem(Index: Integer; R: TRect; State: TOwnerDrawState); override;
  public
    constructor Create(AOwner:TComponent);override;
  published
    property PenWidth:Integer read GetPenWidth write SetPenWidth;
    property OnChange;
  end;

procedure Register;

implementation

const
  ShapeNames:array [0..5] of string=('stRectangle','stRoundRect','stSquare','stRoundSquare','stCircle','stEllipse');
  ShapeValues:array [0..5] of TShapeType=(stRectangle,stRoundRect,stSquare,stRoundSquare,stCircle,stEllipse);

  BrushNames:array [0..7] of string=('bsSolid', 'bsClear', 'bsHorizontal', 'bsVertical', 'bsFDiagonal', 'bsBDiagonal', 'bsCross', 'bsDiagCross');
  BrushValues:array [0..7] of TBrushStyle=(bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross);

  PenNames:array [0..6] of string=('psSolid', 'psDash', 'psDot', 'psDashDot', 'psDashDotDot', 'psClear', 'psInsideFrame');
  PenValues:array [0..6] of TPenStyle=(psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame);

procedure Register;
begin
  RegisterComponents('Samples', [TJvShapeTypeComboBox,TJvBrushStyleComboBox,TJvPenStyleComboBox,TJvPenWidthComboBox]);
end;

constructor TJvShapeTypeComboBox.Create(AOwner:TComponent);
begin
  inherited create(AOwner);

  FHiliteColor := clHighLight;
  FHiLiteText := clHighLightText;
  Style := csOwnerDrawFixed;

  if not (csDesigning in ComponentState) then
    GetShapeTypes
  else
    Text:='stRectangle';
end;

procedure TJvShapeTypeComboBox.GetShapeTypes;
var
  i:integer;
begin
  Clear;
  with Items do begin
    for i:=low(ShapeNames) to High(ShapeNames) do begin
      Add(ShapeNames[i]);
    end;
  end;
  ItemIndex:=0;
end;

function TJvShapeTypeComboBox.GetEnumName(AShape:TShapeType):string;
begin
  result:=ShapeNames[Integer(AShape)];
end;

function TJvShapeTypeComboBox.GetEnumValue(AName:String):TShapeType;
var
  i:integer;
begin
  for i:=low(ShapeNames) to High(ShapeNames) do begin
    if ShapeNames[i]=AName then break;
  end;

  if i<=High(ShapeNames) then
    result:=ShapeValues[i]
  else
    result:=stRectangle;
end;

procedure TJvShapeTypeComboBox.CNDrawItem(var Message: TWMDrawItem);
var
  State: TOwnerDrawState;
begin
  with Message.DrawItemStruct^ do
  begin
    State := [];
    if bool(itemState and ODS_CHECKED) then
      Include(State, odChecked);
    if bool(itemState and ODS_COMBOBOXEDIT) then
      Include(State, odComboBoxEdit);
    if bool(itemState and ODS_DEFAULT) then
      Include(State, odDefault);
    if bool(itemState and ODS_DISABLED) then
      Include(State, odDisabled);
    if bool(itemState and ODS_FOCUS) then
      Include(State, odFocused);
    if bool(itemState and ODS_GRAYED) then
      Include(State, odGrayed);
    if bool(itemState and ODS_SELECTED) then
      Include(State, odSelected);
    Canvas.Handle := hDC;
    Canvas.Font := Font;
    Canvas.Brush := Brush;

    if (Integer(itemID) >= 0) and (odSelected in State) then
    begin
      Canvas.Brush.Color := FHiliteColor;
      Canvas.Font.Color := FHiliteText;
    end;
    if Integer(itemID) >= 0 then
      DrawItem(itemID, rcItem, State)
    else
      Canvas.FillRect(rcItem);
    Canvas.Handle := 0;
  end;
end;

procedure TJvShapeTypeComboBox.DrawItem(Index: Integer; R: TRect;  State: TOwnerDrawState);
  procedure DrawShape(r:TRect);
  var
    x,y,w,h,s:integer;
    aShape:TShapeType;
  begin
    with Canvas do begin
      X := R.Left+2;
      Y := R.top+2;
      W := 28 - Pen.Width + 1;
      H := R.Bottom-R.Top-4 - Pen.Width + 1;

      if Pen.Width = 0 then begin
        Dec(W);
        Dec(H);
      end;

      if W < H then
      S := W
      else
        S := H;

      AShape:=GetEnumValue(Items[Index]);
      if aShape in [stSquare, stRoundSquare, stCircle] then begin
        Inc(X, (W - S) div 2);
        Inc(Y, (H - S) div 2);
        W := S;
        H := S;
      end;

      //Brush.Color:=clYellow;
      case aShape of
        stRectangle, stSquare:
          Rectangle(X, Y, X + W, Y + H);
        stRoundRect, stRoundSquare:
          RoundRect(X, Y, X + W, Y + H, S div 2, S div 2);
        stCircle, stEllipse:
          Ellipse(X, Y, X + W, Y + H);
      end;
    end;
  end;
var
  aColor: TColor;
begin
  with Canvas do  begin
    aColor := Brush.Color;
    Brush.Color := Color;
    FillRect(R);

    Brush.Color:=clGray;
    OffsetRect(R,2,2);
    DrawShape(R);
    OffsetRect(R,-2,-2);
    Brush.Color:=$00f0caa6;
    DrawShape(R);

    R.Left := R.Left + 28 + 6;
    R.Right := R.Left + TextWidth(Items[Index]) + 6;
    Brush.Color := aColor;

    FillRect(R);
    OffsetRect(R, 2, 0);
    DrawText(Canvas.Handle, PChar(Items[Index]), -1, R, DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX);
    OffsetRect(R, -2, 0);

    if odSelected in State then
      DrawFocusRect(R);
  end;
end;

function TJvShapeTypeComboBox.GetShapeType:TShapeType;
begin
  result:=GetEnumValue(text);
end;

procedure TJvShapeTypeComboBox.SetShapeType(value:TShapeType);
begin
  ItemIndex:=Items.IndexOf(GetEnumName(Value));
end;

{TBrushStyleComboBox}
constructor TJvBrushStyleComboBox.Create(AOwner:TComponent);
begin
  inherited create(AOwner);

  FHiliteColor := clHighLight;
  FHiLiteText := clHighLightText;
  Style := csOwnerDrawFixed;

  if not (csDesigning in ComponentState) then
    GetBrushStyles
  else
    Text:='bsSolid';
end;

procedure TJvBrushStyleComboBox.GetBrushStyles;
var
  i:integer;
begin
  Clear;
  with Items do begin
    for i:=low(BrushNames) to High(BrushNames) do begin
      Add(BrushNames[i]);
    end;
  end;
  ItemIndex:=0;
end;

function TJvBrushStyleComboBox.GetEnumName(AStyle:TBrushStyle):string;
begin
  result:=BrushNames[Integer(AStyle)];
end;

function TJvBrushStyleComboBox.GetEnumValue(AName:String):TBrushStyle;
var
  i:integer;
begin
  for i:=low(BrushNames) to High(BrushNames) do begin
    if BrushNames[i]=AName then break;
  end;

  if i<=High(BrushNames) then
    result:=BrushValues[i]
  else
    result:=bsSolid;
end;

procedure TJvBrushStyleComboBox.CNDrawItem(var Message: TWMDrawItem);
var
  State: TOwnerDrawState;
begin
  with Message.DrawItemStruct^ do
  begin
    State := [];
    if bool(itemState and ODS_CHECKED) then
      Include(State, odChecked);
    if bool(itemState and ODS_COMBOBOXEDIT) then
      Include(State, odComboBoxEdit);
    if bool(itemState and ODS_DEFAULT) then
      Include(State, odDefault);
    if bool(itemState and ODS_DISABLED) then
      Include(State, odDisabled);
    if bool(itemState and ODS_FOCUS) then
      Include(State, odFocused);
    if bool(itemState and ODS_GRAYED) then
      Include(State, odGrayed);
    if bool(itemState and ODS_SELECTED) then
      Include(State, odSelected);
    Canvas.Handle := hDC;
    Canvas.Font := Font;
    Canvas.Brush := Brush;

    if (Integer(itemID) >= 0) and (odSelected in State) then
    begin
      Canvas.Brush.Color := FHiliteColor;
      Canvas.Font.Color := FHiliteText;
    end;
    if Integer(itemID) >= 0 then
      DrawItem(itemID, rcItem, State)
    else
      Canvas.FillRect(rcItem);
    Canvas.Handle := 0;
  end;
end;

procedure TJvBrushStyleComboBox.DrawItem(Index: Integer; R: TRect;  State: TOwnerDrawState);
  procedure DrawShape(r:TRect);
  var
    x,y,w,h,s:integer;
  begin
    with Canvas do begin
      X := R.Left+2;
      Y := R.top+2;
      W := 28 - Pen.Width + 1;
      H := R.Bottom-R.Top-4 - Pen.Width + 1;

      if Pen.Width = 0 then begin
        Dec(W);
        Dec(H);
      end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日产精品久久久久久久性色| 日韩午夜激情电影| 一区二区三区精品视频在线| 欧美吞精做爰啪啪高潮| 丝袜美腿一区二区三区| 久久综合久久鬼色| 日本精品免费观看高清观看| 美女网站在线免费欧美精品| 久久久久久久久久久久久女国产乱 | 免费成人av资源网| 久久蜜桃av一区精品变态类天堂| 日本不卡一二三区黄网| 欧美日韩成人综合天天影院| 国产91丝袜在线观看| 免费在线成人网| 天堂精品中文字幕在线| 亚洲美女视频在线观看| 国产精品妹子av| 国产日本亚洲高清| 精品久久久久久亚洲综合网| 91精品国产入口| 欧美午夜精品电影| 在线观看亚洲a| 91啪亚洲精品| 欧美调教femdomvk| 欧美色视频在线| 91精品国产综合久久小美女| 精品1区2区3区| 在线不卡中文字幕播放| 91精品国产欧美一区二区18| 欧美精品成人一区二区三区四区| 欧美调教femdomvk| 91麻豆精品国产自产在线观看一区 | 91免费视频观看| 在线观看免费一区| 欧美一二三在线| 国产精品全国免费观看高清| 亚洲精品成人在线| 日本女优在线视频一区二区| 国产精品18久久久久久vr| 国产成人超碰人人澡人人澡| 色狠狠桃花综合| 日韩精品一区在线观看| 中文字幕一区二区不卡| 一区二区三区四区高清精品免费观看| 一区二区三区精品久久久| 青青国产91久久久久久| 韩国一区二区在线观看| 91最新地址在线播放| 欧美乱熟臀69xxxxxx| 国产亚洲精品超碰| 亚洲一区免费在线观看| 国产福利精品一区| 欧美精品777| 亚洲日本va在线观看| 免费成人深夜小野草| 91久久久免费一区二区| 国产色爱av资源综合区| 蜜臀av性久久久久蜜臀av麻豆| 91精品国产一区二区| 国产精品三级av| 久久国产剧场电影| 欧美老女人在线| 一区二区三区四区在线| 97精品国产97久久久久久久久久久久| 久久日韩粉嫩一区二区三区| 亚洲mv在线观看| 91在线观看地址| 亚洲高清一区二区三区| 日韩成人一级大片| 成人高清视频在线| 精品成人在线观看| 久久国产三级精品| 日韩欧美激情一区| 国产自产v一区二区三区c| 欧美性色aⅴ视频一区日韩精品| 亚洲裸体xxx| 色欧美88888久久久久久影院| 国产精品成人免费| 99在线精品免费| 亚洲乱码中文字幕| 色婷婷久久久亚洲一区二区三区| 亚洲久草在线视频| 777亚洲妇女| 日韩影视精彩在线| 久久人人97超碰com| 国产成人在线免费观看| 中文字幕国产一区二区| 色综合视频一区二区三区高清| 亚洲精品欧美激情| 欧美美女bb生活片| 国产毛片一区二区| 亚洲日本一区二区| 欧美va日韩va| 欧美在线观看视频一区二区三区| 亚洲成人你懂的| 久久免费电影网| 在线观看免费亚洲| 国产精品中文字幕欧美| 欧美va亚洲va在线观看蝴蝶网| 久久精品国产第一区二区三区| 国产拍揄自揄精品视频麻豆| 欧美日韩免费高清一区色橹橹| 国产呦精品一区二区三区网站 | 欧美一区永久视频免费观看| 成人福利视频在线看| 欧美a级一区二区| 国产精品久久久久久福利一牛影视 | 久久久不卡影院| 欧美理论电影在线| 色婷婷av一区二区三区gif| 国产风韵犹存在线视精品| 午夜影视日本亚洲欧洲精品| 日韩三级.com| 色噜噜偷拍精品综合在线| 不卡在线观看av| 国产v综合v亚洲欧| 国产在线精品一区二区| 三级不卡在线观看| 一区二区三区精品在线| 亚洲天堂2016| 亚洲伦在线观看| 亚洲一区二区三区在线看| 亚洲欧美偷拍卡通变态| 国产精品免费看片| 亚洲三级在线观看| 国产精品动漫网站| 亚洲婷婷综合色高清在线| 久久久久99精品一区| 久久久久久日产精品| 欧美mv日韩mv国产网站| 2019国产精品| 国产精品久久夜| 一卡二卡欧美日韩| 日韩成人伦理电影在线观看| 三级久久三级久久久| 蜜臀99久久精品久久久久久软件| 久久99深爱久久99精品| 国产乱一区二区| 国产最新精品精品你懂的| 一区在线观看免费| 中文字幕欧美激情一区| 国产精品久久久一本精品| 中文字幕亚洲不卡| 日韩av中文在线观看| 国产河南妇女毛片精品久久久 | 日韩av中文字幕一区二区三区| 青娱乐精品视频| 粉嫩av一区二区三区| 欧美一区二区三区在线观看视频| 亚洲精品在线观看视频| 自拍偷自拍亚洲精品播放| 一区二区三区在线观看网站| 麻豆国产精品官网| 色呦呦日韩精品| 精品久久久久久久久久久院品网| 一区二区三区在线免费| 久久精品国产精品亚洲红杏| 91麻豆.com| 久久久国产综合精品女国产盗摄| 亚洲同性同志一二三专区| 久久草av在线| 欧美日产在线观看| 自拍偷自拍亚洲精品播放| 国产精品综合视频| 欧美日韩精品高清| ...中文天堂在线一区| 粉嫩在线一区二区三区视频| 欧美一二三四区在线| 亚洲成av人片www| 99久久777色| 久久久久国产免费免费| 青青草国产成人av片免费| 国产v日产∨综合v精品视频| 91精品国产欧美一区二区| 最新国产成人在线观看| 风流少妇一区二区| 国产日韩欧美高清在线| 风间由美性色一区二区三区| 一区二区三区欧美亚洲| 樱花影视一区二区| 在线观看www91| 国产精品传媒入口麻豆| 色av综合在线| 三级亚洲高清视频| 欧美一级在线观看| 国产一区二区女| 中文字幕高清一区| 成人动漫一区二区| 亚洲国产精品一区二区尤物区| 欧美另类变人与禽xxxxx| 麻豆91精品视频| 国产精品不卡在线观看| 欧美狂野另类xxxxoooo| 国产综合色视频| 亚洲欧美怡红院| 欧美一区二区视频免费观看| 国产成a人亚洲精品| 五月激情综合网| 国产欧美日本一区二区三区|