GDIP_GetTextBound(MainClass.DeviceName, FontName, 13, bw, bh, nil, GD_TextHorzUp);
// DeviceName
x := x1;
y := 41;
ID := ID_DEVICENAME + Index;
for i := 1 to Length(MainClass.DeviceName) do
begin
if MainClass.DeviceName[i] = ' ' then
begin
bNull := True;
gSprSession.GD_DrawTextToCtrlEx(HSprSession, PWideChar(Trim(MainClass.DeviceName)), x, y,
ParentWidth, bh * 2, gSprSession.GD_ARGB(255, 255, 255, 255), PWideChar(FontName), nil, 13,
ID, GS_VISIBLE, 0, Ord(StringAlignmentCenter));
break;
end;
end;
if not bNull then
begin
if (bw > ParentWidth) then
gSprSession.GD_DrawTextToCtrlEx(HSprSession, PWideChar(Trim(MainClass.DeviceName)), x + 2, y,
ParentWidth, bh, gSprSession.GD_ARGB(255, 255, 255, 255), PWideChar(FontName), nil, 13,
ID, GS_VISIBLE, 0, GD_Ellipsis) // ***** das war's schon
else
gSprSession.GD_DrawTextToCtrlEx(HSprSession, PWideChar(Trim(MainClass.DeviceName)), x, y,
ParentWidth, bh * 2, gSprSession.GD_ARGB(255, 255, 255, 255), PWideChar(FontName), nil, 13,
ID, GS_VISIBLE, 0, Ord(StringAlignmentCenter));
end;
gSprSession.GD_SetObjectUse3Dshadow(ID, 1.1, true);
gSprSession.GD_SetObjectLinked(ID, LinkedID);
gSprSession.GD_SetObjectLocked(ID, true);