dialog:move( ntop,nleft,nwidth,nheight)
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
dialog:move( ntop,nleft,nwidth,nheight)
hi,
define dialog odlg
ntop:=myrestorentop()
nleft:=myrestorenleft()
nbottom:=myrestorenleft()
nright:=myrestorenright()
activate dialog odlg ;
on init (odlg:move(ntop,nleft,nright-nleft,nbottom-ntop));
valid (mysave( odlg:ntop,odlg:nleft,odlg:nbottom,odlg:nright),.t.)
The dialg position moves some rows up, why ?
Regrads!
Shuming Wang
define dialog odlg
ntop:=myrestorentop()
nleft:=myrestorenleft()
nbottom:=myrestorenleft()
nright:=myrestorenright()
activate dialog odlg ;
on init (odlg:move(ntop,nleft,nright-nleft,nbottom-ntop));
valid (mysave( odlg:ntop,odlg:nleft,odlg:nbottom,odlg:nright),.t.)
The dialg position moves some rows up, why ?
Regrads!
Shuming Wang
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: dialog:move( ntop,nleft,nwidth,nheight)
Shuming,
Try doing this:
odlg:Move( nTop, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
Try doing this:
odlg:Move( nTop, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
Re: dialog:move( ntop,nleft,nwidth,nheight)
Still can not move to the proper postion .
odlg:ntop:=240
odlg:nleft:=2
odlg:nbottom:=678
odlg:nright:=548
@1,2 BUTTON "aaa" OF odlg ACTION msginfo(cvaltochar(odlg:ntop)+","+cvaltochar(odlg:nleft)+","+cvaltochar(odlg:nbottom)+","+cvaltochar(odlg:nright))
// result : 191,-1,665,555 ,not 240,2,678,548
shuming Wang
odlg:ntop:=240
odlg:nleft:=2
odlg:nbottom:=678
odlg:nright:=548
@1,2 BUTTON "aaa" OF odlg ACTION msginfo(cvaltochar(odlg:ntop)+","+cvaltochar(odlg:nleft)+","+cvaltochar(odlg:nbottom)+","+cvaltochar(odlg:nright))
// result : 191,-1,665,555 ,not 240,2,678,548
shuming Wang
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: dialog:move( ntop,nleft,nwidth,nheight)
Shuming,
dialogs use "units" not pixels, so if you want to set the exact position move them from the ON INIT clause of the dialog
dialogs use "units" not pixels, so if you want to set the exact position move them from the ON INIT clause of the dialog
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
Re: dialog:move( ntop,nleft,nwidth,nheight)
on init odlg:move() can't move to the proper postion.
odlg:Move( nTop, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
Each time dialog moves more top .
Shuming Wang
odlg:Move( nTop, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
Each time dialog moves more top .
Shuming Wang
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: dialog:move( ntop,nleft,nwidth,nheight)
Have you tried ?
odlg:Move( nTop - 1, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
odlg:Move( nTop - 1, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: dialog:move( ntop,nleft,nwidth,nheight)
Shuming,
Just to the top or to the left too ?
Just to the top or to the left too ?
- CharlesKwon
- Posts: 6
- Joined: Sun Nov 02, 2014 7:03 am
Re: dialog:move( ntop,nleft,nwidth,nheight)
In my case, I use GetRect() method for save a pre-postions.
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
Re: dialog:move( ntop,nleft,nwidth,nheight)
Thank Antonio and CharlesKwon!
GetWndRect(odlg:hwnd) can be used to save the postion, while saving odlg:ntop,odlg:nleft,.. no use.
ACTIVATE DIALOG oDlg
on INIT (odlg:move(ntop1,nleft1,nright1-nleft1+1,nbottom1-ntop1+1),.t.)
VALID (arect:=GetWndRect(odlg:hwnd),;
oserver:query("insert into browseset (id,cvalue) ;
values ('sub0804','"+cvaltochar(arect[1])+","+cvaltochar(arect[2])+","+cvaltochar(arect[3])+","+cvaltochar(arect[4])+",') ;
on duplicate key update cvalue='"+cvaltochar(arect[1])+","+cvaltochar(arect[2])+","+cvaltochar(arect[3])+","+cvaltochar(arect[4])+",'"),.t.)
Shuming wang
GetWndRect(odlg:hwnd) can be used to save the postion, while saving odlg:ntop,odlg:nleft,.. no use.
ACTIVATE DIALOG oDlg
on INIT (odlg:move(ntop1,nleft1,nright1-nleft1+1,nbottom1-ntop1+1),.t.)
VALID (arect:=GetWndRect(odlg:hwnd),;
oserver:query("insert into browseset (id,cvalue) ;
values ('sub0804','"+cvaltochar(arect[1])+","+cvaltochar(arect[2])+","+cvaltochar(arect[3])+","+cvaltochar(arect[4])+",') ;
on duplicate key update cvalue='"+cvaltochar(arect[1])+","+cvaltochar(arect[2])+","+cvaltochar(arect[3])+","+cvaltochar(arect[4])+",'"),.t.)
Shuming wang