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


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Mar 16, 2003 2:44 am Post subject: Catch the minimize button? |
|
|
Is it possible to catch the event for the minimize button like with the close button?
I'm asking 'cause I want my program to minimize to the taskicon instead of normal minimize. _________________
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Mar 16, 2003 2:47 am Post subject: |
|
|
Here's a way:
| Code: | DIALOG CREATE,New Dialog,-1,0,240,160,RESIZABLE
DIALOG SHOW
:evloop
wait event
goto @event()
:resize
window normal,new dialog
goto evloop
:close
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Mar 16, 2003 2:48 am Post subject: |
|
|
You need to check the windows state. Obtained by @winpos(Window,S)
Returns:
| Code: |
3 = Maximized
2 = Minimized
1 = Normal
|
I believe.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Mar 16, 2003 2:48 am Post subject: |
|
|
This one doesn't show the dialog minimizing quite as much:
| Code: | DIALOG CREATE,New Dialog,-1,0,240,160,RESIZABLE
DIALOG SHOW
:evloop
wait event
goto @event()
:resize
window hide,new dialog
window normal,new dialog
goto evloop
:close
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Mar 16, 2003 2:49 am Post subject: |
|
|
Check @winpos() with the "S" flag (iconized is 2).
You can do this in a timer loop.
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Mar 16, 2003 2:51 am Post subject: |
|
|
OOPS
I love this 28k connection...  _________________ 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 |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Mar 16, 2003 2:53 am Post subject: |
|
|
Put a :Timer label in your script like the following:
| Code: |
:Timer
%S = @winpos(<Window Name>,S)
if @equal(%S,2)
window HIDE,<Window Name>
end
goto Evloop
|
And of course in your :Evloop label:
Remember to replace <Window Name> with the titlebar text or the window
identifer of your window.
See if that isn't what ya want.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Mar 16, 2003 2:53 am Post subject: |
|
|
Thanks alot for your quick responses guys.
Still haven't learned how the timer functions work yet, but I'll throw myself into it right away  _________________
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Mar 16, 2003 2:55 am Post subject: |
|
|
Oops.
BWeckel, you're right about this. My code is just for catching the minimize
event. Your code shows minimizing it to the task icon.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Mar 16, 2003 3:00 am Post subject: |
|
|
| Quote: | Still haven't learned how the timer functions work yet, but I'll throw myself into it right away |
Are you talking about TIMER and @TIMER()? There's a good example which
shows the using of the TIMER command and the @TIMER() function with
Visual DialogScript's installation.
Otherwise, if you're talking about the WAIT EVENT,1 kind of stuff it's
really quite simple:
| Code: | REM -- Wait for an event for 2 seconds --
wait event,2
goto @event()
:Timer
REM -- This label is just the event generated every two seconds. --
goto evloop
:Close
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Mar 16, 2003 3:04 am Post subject: |
|
|
Yeah, I understand the WAIT command.
But not the TIMER and @TIMER() functions.
I'll have a look at the examples
Thanks guys. _________________
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Mar 16, 2003 6:31 am Post subject: |
|
|
| Code: | Title TestDialog
DIALOG CREATE,TestDialog,10,10,300,200,CLASS TESTDIALOGWINDOW001
DIALOG SHOW
%%WinView = 1
:Eventloop
Wait Event,0
%E = @event()
if %E
goto %E
end
goto Eventloop
:TIMER
If @equal(%%WinView,1)
If @equal(@winpos(#TESTDIALOGWINDOW001,S),2)
Window Hide,#TESTDIALOGWINDOW001
DIALOG ADD,TASKICON,TASKICON1,%0,Test Dialog
%%WinView = 0
End
End
goto Eventloop
:CLOSE
EXIT
:TASKICON1CLICK
Window Normal,#TESTDIALOGWINDOW001
Window Activate,#TESTDIALOGWINDOW001
%%WinView = 1
DIALOG REMOVE,TASKICON1
goto Eventloop |
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Mar 16, 2003 4:36 pm Post subject: |
|
|
Perfect. Thanks alot Garrett
Sorry for all the trouble  _________________
 |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Nov 18, 2004 7:30 am Post subject: |
|
|
I was just about to ask the same question again, but did a search and here it was
Guess I've been away from VDS too long.  _________________
 |
|
| Back to top |
|
 |
|