unicode hint on trichviewedit

General TRichView support forum. Please post your questions here
Post Reply
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

unicode hint on trichviewedit

Post by csterg »

Hello Sergey,
is it possible to support unicode hint in RVE?
I still have version 10 but my app is fully unicode (using TNT everywhere), and it seems the RVE is the only control that will not support unicode hint,

Is there a trick to work out with TNT?
Costas
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, Unicode hints are supported only in TRichView 11, and only in Delphi 2009.
(actions in RichViewActions support Unicode hints and captions with TNT controls, though).
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Post by csterg »

Thanks,
i will give it a try if i can hack something with TNT,
Costsa
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I'd try the following:
- use UTF-8 strings for assigning to TRichView item hints (and any other non-Unicode hints in your application)
- change the way how control hints are assigned to TNT hints (UTF-8 to Unicode conversion instead of Ansi to Unicode conversion)
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Post by csterg »

Here is a workaround:

Code: Select all

unit twTntRichViewEdit;

interface
uses TntControls, RVEdit, Controls, Classes;

type
  TTntRichViewEdit = class(TRichViewEdit)
  private
    function GetHint: WideString;
    function IsHintStored: Boolean;
    procedure SetHint(const Value: WideString);
  protected
    procedure CreateWindowHandle(const Params: TCreateParams); override;
  published
    property Hint: WideString read GetHint write SetHint stored IsHintStored;
  end;

  procedure Register;

implementation

{ TTntRichViewEdit }

procedure TTntRichViewEdit.CreateWindowHandle(const Params: TCreateParams);
begin
  CreateUnicodeHandle(Self, Params, '');
end;

function TTntRichViewEdit.GetHint: WideString;
begin
  Result := TntControl_GetHint(Self)
end;

function TTntRichViewEdit.IsHintStored: Boolean;
begin
  Result := TntControl_IsHintStored(Self)
end;

procedure TTntRichViewEdit.SetHint(const Value: WideString);
begin
  TntControl_SetHint(Self, Value);
end;

procedure Register;
begin
  RegisterComponents('My Components', [TTntRichViewEdit]);
end;
end.
Costas
Post Reply