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


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sat Feb 26, 2005 3:56 pm Post subject: Attaching/Docking two windows? |
|
|
Hi Guys,
Would anyone be able to post an example of how to attach/dock/embed one window (such as a non-VDS application) onto another window (a VDS application), so that the attached dialog will move along with the host window?
Seems to me I saw an example awhile back, but I cannot find it.
Thanks,
- Boo |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Feb 26, 2005 4:41 pm Post subject: |
|
|
| Code: |
dialog create,Parent,0,0,300,300,RESIZABLE
dialog show
dialog create,Child1,30,10,100,290,SMALLCAP,ONTOP
dialog show
dialog create,Child2,30,120,180,290,SMALLCAP,ONTOP
dialog show
goto Timer
:Evloop
wait 0.1,event
parse "%E;%D",@event(D)
goto %E
:RESIZE
:Timer
dialog select,0
parse "%%pT;%%pL;%%pH",@winpos(Parent,TLH)
%%cT = @sum(%%pT,30)
%%cL = @sum(%%pL,
rem Child1 has a fixed width of 100
window pos,Child1,%%cT,%%cL,,@diff(@dlgpos(,H),10)
%%cL = @sum(%%cL,105)
window pos,Child2,%%cT,%%cL,@diff(@dlgpos(,W),%%cL),@diff(@dlgpos(,H),10)
goto Evloop
:CLOSE
if @greater(%D,0)
goto Evloop
end
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it."
Last edited by ShinobiSoft on Mon Feb 28, 2005 1:08 am; edited 1 time in total |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sun Feb 27, 2005 5:14 pm Post subject: |
|
|
| Thanks! |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sun Feb 27, 2005 9:11 pm Post subject: |
|
|
Works fine; thanks.
By the way... Is there any way to make the docked windows move along with the main window in real time (as the main window is actually being moved)?
Thanks again,
- Boo |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Feb 27, 2005 10:24 pm Post subject: |
|
|
I guess the idea of a external DLL made to do this would probably not be visible since it needs real time numbers of its position?
Would be nice to have a DLL that allowed simular to the below:
EXTERNAL VDSDOCK.dll,Demo
#define command,DOCK
#define function,DOCK
DOCK,<main window name>,<second window name>,<base><position><gap>
<base>
west north east south
<position>
distance from TOP
distance from LEFT
<gap>
distance between windows
maybe more features could be added, who knows.. 
Last edited by vtol on Sun Feb 27, 2005 10:55 pm; edited 1 time in total |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Feb 27, 2005 10:53 pm Post subject: |
|
|
Actually an external dll would be one approach, but since most have
moved on to VDS 5, why not write a DSU to handle this? _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Feb 27, 2005 10:59 pm Post subject: |
|
|
I don't know, I just figured it would be about as complicated as making a DSU for ReSize, maybe most would rather someone else do all the work and give em' about 10 or 20 bucks (I really haven't looked at the script above that good though)..
I'm just spittin words to see where they land  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Feb 27, 2005 11:05 pm Post subject: |
|
|
The posted script is just a very simple example of how to accomplish what
Boo was asking for. It could use several improvments, but for others to
get the general idea, it'll work just fine .
As far as writing an extension for this, you first need to figure your
command params and function args, then we need to process all the
messages sent to a window. Now that I give it some real thought, LOL,
it prolly wouldn't be that hard to write. I however, have too many projects
going at the moment, and I really don't need to start another. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Feb 27, 2005 11:13 pm Post subject: |
|
|
naa, I wassnt saying it needs this or that, and I also think its ingenious.
The only thing I would have to do(for my momentary vertical progress meter) is set it up so that the just 1 child are on the outside, and I don't know if I want to attempt it with out knowing what the '@diff(@dlgpos(,H),10)' is for, is it just there in case you want to add resize?
I noticed everything else looks pritty simple..  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 28, 2005 12:58 am Post subject: |
|
|
| vtol wrote: | naa, I wassnt saying it needs this or that, and I also think its ingenious.
The only thing I would have to do(for my momentary vertical progress meter) is set it up so that the just 1 child are on the outside, and I don't know if I want to attempt it with out knowing what the '@diff(@dlgpos(,H),10)' is for, is it just there in case you want to add resize?
I noticed everything else looks pritty simple..  |
| Code: |
@diff(@dlgpos(,H),10)
|
@dlgpos() returns client coordinates. So I'm setting the height for
and item based on the client height of the main window minus 10 pixels so
that the child window can be positioned with 5 pixels padding, top and
bottom. And yes, that is for the RESIZE event, which I forgot to add to
the posted code. I will update it.  _________________ 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: Mon Feb 28, 2005 1:10 am Post subject: |
|
|
The above script has been updated. 'Child1' has a fixed window width and
'Child2' will take up the remainder of the dialog. Added code for the
RESIZE event as well and added the RESIZABLE style to the parent
dialog. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Mon Feb 28, 2005 2:03 am Post subject: |
|
|
So I guess what I was really trying to ask is, since my program is not re-sizable, can I simply leave that line off? '@diff(@dlgpos(,H),10)'
NOTE:
I'm still talking about the original post of the entire script. |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 28, 2005 2:49 am Post subject: |
|
|
Yes you can. for the window pos command, and position fields that
are left NULL are not changed in the mentioned window. So if you only
want to move a window but not resize it, just use the left and top params
for the window pos command  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Mon Feb 28, 2005 3:35 am Post subject: |
|
|
cool
That will make it nice now that I understand how it works
Maybe someday when I get time can create a DSU (fill in the blanks) Docker to muster an easy automation of this task
Thanks bweckel, I appreciate all you did for me related to your Docker script - etc.. 
Last edited by vtol on Mon Feb 28, 2005 4:03 am; edited 1 time in total |
|
| 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
|
|