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 


A way to disable previously enable WINDOW ONTOP command

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Tue Jan 22, 2002 6:49 pm    Post subject: A way to disable previously enable WINDOW ONTOP command Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Tue Jan 22, 2002 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed Jan 23, 2002 8:58 pm    Post subject: Reply with quote

Very Happy 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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Wed Jan 23, 2002 9:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Jan 24, 2002 12:57 pm    Post subject: Reply with quote

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 Wink

Marty
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Jan 24, 2002 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Jan 24, 2002 2:47 pm    Post subject: Reply with quote

I tried that already, and it didnt work for me with VDS 4

The window would stay ONTOP

Marty
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Thu Jan 24, 2002 10:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jan 30, 2002 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed Jan 30, 2002 5:51 pm    Post subject: Reply with quote

Hey that's great!!

Can't wait to try that...

Marty Cool
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
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