dce01e5f780012bce8b5f78016e685801e998c3b
1 (* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 3 of the License ONLY.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE ../shared/a_modes.inc}
17 {$DEFINE FUI_TEXT_ICONS}
20 interface
24 type
26 public
27 type
31 public
43 function drawChar (x, y: Integer; const ch: AnsiChar): Integer; virtual; abstract; // returns char width
44 function drawText (x, y: Integer; const s: AnsiString): Integer; virtual; abstract; // returns text width
56 // function setOffset (constref aofs: TGxOfs): TGxOfs; virtual; abstract; // returns previous offset
57 // function setClip (constref aclip: TGxRect): TGxRect; virtual; abstract; // returns previous clip
59 function combineClip (constref aclip: TGxRect): TGxRect; virtual; abstract; // returns previous clip
61 // vertical scrollbar
62 procedure drawVSBar (x, y, wdt, hgt: Integer; cur, min, max: Integer; constref clrfull, clrempty: TGxRGBA); virtual; abstract;
63 // horizontal scrollbar
64 procedure drawHSBar (x, y, wdt, hgt: Integer; cur, min, max: Integer; constref clrfull, clrempty: TGxRGBA); virtual; abstract;
69 protected
82 private
85 public
92 // set active context; `ctx` can be `nil`
95 procedure gxGfxLoadFont (const fontname: AnsiString; const fontFile: AnsiString; proportional: Boolean=false);
100 gxFuiGfxLoadFontCallback: procedure (const fontname: AnsiString; const fontFile: AnsiString; proportional: Boolean) = nil;
102 implementation
106 var
110 begin
117 begin
119 gxPreSetContextCallback;
121 begin
127 begin
133 procedure gxGfxLoadFont (const fontname: AnsiString; const fontFile: AnsiString; proportional: Boolean=false);
134 begin
137 else
138 raise Exception.Create('FlexUI: hook not installed: font named '''+fontname+''' can not be loaded')
142 begin
146 else
147 begin
154 begin