summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-02 16:10:51 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-02 16:10:51 +0000
commit50dff4b82733d267e0b5b7dba5b35d0036b5c333 (patch)
treec533423af80fdc1693cf9b04f1b6b7fc0c4b827a /src
parent781c7a0405b2abee470f9feff1676ef5f797c488 (diff)
downloadfpGUI-50dff4b82733d267e0b5b7dba5b35d0036b5c333.tar.xz
* Made the DrawText functions signature more consistent.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/fpgfx.pas20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas
index eda97b8e..d0145018 100644
--- a/src/corelib/fpgfx.pas
+++ b/src/corelib/fpgfx.pas
@@ -40,6 +40,7 @@ type
const
AllAnchors = [anLeft, anRight, anTop, anBottom];
+ TextFlagsDflt = [txtLeft, txtTop];
// Used for the internal message queue
cMessageQueueSize = 512;
@@ -157,9 +158,9 @@ type
procedure DrawDirectionArrow(x, y, w, h: TfpgCoord; direction: integer);
procedure DrawDirectionArrow(r: TfpgRect; direction: integer);
procedure DrawFocusRect(r: TfpgRect);
- function DrawText(x, y, w, h: TfpgCoord; AText: string; AFlags: TFTextFlags; ALineSpace: integer = 2): integer;
- function DrawText(x, y: TfpgCoord; AText: string; ALineSpace: integer = 2): integer;
- function DrawText(r: TfpgRect; AText: string; AFlags: TFTextFlags = [txtLeft, txtTop]; ALineSpace: integer = 2): integer;
+ function DrawText(x, y, w, h: TfpgCoord; AText: TfpgString; AFlags: TFTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer;
+ function DrawText(x, y: TfpgCoord; AText: TfpgString; AFlags: TFTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer;
+ function DrawText(r: TfpgRect; AText: TfpgString; AFlags: TFTextFlags = TextFlagsDflt; ALineSpace: integer = 2): integer;
end;
@@ -1151,11 +1152,11 @@ begin
fpgStyle.DrawFocusRect(self, r);
end;
-function TfpgCanvas.DrawText(x, y, w, h: TfpgCoord; AText: string; AFlags: TFTextFlags;
+function TfpgCanvas.DrawText(x, y, w, h: TfpgCoord; AText: TfpgString; AFlags: TFTextFlags;
ALineSpace: integer): integer;
var
wtxt, htxt, i, wt, l: integer;
- wraptxt: string;
+ wraptxt: TfpgString;
wraplst: TStringList;
begin
if (txtWrap in AFlags) then
@@ -1346,13 +1347,14 @@ begin
end;
end;
-function TfpgCanvas.DrawText(x, y: TfpgCoord; AText: string; ALineSpace: integer = 2): integer;
+function TfpgCanvas.DrawText(x, y: TfpgCoord; AText: TfpgString;
+ AFlags: TFTextFlags; ALineSpace: integer): integer;
begin
- Result := DrawText(x, y, 0, 0, AText, [txtLeft, txtTop], ALineSpace);
+ Result := DrawText(x, y, 0, 0, AText, AFlags, ALineSpace);
end;
-function TfpgCanvas.DrawText(r: TfpgRect; AText: string; AFlags: TFTextFlags;
- ALineSpace: integer): integer;
+function TfpgCanvas.DrawText(r: TfpgRect; AText: TfpgString; AFlags: TFTextFlags;
+ ALineSpace: integer): integer;
begin
Result := DrawText(r.Left, r.Top, r.Width, r.Height, AText, AFlags, ALineSpace);
end;