dialog:move( ntop,nleft,nwidth,nheight)
-
- Posts: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- 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: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- 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: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- 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: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
Re: dialog:move( ntop,nleft,nwidth,nheight)
still move and move.
Shuming Wang
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- Contact:
- CharlesKwon
- Posts: 28
- 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: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651