Вот нашел в архивах. прошу прощения проверить не могу 2.5 нету, но насколько я помню там все оказалось просто в методе:
X++:
private str textTranc(str _text)
{
int txtWith, i = 9;
str textTmp = _text;
txtWith = conpeek(winapi::getLineDim(_text), 1);
while (txtWith > 250)
{
textTmp = substr(_text, 1, 8) + '...' + substr(_text, i, strlen(_text) - i+1);
txtWith = conpeek(winapi::getLineDim(textTmp), 1);
i++;
}
return textTmp;
}
который используется здесь:
X++:
void setText(str _text, int _idx = 1)
{
if (!_text)
_text = ' '; //avoid flicker
progressText[_idx] = this.textTranc(_text);
this.update();
}
ну и соответственно ключевой метод:
X++:
// blokva 16.02.2004 -->> Метод возвращает контейнер с длиной (1) и высотой (2) строки текста в ПИКСЕЛАХ
client static container getLineDim(str strtarget)
{
int x, y;
HWND deviceContext;
Binary point = new Binary(#offset8);
Binary bstr = new Binary(strtarget);
DLL _DLL = new DLL('GDI32');
DLLFunction _getTextExtentPoint32 = new DLLFunction(_DLL, 'GetTextExtentPoint32A');
deviceContext = WinApi::createDC();
_getTextExtentPoint32.returns(ExtTypes::DWORD);
_getTextExtentPoint32.arg(ExtTypes::DWORD, ExtTypes::POINTER, ExtTypes::DWORD, ExtTypes::POINTER);
_getTextExtentPoint32.call(deviceContext, bstr, strlen(strtarget), point);
x = point.dWord(#Offset0);
y = point.dWord(#sizeOfInt);
return [x, y];
}
думаю дальше не трудно приспособить к любой версии, ибо во всез версиях Аксы эта функциональность меняецца....