Форум: "Основная";
Текущий архив: 2004.01.20;
Скачать: [xml.tar.bz2];
ВнизКак сделать Найти похожие ветки
← →
Layner (2004-01-06 10:28) [0]Есть хороший код для основного приложения:
procedure Tfm.WMWindowPosChanging(var Message:TMessage);
type
PWindowPos = ^TWindowPos; //прилипалка к краям формы
var
vp : PWindowPos;
const
xdelt = 10;
ydelt = 10;
begin
vp := PWindowPos(Message.LParam);
if abs(vp^.x) < xdelt then vp^.x := 0
else
if abs(Screen.Width - (vp^.x + width)) < xdelt then
vp^.x := Screen.Width - width;
if abs(vp^.y) < ydelt then vp^.y := 0
else
if abs(Screen.Height - (vp^.y + height)) < ydelt then
vp^.y := Screen.Height - height;
end;
Никто не поможет его доработать для дочерних окон MDI интерфейса?
← →
Layner (2004-01-08 09:09) [1]Top
← →
div (2004-01-08 21:02) [2]
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure wmWindowPosChanging(var Msg: TMessage); message wm_WindowPosChanging;
end;
var
Form1: TForm1;
implemlementation
procedure TForm1.wmWindowPosChanging;
const
xStep = 10;
yStep = 10;
begin
with TWindowPos(Pointer(Msg.LParam)^) do
begin
if x < xStep then
x := 0;
if x + cx > Screen.Width - xStep then
x := Screen.Width - cx;
if y < yStep then
y := 0;
if y + cy > Screen.Height then
y := Screen.Height - cy;
end;
end;
устроит ? )))))))
← →
div (2004-01-08 21:12) [3]блиииииаааааа...
сорри невнимательно прочитал вопрос.
вот для MDIChild-окна (Form1 - родитель):
type
TForm2 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure wmWindowPosChanging(var Msg: TMessage); message wm_WindowPosChanging;
end;
var
Form2: TForm2;
implementation
uses Unit1;
procedure TForm2.wmWindowPosChanging;
const
xStep = 10;
yStep = 10;
begin
with TWindowPos(Pointer(Msg.LParam)^) do
begin
if x < xStep then
x := 0;
if x + cx > Form1.ClientWidth - xStep then
x := Form1.ClientWidth - cx - 4;
if y < yStep then
y := 0;
if y + cy > Form1.ClientHeight - yStep then
y := Form1.ClientHeight - cy - 4;
end;
end;
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2004.01.20;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.012 c