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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tntwidestringproperty_design.pas

?? Delphi知道現(xiàn)在也沒有提供Unicode支持
?? PAS
字號:

{*****************************************************************************}
{                                                                             }
{    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 TntWideStringProperty_Design;

{$INCLUDE ..\Source\TntCompilers.inc}

interface

{*****************************************************}
{  TWideCharProperty-editor implemented by Ma雔 H鰎z  }
{*****************************************************}

{$IFDEF COMPILER_9_UP}
  {$MESSAGE FATAL 'The Object Inspector in Delphi 9 is already Unicode enabled.'}
{$ENDIF}

uses
  Classes, Messages, Windows, Graphics, TypInfo, TntDesignEditors_Design,
  DesignIntf, DesignEditors, VCLEditors;

type
  TWideStringProperty = class(TPropertyEditor, ICustomPropertyDrawing)
  private
    FActivateWithoutGetValue: Boolean;
    FPropList: PInstPropList;
  protected
    procedure SetPropEntry(Index: Integer; AInstance: TPersistent; APropInfo: PPropInfo); override;
    function GetWideStrValueAt(Index: Integer): WideString; dynamic;
    function GetWideStrValue: WideString;
    procedure SetWideStrValue(const Value: WideString); dynamic;
    function GetWideVisualValue: WideString;
  public
    constructor Create(const ADesigner: ITntDesigner; APropCount: Integer); override;
    destructor Destroy; override;
    procedure Activate; override;
    procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean);
    procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean);
    function AllEqual: Boolean; override;
    function GetEditLimit: Integer; override;
    function GetValue: AnsiString; override;
    procedure SetValue(const Value: AnsiString); override;
    {$IFDEF MULTI_LINE_STRING_EDITOR}
    function GetAttributes: TPropertyAttributes; override;
    procedure Edit; override;
    {$ENDIF}
  end;

  TWideCaptionProperty = class(TWideStringProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
  end;

  TWideCharProperty = class(TWideStringProperty)
  protected
    {$IFDEF COMPILER_7_UP}
    function GetIsDefault: Boolean; override;
    {$ENDIF}
    function GetWideStrValueAt(Index: Integer): WideString; override;
    procedure SetWideStrValue(const Value: WideString); override;
  public
    function GetAttributes: TPropertyAttributes; override;
    function GetEditLimit: Integer; override;
  end;

procedure Register;

implementation

uses
  Controls, Forms, SysUtils, StdCtrls, TntGraphics, TntControls,
  TntSysUtils, TntSystem, Consts,
  RTLConsts;

procedure Register;
begin
  RegisterPropertyEditor(TypeInfo(WideString), nil, '', TWideStringProperty);
  RegisterPropertyEditor(TypeInfo(TWideCaption), nil, '', TWideCaptionProperty);
  RegisterPropertyEditor(TypeInfo(WideChar), nil, '', TWideCharProperty);
end;

function GetOIInspListBox: TWinControl;
var
  ObjectInspectorForm: TCustomForm;
  Comp: TComponent;
begin
  Result := nil;
  ObjectInspectorForm := GetObjectInspectorForm;
  if ObjectInspectorForm <> nil then begin
    Comp := ObjectInspectorForm.FindComponent('PropList');
    if Comp is TWinControl then
      Result := TWinControl(Comp);
  end;
end;

function GetOIPropInspEdit: TCustomEdit{TNT-ALLOW TCustomEdit};
var
  OIInspListBox: TWinControl;
  Comp: TComponent;
begin
  Result := nil;
  OIInspListBox := GetOIInspListBox;
  if OIInspListBox <> nil then begin
    Comp := OIInspListBox.FindComponent('EditControl');
    if Comp is TCustomEdit{TNT-ALLOW TCustomEdit} then
      Result := TCustomEdit{TNT-ALLOW TCustomEdit}(Comp);
  end;
end;
//------------------------------

type TAccessWinControl = class(TWinControl);

{ TWideStringProperty }

var
  WideStringPropertyCount: Integer = 0;

constructor TWideStringProperty.Create(const ADesigner: ITntDesigner; APropCount: Integer);
begin
  inherited;
  Inc(WideStringPropertyCount);
  GetMem(FPropList, APropCount * SizeOf(TInstProp));
end;

procedure ConvertObjectInspectorBackToANSI;
var
  Edit: TCustomEdit{TNT-ALLOW TCustomEdit};
begin
  if (Win32PlatformIsUnicode) then begin
    Edit := GetOIPropInspEdit;
    if Assigned(Edit)
    and IsWindowUnicode(Edit.Handle) then
      TAccessWinControl(Edit).RecreateWnd;
  end;
end;

destructor TWideStringProperty.Destroy;
begin
  Dec(WideStringPropertyCount);
  if (WideStringPropertyCount = 0) then
    ConvertObjectInspectorBackToANSI;
  if FPropList <> nil then
    FreeMem(FPropList, PropCount * SizeOf(TInstProp));
  inherited;
end;

{$IFDEF DELPHI_7} // verified against VCL source in Delphi 7
type
  THackPropertyEditor = class
    FDesigner: IDesigner;
    FPropList: PInstPropList;
  end;
{$ENDIF}

procedure TWideStringProperty.Activate;
var
  Edit: TCustomEdit{TNT-ALLOW TCustomEdit};
begin
  FActivateWithoutGetValue := True;
  if (Win32PlatformIsUnicode) then begin
    Edit := GetOIPropInspEdit;
    if Assigned(Edit)
    and (not IsWindowUnicode(Edit.Handle)) then
      ReCreateUnicodeWnd(Edit, 'EDIT', True);
  end;
end;

procedure TWideStringProperty.SetPropEntry(Index: Integer;
  AInstance: TPersistent; APropInfo: PPropInfo);
begin
  inherited;
  with FPropList^[Index] do
  begin
    Instance := AInstance;
    PropInfo := APropInfo;
  end;
end;

function TWideStringProperty.GetWideStrValueAt(Index: Integer): WideString;
begin
  with FPropList^[Index] do Result := GetWideStrProp(Instance, PropInfo);
end;

function TWideStringProperty.GetWideStrValue: WideString;
begin
  Result := GetWideStrValueAt(0);
end;

procedure TWideStringProperty.SetWideStrValue(const Value: WideString);
var
  I: Integer;
begin
  for I := 0 to PropCount - 1 do
    with FPropList^[I] do SetWideStrProp(Instance, PropInfo, Value);
  Modified;
end;

function TWideStringProperty.GetWideVisualValue: WideString;
begin
  if AllEqual then
    Result := GetWideStrValue
  else
    Result := '';
end;

procedure TWideStringProperty.PropDrawName(ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean);
begin
  DefaultPropertyDrawName(Self, ACanvas, ARect);
end;

procedure TWideStringProperty.PropDrawValue(ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean);
begin
  WideCanvasTextRect(ACanvas, ARect, ARect.Left + 1, ARect.Top + 1, GetWideVisualValue);
end;

function TWideStringProperty.AllEqual: Boolean;
var
  I: Integer;
  V: WideString;
begin
  Result := False;
  if PropCount > 1 then
  begin
    V := GetWideStrValue;
    for I := 1 to PropCount - 1 do
      if GetWideStrValueAt(I) <> V then Exit;
  end;
  Result := True;
end;

function TWideStringProperty.GetEditLimit: Integer;
var
  Edit: TCustomEdit{TNT-ALLOW TCustomEdit};
begin
  Result := MaxInt;
  // GetEditLimit is called right before the inplace editor text has been set
  if Win32PlatformIsUnicode then begin
    Edit := GetOIPropInspEdit;
    if Assigned(Edit) then begin
      TntControl_SetText(Edit, GetWideStrValue);
      TntControl_SetHint(Edit, GetWideStrValue);
    end;
  end;
end;

function TWideStringProperty.GetValue: AnsiString;
begin
  FActivateWithoutGetValue := False;
  Result := WideStringToStringEx(GetWideStrValue, CP_ACP{TNT-ALLOW CP_ACP}); // use the same code page as the inplace editor
end;

procedure TWideStringProperty.SetValue(const Value: AnsiString);
var
  Edit: TCustomEdit{TNT-ALLOW TCustomEdit};
begin
  if (not FActivateWithoutGetValue) then begin
    Edit := GetOIPropInspEdit;
    if Assigned(Edit) and Win32PlatformIsUnicode then
      SetWideStrValue(TntControl_GetText(Edit))
    else
      SetWideStrValue(StringToWideStringEx(Value, CP_ACP{TNT-ALLOW CP_ACP})); // use the same code page as the inplace editor
  end;
end;

{$IFDEF MULTI_LINE_STRING_EDITOR}
function TWideStringProperty.GetAttributes: TPropertyAttributes;
begin
  Result := inherited GetAttributes + [paDialog];
end;

procedure TWideStringProperty.Edit;
var
  Temp: WideString;
begin
  with TTntStrEditDlg.Create(Application) do
  try
    PrepareForWideStringEdit;
    Memo.Text := GetWideStrValue;
    UpdateStatus(nil);
    if ShowModal = mrOk then begin
      Temp := Memo.Text;
      while (Length(Temp) > 0) and (Temp[Length(Temp)] < ' ') do
        System.Delete(Temp, Length(Temp), 1); { trim control characters from end }
      SetWideStrValue(Temp);
    end;
  finally
    Free;
  end;
end;
{$ENDIF}

{ TWideCaptionProperty }

function TWideCaptionProperty.GetAttributes: TPropertyAttributes;
begin
  Result := inherited GetAttributes + [paAutoUpdate];
end;

{ TWideCharProperty }

function TWideCharProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paMultiSelect, paRevertable];
end;            

function TWideCharProperty.GetEditLimit: Integer;
begin
  inherited GetEditLimit;
  Result := 63;
end;

{$IFDEF COMPILER_7_UP}
function TWideCharProperty.GetIsDefault: Boolean;
var
  i: Integer;
  OldPropList: PInstPropList;
begin
  Result := True;
  if PropCount > 0 then
  begin
    OldPropList := THackPropertyEditor(Self).FPropList;
    // The memory FPropList points to is write-protected.
    // In the constructor we dynamically allocated our own PropList,
    // which can be written, so point there instead.
    THackPropertyEditor(Self).FPropList := FPropList;

    // Delphi can't handle WideChar-type, but does well with Word-type,
    // which has exactly the same size as WideChar (i.e. 2 Bytes)
    for i := 0 to PropCount - 1 do
      FPropList^[i].PropInfo^.PropType^ := TypeInfo(Word);

    Result := inherited GetIsDefault;

    for i := 0 to PropCount - 1 do
      FPropList^[i].PropInfo^.PropType^ := TypeInfo(WideChar);

    THackPropertyEditor(Self).FPropList := OldPropList;
  end;
end;
{$ENDIF}

function IsCharGraphic(C: WideChar): Boolean;
begin
  if Win32PlatformIsUnicode then
    Result := not IsWideCharCntrl(C) and not IsWideCharSpace(C)
  else // representation as charcode avoids corruption on ANSI-systems
    Result := (C >= #33) and (C <= #127);
end;

function TWideCharProperty.GetWideStrValueAt(Index: Integer): WideString;
var
  C: WideChar;
begin
  with FPropList^[Index] do
    C := WideChar(GetOrdProp(Instance, PropInfo));

  if IsCharGraphic(C) then
    Result := C
  else
    Result := WideFormat('#%d', [Ord(C)]);
end;

procedure TWideCharProperty.SetWideStrValue(const Value: WideString);
var
  C: Longint;
  I: Integer;
begin
  if Length(Value) = 0 then
    C := 0
  else if Length(Value) = 1 then
    C := Ord(Value[1])
  else if Value[1] = '#' then
    C := StrToInt(Copy(Value, 2, Maxint))
  else
    raise EPropertyError.Create(SInvalidPropertyValue);

  with GetTypeData(GetPropType)^ do
    if (C < MinValue) or (C > MaxValue) then
      raise EPropertyError.CreateFmt(SOutOfRange, [MinValue, MaxValue]);

  for I := 0 to PropCount - 1 do
    with FPropList^[I] do SetOrdProp(Instance, PropInfo, C);
    
  Modified;
end;

initialization

finalization
  ConvertObjectInspectorBackToANSI;

end.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合色丁香婷婷六月图片| 日韩和欧美的一区| 美国av一区二区| 欧美精品久久久久久久多人混战| 亚洲视频在线一区观看| 99久精品国产| 国产精品美女久久久久久2018 | 国产精品不卡视频| 欧美性xxxxx极品少妇| 日韩电影在线观看一区| 久久婷婷色综合| 成人av网址在线| 亚洲一区二区偷拍精品| 亚洲高清视频的网址| 国产亚洲午夜高清国产拍精品| 99国产精品视频免费观看| 91在线观看视频| 久久99热99| 亚洲人成影院在线观看| 精品欧美一区二区在线观看| www.欧美日韩国产在线| 日本不卡的三区四区五区| 亚洲天堂2014| 亚洲mv在线观看| 国产精品无遮挡| 亚洲乱码国产乱码精品精可以看 | 91小视频在线| 欧美老年两性高潮| 精品国产一区二区三区久久久蜜月 | 国产成人av一区二区三区在线| 亚洲狠狠丁香婷婷综合久久久| 亚洲午夜激情网页| 日本美女一区二区三区| 成人少妇影院yyyy| 国产精品中文欧美| 秋霞av亚洲一区二区三| 国产激情视频一区二区在线观看| 91麻豆国产香蕉久久精品| 欧美不卡一二三| 亚洲欧美一区二区三区孕妇| 理论片日本一区| 91国偷自产一区二区三区观看| 久久国产福利国产秒拍| 91网站在线播放| 精品少妇一区二区三区| 夜色激情一区二区| 一区二区三区四区蜜桃| 韩国欧美国产1区| 精彩视频一区二区| 狠狠色丁香久久婷婷综合丁香| 91丨porny丨中文| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲成av人影院在线观看网| 国产成人综合在线播放| 欧美精品日韩精品| 亚洲欧美福利一区二区| 国产成人一区在线| 日韩欧美国产成人一区二区| 欧美一区二区二区| 日韩视频在线一区二区| 久久久久久久久久久99999| 精品精品国产高清一毛片一天堂| 亚洲精品乱码久久久久| www.欧美亚洲| 国产精品美女视频| 成人激情视频网站| 久久久国产一区二区三区四区小说| 调教+趴+乳夹+国产+精品| 午夜久久久影院| 在线免费观看日韩欧美| 精品视频资源站| 精品成人a区在线观看| 日韩不卡一区二区| 欧美性色欧美a在线播放| 亚洲精品欧美二区三区中文字幕| 99精品欧美一区二区三区小说| 日本一区二区三区国色天香| 亚洲免费av网站| 色婷婷综合久久久久中文一区二区 | 91福利区一区二区三区| 亚洲激情综合网| 一本一本久久a久久精品综合麻豆| 国产精品青草久久| 97久久超碰精品国产| 国产精品女同互慰在线看 | 亚洲欧洲日韩在线| 五月婷婷色综合| 69久久夜色精品国产69蝌蚪网| 26uuu久久综合| 国内国产精品久久| 国产精品色哟哟| 色综合中文字幕| 日韩一区二区三区电影在线观看| 欧美a级理论片| 日韩免费在线观看| 国产成人精品影院| 亚洲摸摸操操av| 欧美图片一区二区三区| 日韩精品亚洲一区二区三区免费| 欧美大黄免费观看| 国产成人综合亚洲91猫咪| 亚洲欧洲精品成人久久奇米网| 一本大道av伊人久久综合| 午夜天堂影视香蕉久久| 亚洲精品在线免费播放| www.激情成人| 日韩电影一区二区三区四区| 久久精品视频在线免费观看| 色悠悠亚洲一区二区| 免费看日韩a级影片| 国产农村妇女毛片精品久久麻豆 | 久久久国际精品| 91蝌蚪国产九色| 欧美无砖砖区免费| 偷拍一区二区三区| 欧美一区在线视频| 免费一区二区视频| 久久久国产精品午夜一区ai换脸| 成人一二三区视频| 亚洲大片精品永久免费| 欧美电视剧免费全集观看| 成人99免费视频| 首页综合国产亚洲丝袜| 中文字幕一区二区视频| 欧美一二三区精品| 91丨国产丨九色丨pron| 国产伦精品一区二区三区免费迷| 欧美日韩视频不卡| 国产91色综合久久免费分享| 久久久99精品久久| 欧美日韩在线精品一区二区三区激情| 狠狠色综合播放一区二区| 亚洲最色的网站| 国产精品福利影院| 精品国产乱码久久久久久老虎| 色婷婷综合中文久久一本| 波多野结衣91| 国产精品一区二区久久精品爱涩| 日本一区中文字幕| 午夜伦欧美伦电影理论片| 一区二区高清免费观看影视大全 | 欧美自拍丝袜亚洲| 成人av网站在线观看| 国产一区二区免费视频| 另类的小说在线视频另类成人小视频在线| 亚洲欧美日韩国产综合| 一区在线播放视频| 国产精品免费观看视频| 久久精品人人做人人综合| 欧美一区二区久久| 欧美高清激情brazzers| 欧美日韩高清一区二区| 看电视剧不卡顿的网站| 丝袜美腿亚洲综合| 天天色图综合网| 日韩国产欧美三级| 美腿丝袜在线亚洲一区| 麻豆国产欧美一区二区三区| 天涯成人国产亚洲精品一区av| 亚洲午夜精品在线| 亚洲成人免费观看| 日韩成人免费电影| 日本va欧美va瓶| 激情综合网天天干| 激情欧美一区二区| 高清久久久久久| 不卡的电视剧免费网站有什么| 成人看片黄a免费看在线| 99精品视频一区| 欧美精品亚洲一区二区在线播放| 欧美日韩久久一区| 欧美一个色资源| 久久久蜜桃精品| 成人欧美一区二区三区| 偷拍一区二区三区| 精品午夜一区二区三区在线观看 | 91日韩一区二区三区| 在线视频欧美区| 欧美精品一卡二卡| 久久亚洲二区三区| 亚洲国产精品久久久男人的天堂| 亚洲精品欧美二区三区中文字幕| 丝袜诱惑亚洲看片| 国产曰批免费观看久久久| 高清在线成人网| 在线观看亚洲一区| 精品国产第一区二区三区观看体验 | 色天天综合久久久久综合片| 欧美日韩午夜在线视频| 精品久久国产老人久久综合| 国产日韩欧美高清| 亚洲第一福利一区| 国产麻豆成人传媒免费观看| 91搞黄在线观看| 久久蜜桃香蕉精品一区二区三区| 一区二区三区欧美视频| 久久精品国产99久久6| 成人动漫一区二区在线| 欧美日韩久久久| 中文字幕乱码日本亚洲一区二区|