Page 1 of 1
unicode hint on trichviewedit
Posted: Tue Aug 04, 2009 6:42 pm
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
Posted: Wed Aug 05, 2009 4:24 pm
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).
Posted: Wed Aug 05, 2009 5:53 pm
by csterg
Thanks,
i will give it a try if i can hack something with TNT,
Costsa
Posted: Thu Aug 06, 2009 2:11 pm
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)
Posted: Thu Aug 06, 2009 7:02 pm
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