View previous topic :: View next topic |
Author |
Message |
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Tue Jan 22, 2002 6:49 pm Post subject: A way to disable previously enable WINDOW ONTOP command |
|
|
Hi,
Is there a way to to disable a WINDOW ONTOP,my window.
You see I have a button then when clicked it will do a WINDOW ONTOP,mywindow. I want to be able to put back "my window" in a
NOT ONTOP mode when I click the button again.
Is that possible?
Thanks
Marty |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Jan 22, 2002 7:22 pm Post subject: |
|
|
Here ya go...
__________________________________________________________________________________________________________________________
Code: |
rem -- Don't show main, it's easier/safer to
rem -- create and destroy child dialogs at will.
DIALOG CREATE, "Test Prog Main",0,0,0,0
:CreateWindow
if %%ontop
DIALOG CREATE,"Test prog",-1,-1,200,100,ONTOP
else
DIALOG CREATE,"Test prog",-1,-1,200,100
end
DIALOG ADD,BUTTON,B1,5,5,80,20,"On Top"
DIALOG ADD,BUTTON,B2,5,90,80,20,"Not On Top"
DIALOG SHOW
:EVLOOP
WAIT EVENT
goto @event()
:B1BUTTON
DIALOG CLOSE
%%ontop = 1
goto CreateWindow
:B2BUTTON
DIALOG CLOSE
%%ontop = ""
goto CreateWindow
:CLOSE
EXIT
|
_________________ 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 |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Wed Jan 23, 2002 8:58 pm Post subject: |
|
|
Well thanks Mac it works well. Never thought of that to create a dummy dialog. But my concern is when I click on my Ontop Button my Dialog flickers a bit. I use a BMP as the dialog. The refresh is not "clean".
Have any other idea ?
I really like your original solution, and it solved another problem that I had. |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Jan 23, 2002 9:50 pm Post subject: |
|
|
It flickers because of closing one dialog before creating
another.
This example closes the 1st dialog AFTER the 2nd is created,
and seems to eliminate the flicker...
__________________________________________________________________________________________________________________________
Code: |
rem -- Don't show main, it's easier/safer to
rem -- create and destroy child dialogs at will.
DIALOG CREATE, "Test Prog Main",0,0,0,0
:CreateWindow
if %%ontop
DIALOG CREATE,"Test prog",-1,-1,200,100,ONTOP
else
DIALOG CREATE,"Test prog",-1,-1,200,100
end
DIALOG ADD,BUTTON,B1,5,5,80,20,"On Top"
DIALOG ADD,BUTTON,B2,5,90,80,20,"Not On Top"
DIALOG SHOW
rem -- Make sure we don't close a dialog at startup --
if %%dialog
DIALOG SELECT, 1
DIALOG CLOSE
%e = @event()
end
%%dialog = 1
:EVLOOP
WAIT EVENT
goto @event()
:B1BUTTON
%%ontop = 1
goto CreateWindow
:B2BUTTON
%%ontop = ""
goto CreateWindow
:CLOSE
EXIT
|
_________________ 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 |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Thu Jan 24, 2002 12:57 pm Post subject: |
|
|
Your second example works great. Now I have to implement this in my code which doesnt work when adding your code. I have multiple elements added to my dialog (list,bitmaps,text,etc...) So when ever It encounters Dialog select,1...Dialog close... everything closes when I click the ONtop button on MY program. So I have to work with your code and see why it closes with my program and not with your example.
Anyway Mac, Thank you very much for the example.
If come up with something I'll post it
Marty |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Jan 24, 2002 2:26 pm Post subject: |
|
|
So what is wrong with using WINDOW NORMAL, mywindow
Like this in the buttons event....
Rem Here is some VDS 3.x code
:BUTTON1BUTTON
If @Equal(%%Ontop, true)
WINDOW ONTOP, mywindow
Else
WINDOW NORMAL, mywindow
End
Exit _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Thu Jan 24, 2002 2:47 pm Post subject: |
|
|
I tried that already, and it didnt work for me with VDS 4
The window would stay ONTOP
Marty |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 24, 2002 10:40 pm Post subject: |
|
|
Marty, make sure you catch the extra close event with
%e = @event() or something similiar. If you're using
the var %e elsewhere to catch events, try using another
var here.
__________________________________________________________________________________________________________________________
Code: |
rem -- Make sure we don't close a dialog at startup --
if %%dialog
DIALOG SELECT, 1
DIALOG CLOSE
%e = @event()
end
%%dialog = 1
|
_________________ 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 |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jan 30, 2002 4:26 pm Post subject: |
|
|
Hi All,
Sorry about my post earlier. I was not aware that there was a problem with WINDOW NORMAL or WINDOW ONTOP so I wrote my own. It will be in an up and comming DLL I am working on. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Wed Jan 30, 2002 5:51 pm Post subject: |
|
|
Hey that's great!!
Can't wait to try that...
Marty |
|
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
|
|