(Qt): implemented FontIsMonoSpace() and FontCanUTF8().

git-svn-id: trunk@12053 -
This commit is contained in:
zeljko 2007-09-17 11:15:43 +00:00
parent 4ac6e38987
commit 0f4b37d257
2 changed files with 44 additions and 1 deletions

View File

@ -114,6 +114,46 @@ begin
end;
end;
{------------------------------------------------------------------------------
Function: FontCanUTF8
Params:
Returns:
------------------------------------------------------------------------------}
function TQtWidgetSet.FontCanUTF8(Font: HFont): Boolean;
begin
{$ifdef windows}
{$ifdef WindowsUnicodeSupport}
Result := True;
{$else}
Result := False;
{$endif}
{$else}
Result := IsValidGDIObject(Font);
{$endif}
end;
{------------------------------------------------------------------------------
Function: FontIsMonoSpace
Params:
Returns:
------------------------------------------------------------------------------}
function TQtWidgetSet.FontIsMonoSpace(Font: HFont): Boolean;
var
QtFontInfo: QFontInfoH;
begin
Result := IsValidGDIObject(Font);
if Result then
begin
QtFontInfo := QFontInfo_create(TQtFont(Font).Widget);
try
Result := QFontInfo_fixedPitch(QtFontInfo);
finally
QFontInfo_destroy(QtFontInfo);
end;
end;
end;
{------------------------------------------------------------------------------
Function: IntfSendsUTF8KeyPress
Params:
@ -122,7 +162,7 @@ end;
function TQtWidgetSet.IntfSendsUTF8KeyPress: boolean;
begin
Result:=true;
Result := True;
end;
{------------------------------------------------------------------------------

View File

@ -33,6 +33,9 @@
function CreateStandardCursor(ACursor: SmallInt): hCursor; override;
procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
function FontCanUTF8(Font: HFont): boolean; override;
function FontIsMonoSpace(Font: HFont): boolean; override;
function IntfSendsUTF8KeyPress: boolean; override;
function PromptUser(const DialogCaption : string;