亚洲欧美第一页_禁久久精品乱码_粉嫩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在线热播精品免费| 精品视频色一区| 亚洲人精品午夜| 国产999精品久久久久久绿帽| 精品嫩草影院久久| 美腿丝袜在线亚洲一区| 91麻豆精品国产| 亚洲第一主播视频| 欧美三级一区二区| 亚洲成人免费在线| 欧美电影在线免费观看| 日韩高清电影一区| 欧美一级电影网站| 蓝色福利精品导航| 日韩精品一区二区三区在线| 一区二区三区美女| 欧美日韩精品免费| 日本中文字幕一区二区有限公司| 欧美一区二区不卡视频| 日本免费在线视频不卡一不卡二| 欧美刺激脚交jootjob| 美女高潮久久久| 久久蜜桃av一区精品变态类天堂| 国产永久精品大片wwwapp| 欧美国产日本视频| 成人免费电影视频| 一区二区三区四区在线播放| 欧美日本国产一区| 久久99久久精品欧美| 国产日韩欧美一区二区三区综合| 高清国产一区二区| 伊人色综合久久天天人手人婷| 欧美在线短视频| 蜜桃av一区二区在线观看 | 亚洲午夜私人影院| 91精品福利在线一区二区三区 | 国产日韩欧美精品综合| 99在线精品一区二区三区| 中文字幕一区二区三区在线播放| 日本韩国精品在线| 欧美精品一区二| 久久久久久电影| 精品一区二区三区在线播放| 欧美精品久久久久久久多人混战| 亚洲乱码国产乱码精品精小说 | 欧美一级淫片007| 日韩高清国产一区在线| 欧美精品一区二区精品网| 久久精品国产亚洲5555| 久久夜色精品国产欧美乱极品| 黑人巨大精品欧美一区| 国产精品婷婷午夜在线观看| 9人人澡人人爽人人精品| 亚洲一区二区视频| 日韩欧美在线网站| 久久不见久久见免费视频7| 欧美日韩精品久久久| 秋霞电影网一区二区| 欧美福利一区二区| 麻豆精品在线播放| 91麻豆精品久久久久蜜臀| 日韩av在线免费观看不卡| 日韩欧美一二三| 不卡区在线中文字幕| 一区二区高清在线| 国产成人自拍在线| 欧美一级午夜免费电影| 国产精品1024久久| 亚洲老妇xxxxxx| 91小视频免费看| 日本不卡的三区四区五区| 7777精品久久久大香线蕉| 蜜桃视频在线观看一区二区| 亚洲国产日韩一区二区| 亚洲天堂福利av| 国产精品福利一区| 日韩激情中文字幕| 亚洲一区国产视频| 亚洲综合免费观看高清完整版在线| 一区二区三区在线免费视频| 在线国产亚洲欧美| 久久精品久久综合| 亚洲123区在线观看| 亚洲婷婷在线视频| 亚洲欧洲精品天堂一级| 欧美一区二区三区在线视频 | 91麻豆产精品久久久久久| 亚洲高清不卡在线| 亚洲精品视频免费看| 国产女人18毛片水真多成人如厕 | 成人在线一区二区三区| 精品sm捆绑视频| 99re视频精品| 亚洲国产欧美在线| 色又黄又爽网站www久久| 久久久久国产精品免费免费搜索| 91亚洲大成网污www| 日韩精品一二区| 亚洲国产一区在线观看| 亚洲国产欧美日韩另类综合 | 中文字幕在线不卡一区| 久久久美女艺术照精彩视频福利播放 | 欧美日韩高清不卡| 91精品欧美综合在线观看最新| 91麻豆精品国产自产在线观看一区| 欧美综合在线视频| 日韩午夜电影在线观看| 欧美α欧美αv大片| 中文字幕一区二区三区四区不卡 | 国产三级三级三级精品8ⅰ区| 久久久久久久久久看片| 亚洲日本va在线观看| 亚洲成a人片在线观看中文| 激情五月婷婷综合| 色综合久久久久网| 精品国产免费人成电影在线观看四季 | 中文字幕精品一区 | 日本大胆欧美人术艺术动态| 亚洲第一电影网| 国产精品 欧美精品| 欧美日本一区二区| 国产精品每日更新在线播放网址 | 视频一区在线视频| 成人午夜视频在线观看| 欧美一级片免费看| 亚洲精品免费在线播放| 国产99久久精品| 91麻豆精品国产91久久久资源速度| 国产精品视频yy9299一区| 日韩av高清在线观看| 欧美系列日韩一区| 亚洲色大成网站www久久九九| 奇米色一区二区| 色婷婷综合久久久| 国产精品三级av在线播放| 麻豆91精品视频| 欧美丰满美乳xxx高潮www| 国产欧美精品一区二区色综合 | 亚洲人吸女人奶水| 99re在线精品| 1000精品久久久久久久久| 老司机免费视频一区二区| 日韩精品一区二区三区视频| 爽好久久久欧美精品| 欧美一级欧美三级| 青草国产精品久久久久久| 欧美三级三级三级| 免费成人小视频| 久久先锋影音av鲁色资源网| 青青国产91久久久久久| 精品国产三级电影在线观看| 国产麻豆精品theporn| 国产精品欧美经典| 欧美日韩一卡二卡三卡| 一区二区三区四区国产精品| 欧美日韩五月天| 国产精品影视网| 亚洲福利视频导航| 亚洲精品一区二区三区影院| 国产高清成人在线| 亚洲国产wwwccc36天堂| 欧美人动与zoxxxx乱| 国产成人综合在线| 视频精品一区二区| 国产精品欧美经典| 精品捆绑美女sm三区| 91丝袜国产在线播放| 1024国产精品| 国产香蕉久久精品综合网| 一区二区三区**美女毛片| 国产一区二区三区四区在线观看| 欧美日韩专区在线| 亚洲午夜私人影院| 欧美性生活大片视频| 亚洲一级电影视频| 在线观看网站黄不卡| 亚洲福利视频三区| 欧美精品一卡二卡| 蜜桃精品视频在线| 日韩精品一区在线观看| 国产九色精品成人porny| 久久精品亚洲麻豆av一区二区| 国产最新精品免费| 日本一区二区三区国色天香| 成人小视频免费观看| 亚洲精品日日夜夜| 欧美精选一区二区| 久久精品国产亚洲aⅴ| 国产欧美一区二区精品秋霞影院| 成人毛片视频在线观看| 亚洲婷婷在线视频| 色综合久久久久久久久| 视频在线观看一区二区三区| 日韩欧美高清在线| 福利一区二区在线观看| 一区二区三区久久| 日韩精品中文字幕在线一区| 国产成人免费视频网站| 亚洲欧美在线视频|