Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 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
1-63164
Intell
2004-01-06 15:45
2004.01.20
Как выделять индекс в ListBox?


1-63218
Gandrei
2004-01-09 16:12
2004.01.20
Настраиваемое MainMenu


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


14-63296
MPS
2003-12-30 07:38
2004.01.20
Оптимальная конфигурация Linux


14-63399
sirgfine
2003-12-28 03:19
2004.01.20
Неполадка программы





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский