Вверх ↑
Ответов: 5227
Рейтинг: 586
#1: 2022-01-14 15:05:42 ЛС | профиль | цитата
nesco, заразил ты меня переделать на SetWindowPos
вот такая у меня процедурка получилась, сплитер работает нормально


procedure THIWin.SetAnchors;
var
w,h,d: integer;
begin
if Control.Align <> caNone then Exit;
//if not Control.HandleAllocated then Exit;

// один раз инициализируем и пользуемся
// в Init Control.Parent. Width и Height не работают !
if not InitSize then
begin
FOldTop := _prop_Top;
FOldLeft := _prop_Left;
FOldRight := Control.Parent.Width - (_prop_Left+_prop_Width);
FOldBottom := Control.Parent.Height - (_prop_Top+_prop_Height);
FOldWidth := _prop_Width;
FOldHeight := _prop_Height;
InitSize := True;
end;

if _prop_akRight then
begin
w := FParent.Width - (FOldLeft+FOldRight);
h := Control.Height;
if not _prop_akLeft then
begin
d := FParent.Width - (FOldWidth + FOldRight);
SetWindowPos(Control.Handle, 0, d, FOldTop, FOldWidth, h, SWP_NOZORDER);
end else
SetWindowPos(Control.Handle, 0, FOldLeft, FOldTop, w, h, SWP_NOZORDER);
end;

if _prop_akBottom then
begin
w := Control.Width;
h := FParent.Height - (FOldTop+FOldBottom);
if not _prop_akTop then
begin
d := FParent.Height - (FOldHeight+FOldBottom);
SetWindowPos(Control.Handle, 0, Control.Left, d, w, fOldHeight, SWP_NOZORDER);
end else
SetWindowPos(Control.Handle, 0, Control.Left, Control.Top, w, h, SWP_NOZORDER);
end;

case _prop_MaxHeight of
0:;
else if Control.Height > _prop_MaxHeight then Control.Height := _prop_MaxHeight; end;

case _prop_MinHeight of
0:;
else if Control.Height < _prop_MinHeight then Control.Height := _prop_MinHeight; end;

case _prop_MaxWidth of
0:;
else if Control.Width > _prop_MaxWidth then Control.Width := _prop_MaxWidth; end;

case _prop_MinWidth of
0:;
else if Control.Width < _prop_MinWidth then Control.Width := _prop_MinWidth; end;

end;
карма: 4
Мой форум - http://hiasm.bbtalk.me/ схемы, компоненты...
0