forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Attaching/Docking two windows?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sat Feb 26, 2005 3:56 pm    Post subject: Attaching/Docking two windows? Reply with quote

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
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Feb 26, 2005 4:41 pm    Post subject: Reply with quote

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,Cool
 
  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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Feb 27, 2005 5:14 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Feb 27, 2005 7:44 pm    Post subject: Reply with quote

If bweckel's example doesn't work, add the following line to his code: Smile

Code:
option decimalsep,.

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Feb 27, 2005 9:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Feb 27, 2005 10:24 pm    Post subject: Reply with quote

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.. Cool


Last edited by vtol on Sun Feb 27, 2005 10:55 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Feb 27, 2005 10:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Feb 27, 2005 10:59 pm    Post subject: Reply with quote

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 Laughing
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Feb 27, 2005 11:05 pm    Post subject: Reply with quote

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 Wink.

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Feb 27, 2005 11:13 pm    Post subject: Reply with quote

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.. Wink
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 28, 2005 12:58 am    Post subject: Reply with quote

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.. Wink


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. Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 28, 2005 1:10 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Mon Feb 28, 2005 2:03 am    Post subject: Reply with quote

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)' Question

NOTE:
I'm still talking about the original post of the entire script.
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 28, 2005 2:49 am    Post subject: Reply with quote

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 Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Mon Feb 28, 2005 3:35 am    Post subject: Reply with quote

cool

That will make it nice now that I understand how it works Cool

Maybe someday when I get time can create a DSU (fill in the blanks) Docker to muster an easy automation of this task Idea

Thanks bweckel, I appreciate all you did for me related to your Docker script - etc.. Cool


Last edited by vtol on Mon Feb 28, 2005 4:03 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group