1270 w:= i + 36 + wa; |
1270 w:= i + 36 + wa; |
1271 inc(h, j + ha); |
1271 inc(h, j + ha); |
1272 |
1272 |
1273 // get description's dimensions |
1273 // get description's dimensions |
1274 tmpdesc:= description; |
1274 tmpdesc:= description; |
1275 while tmpdesc <> '' do |
1275 while length(tmpdesc) > 0 do |
1276 begin |
1276 begin |
1277 tmpline:= tmpdesc; |
1277 tmpline:= tmpdesc; |
1278 SplitByChar(tmpline, tmpdesc, '|'); |
1278 SplitByChar(tmpline, tmpdesc, '|'); |
1279 if tmpline <> '' then |
1279 if length(tmpline) > 0 then |
1280 begin |
1280 begin |
1281 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), @i, @j); |
1281 TTF_SizeUTF8(Fontz[font].Handle, PChar(tmpline), @i, @j); |
1282 if w < (i + wa) then |
1282 if w < (i + wa) then |
1283 w:= i + wa; |
1283 w:= i + wa; |
1284 inc(h, j + ha) |
1284 inc(h, j + ha) |
1285 end |
1285 end |
1286 end; |
1286 end; |
1313 // render sub caption |
1313 // render sub caption |
1314 r:= WriteInRect(tmpsurf, 36 + cFontBorder + 2, r.y + r.h, $ffc7c7c7, font, subcaption); |
1314 r:= WriteInRect(tmpsurf, 36 + cFontBorder + 2, r.y + r.h, $ffc7c7c7, font, subcaption); |
1315 |
1315 |
1316 // render all description lines |
1316 // render all description lines |
1317 tmpdesc:= description; |
1317 tmpdesc:= description; |
1318 while tmpdesc <> '' do |
1318 while length(tmpdesc) > 0 do |
1319 begin |
1319 begin |
1320 tmpline:= tmpdesc; |
1320 tmpline:= tmpdesc; |
1321 SplitByChar(tmpline, tmpdesc, '|'); |
1321 SplitByChar(tmpline, tmpdesc, '|'); |
1322 r2:= r; |
1322 r2:= r; |
1323 if tmpline <> '' then |
1323 if length(tmpline) > 0 then |
1324 begin |
1324 begin |
1325 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, Str2PChar(tmpline)); |
1325 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline)); |
1326 |
1326 |
1327 // render highlighted caption (if there is a ':') |
1327 // render highlighted caption (if there is a ':') |
1328 tmpline2:= _S''; |
1328 tmpline2:= _S''; |
1329 SplitByChar(tmpline, tmpline2, ':'); |
1329 SplitByChar(tmpline, tmpline2, ':'); |
1330 if tmpline2 <> _S'' then |
1330 if length(tmpline2) > 0 then |
1331 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, Str2PChar(tmpline + ':')); |
1331 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline + ':')); |
1332 end |
1332 end |
1333 end; |
1333 end; |
1334 |
1334 |
1335 if extra <> '' then |
1335 if extra <> '' then |
1336 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, extra); |
1336 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, extra); |