Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.01.20;
Скачать: CL | DM;

Вниз

Как сделать   Найти похожие ветки 

 
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;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.016 c
1-63233
Zeon
2004-01-05 00:36
2004.01.20
Проги под Linux


1-63210
PaleoZ
2004-01-08 18:28
2004.01.20
Вызов процедур несуществующих компонентов


3-63032
Denisiy
2003-12-22 15:15
2004.01.20
Как программно создать алиас в BDE ?


1-63203
vgb
2004-01-10 00:09
2004.01.20
TWebBrowser


1-63150
zzet
2004-01-06 21:32
2004.01.20
FloatToDecimal