| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Sun Sep 29, 2002 3:03 pm Post subject: info window question |
|
|
hello all
how do i make a info window open up THEN close byitself in about 2 secs?
thanks |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Sep 29, 2002 3:17 pm Post subject: |
|
|
You can't...
But if you really want it, you can make a 'fake' info window, with the dialog editor. Or make another program that you'll run before opening the info, which will close it with the use of window send,windowname,@cr()... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Sun Sep 29, 2002 3:21 pm Post subject: ok |
|
|
ok
thanks  |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 29, 2002 5:21 pm Post subject: |
|
|
Here's some code that can help -- you might have a different offset for the icon in explorer.exe, how ever, try it and see if it works. It may vary upon operating system...
| Code: | Title Information
beep
rem Put the number of seconds in which you would like to wait before the box closes...
%%wait = 2
rem End define variables...
DIALOG CREATE,Information,-1,0,345,119,,NOMIN
DIALOG ADD,TEXT,msgtext,12,54,280,68,Your information here.@cr()Use the "@cr()" function to make another line.
rem You can change the icon by changing the offset after explorer.exe (explorer.exe|#)
DIALOG ADD,BITMAP,ICON,10,10,32,32,@windir()\explorer.exe|7
DIALOG ADD,BUTTON,OK,84,132,82,24,OK
DIALOG SHOW
:Evloop
wait event,%%wait
goto @event()
:Timer
:OKBUTTON
exit |
Hope this helps...  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Sep 29, 2002 5:46 pm Post subject: |
|
|
Hi Freezing Fire,
It's better that if you make an example, to use a gosub. Then it's a lot easier to use it for unexperience users...
| Code: |
DIALOG CREATE,Window,-1,0,240,160
DIALOG ADD,BUTTON,BUTTON1,64,84,64,24,BUTTON1
DIALOG SHOW
:evloop
wait event
goto @event()
:button1button
rem Put the number of seconds in which you would like to wait before the box closes...
%%wait = 2
%%infotext = Your information here.@cr()Use the "@cr()" function to make another line.
gosub Infobox
goto evloop
:Close
exit
:Infobox
rem You MUST have a main window, otherwise you can't close this one...
beep
dialog CREATE,Information,-1,0,345,95,,NOMIN
dialog ADD,TEXT,msgtext,12,54,280,68,%%infotext
dialog ADD,BITMAP,ICON,10,10,32,32,@windir()\explorer.exe|7
dialog ADD,BUTTON,OK,60,132,82,24,OK
dialog SHOW
wait event,%%wait
dialog close
rem This will set the event to NULL... Remove if there must be an event...
%%abc = @event(D)
exit |
Here is an example. I also changed some xy stuff so that it exactly looks like a real info. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Sep 29, 2002 7:38 pm Post subject: |
|
|
Here's one I've used for a while that sizes the window
according to the message (designed as a subroutine):
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
| Code: |
%%info = "This is a test"@cr()@cr()"This is only a test..."@cr()@cr()"This is a test"@cr()@cr()"This is only a test..."@cr()@cr()"This is a test"@cr()@cr()"This is only a test..."@cr()@cr()"This is a test"@cr()@cr()"This is only a test..."
INFO Ready?
GOSUB InfoWindow
:CLOSE
EXIT
:InfoWindow
rem -- Let's us know if we fail to init %%info --
if @not(%%info)
%%info = "Oops, no message..."
end
%%infowidth = @prod(@len(%%info), 8)
%%infoheight = 16
rem -- Adjust height if @cr() found --
%%tmp = %%info
%%longest = @pos(@chr(13), %%info)
REPEAT
if @greater(@pos(@chr(13),%%tmp), 0)
if @greater(@pos(@chr(13), %%tmp), %%longest)
%%longest = @pos(@chr(13), %%tmp)
%%infowidth = @prod(%%longest, 8)
end
%%tmp = @strdel(%%tmp,1,@pos(@chr(13), %%info))
%%infoheight = @sum(%%infoheight, 16)
end
UNTIL @equal(0, @pos(@chr(13), %%tmp))
rem -- Create the message window --
DIALOG CREATE,"InfoWindow",-1,-1,@sum(%%infowidth,60),@sum(%%infoheight,42),NOTITLE,ONTOP
DIALOG ADD,STYLE,StyleInfo,Courier New,10,BC,DKBLUE,WHITE
DIALOG ADD,STYLE,StyleInfoTrim,,,,WHITE
DIALOG ADD,TEXT,Info1,1,1,@sum(%%infowidth,58),@sum(%%infoheight,40),,,StyleInfoTrim
DIALOG ADD,TEXT,Info2,4,4,@sum(%%infowidth,52),@sum(%%infoheight,34),@cr()%%info,,StyleInfo
DIALOG SHOW
WAIT "5"
rem -- Closes info window since it's the current one --
DIALOG CLOSE
rem -- Always kill extra event --
%e = @event()
%%info = ""
%%tmp = ""
%%longest = ""
%%infowidth = ""
%%infoheight = ""
exit
|
Cheers, Mac _________________ 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

Last edited by Mac on Sun Sep 29, 2002 9:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Sep 29, 2002 9:14 pm Post subject: |
|
|
OOPS
Just realized my original didn't adjust width if @cr()
was used. Should be fixed now. Also clears all vars.
Also the WAIT is 5 seconds so ya can check it out.
change this to whatever time ya want.
Cheers, Mac  _________________ 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 |
|
 |
|
|
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
|
|