| View previous topic :: View next topic |
| Author |
Message |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Thu Mar 03, 2005 9:40 pm Post subject: Notitle and moveable |
|
|
| I know VDS 5 has the option to remove the window title bar but this makes the window immovable. Is there a way to a make a moveable window without a titlebar? |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Mar 03, 2005 10:18 pm Post subject: |
|
|
Actually, the window is movable, but it requires some maths. I'm pretty
sure that there is a post here somewhere that details this. But since I'm
not sure where it is, give me a few minutes, and I think I can have a
simple example for you. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Mar 03, 2005 10:57 pm Post subject: |
|
|
Try this. It's a little wonky, but you'll get the idea. You can also browse the
Mousedown.dsc sample that came with VDS.
| Code: |
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
|
Edit1:
Figured out what was making dialog reset to 0,0 when clicked. Now works
like it's supposed to. Accidentally swapped two variables  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it."
Last edited by ShinobiSoft on Fri Mar 04, 2005 5:20 am; edited 1 time in total |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Mar 04, 2005 4:16 am Post subject: |
|
|
You should also be able to cheat and send your dialog WM_NCLBUTTONDOWN while the mouse is down which makes Windows think the user is dragging the title bar:
| Code: |
%%WM_NCLBUTTONDOWN = $0A1
%%HTCAPTION = 2
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
while @mousedown(L)
%P = @SENDMSG(@WINEXISTS(MoveNoTitleWindow),%%WM_NCLBUTTONDOWN,%%HTCAPTION,0)
wend
goto Evloop
:CloseBUTTON
:CLOSE
exit
|
I haven't tried it in VDS yet, but works in other languages.. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Mar 04, 2005 4:34 am Post subject: |
|
|
Hiya Sheep,
Doesn't seem to work with VDS 4.5  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Mar 04, 2005 5:03 am Post subject: |
|
|
Scratch that idea then.. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Mar 04, 2005 8:07 am Post subject: |
|
|
I think this issue has been discussed here earlier - try to do a search on NOTITLE & MOVE in the forums...
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Mar 04, 2005 9:07 am Post subject: |
|
|
The VDS Clock example has no title bar and also an invisible bitmap for the window. That illustrates how you can drag using the window itself. _________________ The Tech Pro
www.tech-pro.net |
|
| 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
|
|