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 


Attach child window to main...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Apr 28, 2006 12:00 am    Post subject: Attach child window to main... Reply with quote

Attach child window to main window ?

Let say that main window have SAVEPOS and when the child window is started it openes outside >center of desktop.

I can add SAVEPOS to child window but if main window changes the position then it must be SAVEPOS be done again on child window... Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Wed May 03, 2006 8:58 am    Post subject: Reply with quote

Give this a try:


DockToolWnd.dsc
 Description:
Min/Max Aware

Download
 Filename:  DockToolWnd.dsc
 Filesize:  1.8 KB
 Downloaded:  1056 Time(s)

Back to top
View user's profile Send private message Send e-mail
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Wed May 03, 2006 9:30 pm    Post subject: Reply with quote

OK... Cool

Nice to see some good coding...

Yes if you have full screen ap. you don't use this...

Thanks anyway... Cool
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Wed May 03, 2006 10:50 pm    Post subject: Reply with quote

Sorry, I misread your original message, I wouldn't recommend SavePos on a Child. If you're just centering a child window over the parent the code below might help.

Code:
 
Title Center Child Window Demo
  DIALOG CREATE,Main Window,-1,0,340,230,SAVEPOS,RESIZABLE
  DIALOG ADD,STATUS,STATUS1
  DIALOG ADD,BUTTON,BUTTON1,10,9,89,31,Open Child
  DIALOG SHOW

:Resize
:Evloop
  wait event
  goto @event()

:BUTTON1BUTTON
  gosub ChildOpen
  goto evloop
 
:Close
  exit

# Subroutine 
:ChildOpen
  parse "%T;%L;%W;%H",@dlgpos(,TLWH)
  if @greater(%W,200)
    %W = @div(@diff(%W,200),2)   
    %L = @sum(%L,%W)
  end
  if @greater(%H,140)
    %H = @div(@diff(%H,140),2)
    %T = @sum(%T,%H)
  end
  DIALOG CREATE,Child Window,%T,%L,200,140,,SMALLCAP,ONTOP
  DIALOG SHOW
  dialog select,1

:Child_Loop
  wait event
  parse "%E;%W",@event(D)
  if @equal(%W,1)
    goto Child_%E
  else
    beep
    goto Child_Loop
  end

:Child_Close
  DIALOG CLOSE
  repeat
    wait event
    parse "%E;%W",@event(D)
  until @equal(CLOSE1,%E%W)
  dialog select,0
  exit
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
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