| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sun Jan 20, 2008 2:15 pm Post subject: Move dialog Help [SOLVED] |
|
|
Hi Guyz,
I Would Like to move a dialog without title and I write this but not work fine, first time click on the dialog, dialog move to pos 0,0 I know wrong something but I don't understand what.
Someone can help me please?
| Code: | Title Demo
DIALOG CREATE,Demo,-1,0,240,160,NOTITLE,CLICK,ONTOP
DIALOG ADD,TEXT,Demo1,60,53,,,Demo Dialog
DIALOG ADD,TEXT,TEXT1,15,103,,,TEXT1
DIALOG SHOW
%x = 240
%y = 160
:Loop
Wait Event
Goto @Event()
:Click
Parse "%%Ox;%%Oy",@MousePos(XY)
While @MouseDown(L)
Parse "%a;%b",@MousePos(XY)
%x = @Diff(%a,%%Ox)
%y = @Diff(%b,%%oy)
End
Dialog SetPos,,%y,%x
Wend
Goto Loop
|
Last edited by Tdk161 on Mon Jan 21, 2008 8:12 am; edited 1 time in total |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Jan 20, 2008 7:59 pm Post subject: |
|
|
HI Tdk161,
Try this script::
| Code: |
option decimalsep,"."
option scale,96
dialog create,MoveNoTitleWindow,-1,0,300,200,NOTITLE,CLICK
dialog add,BUTTON,Close,170,225,70,25,Close
dialog show
:Evloop
wait 0.1,event
%E = @event()
goto %E
:Timer
goto Evloop
:CLICK
parse "%X;%Y",@mousepos(XY)
parse "%T;%L",@winpos(MoveNoTitleWindow,TL)
%%dX = @diff(%X,%L)
%%dY = @diff(%Y,%T)
while @mousedown(L)
parse "%%X;%%Y",@mousepos(XY)
%%newX = @diff(%%X,%%dX)
%%newY = @diff(%%Y,%%dY)
if @greater(0,%%newX)
%%newX = 0
end
if @greater(0,%%newY)
%%newY = 0
end
window position,MoveNoTitleWindow,%%newY,%%newX
wend
goto Evloop
:CloseBUTTON
:CLOSE
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|