dialog:move( ntop,nleft,nwidth,nheight)

dialog:move( ntop,nleft,nwidth,nheight)

Postby ShumingWang » Sat Nov 01, 2014 2:15 am

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby Antonio Linares » Sat Nov 01, 2014 7:42 am

Shuming,

Try doing this:

odlg:Move( nTop, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby ShumingWang » Sat Nov 01, 2014 10:11 am

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby Antonio Linares » Sat Nov 01, 2014 11:23 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby ShumingWang » Sat Nov 01, 2014 11:43 am

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby Antonio Linares » Sat Nov 01, 2014 11:52 am

Have you tried ?

odlg:Move( nTop - 1, nLeft, nRight - nLeft + 1, nBottom - nTop + 1 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby ShumingWang » Sat Nov 01, 2014 12:52 pm

still move and move.
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby Antonio Linares » Sat Nov 01, 2014 1:20 pm

Shuming,

Just to the top or to the left too ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby CharlesKwon » Sun Nov 02, 2014 8:52 am

In my case, I use GetRect() method for save a pre-postions.
User avatar
CharlesKwon
 
Posts: 28
Joined: Sun Nov 02, 2014 7:03 am

Re: dialog:move( ntop,nleft,nwidth,nheight)

Postby ShumingWang » Mon Nov 03, 2014 2:06 am

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests