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 


Appearing Window...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 15, 2002 5:38 am    Post subject: Appearing Window... Reply with quote

Make your window grow from nothing (almost). I tried some changes
to make it a little more practical (hopefully). Also added a shrinking
window close at exit.

NOTE: WINDOW POSITION does not exactly use the same original
window height and width. I adjusted the width by 5, which seems OK,
but the height will need adjusting for NOTITLE style, MENU elements,
etc.
________________________________________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
%%centerX = @div(@sysinfo(SCREENWIDTH), 2)
%%centerY = @div(@sysinfo(SCREENHEIGHT), 2)

rem -- Create window with zero width and height --
DIALOG CREATE,"Main Test Window",%%centerY,%%centerX,0,0
  DIALOG ADD,BUTTON,B1,0,5,40,20,
  DIALOG ADD,BUTTON,B2,0,355,40,20,
  DIALOG ADD,LIST,L1,25,5,390,170
DIALOG SHOW

rem -- Desired window width and height --
%%winW = 400
%%winH = 200
%x = 100
%y = 50
REPEAT
  if @greater(%%winW, %x)
     rem -- Must use "1" or a number that %%winW is divisible by --
     %x = @sum(%x, 2)
  end
  if @greater(%%winH, %y)
     %y = @succ(%y)
  end
  rem -- Window height in this line must be adjusted for NOTITLE style, MENU elements, etc. --
  WINDOW POSITION,"Main Test Window",@diff(%%centerY, @div(%y,2)),@diff(%%centerX, @div(%x,2)),@sum(%x,5),@sum(%y,25)
UNTIL @both(@equal(%x, %%winW), @equal(%y, %%winH))

:B1BUTTON
:B2BUTTON
  WAIT EVENT
  goto @event()

:CLOSE
  rem -- Quick window shrink --
  %x = %%winW
  %y = %%winH
  REPEAT
    %x = @diff(%x, 10)
    %y = @diff(%y, 5)
    WINDOW POSITION,"Main Test Window",@diff(%%centerY, @div(%y,2)),@diff(%%centerX, @div(%x,2)),%x,%y
  UNTIL @both(@greater(100, %x), @greater(50, %y))
  EXIT

[EDIT]
Made some changes, see top of post.

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
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 -> Visual DialogScript 3 Source Code 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