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 


TOPDIALOG dialog style

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 06, 2004 6:26 pm    Post subject: TOPDIALOG dialog style Reply with quote

I would like to have a TOPDIALOG dialog style, to prevent the user clicking at the window behind it... Like when calling the info command; you can't click the window behind it as long as the infobox isn't closed.

I know that this is possible when using DIALOG SHOWMODAL instead of DIALOG SHOW, but the script freezes at that point, and the script needs to continue running when the dialog is opened...

Would this be a great idea for vds 5.02? Wink
Or could some API do the trick?

Best regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jan 06, 2004 6:42 pm    Post subject: Reply with quote

You could go around the 'problem' by creating a loop which checks which window is on top. If it is the right window, let it stay active, if it is the wrong one, minimize it or something. Also, you can use the "D" parameter of the @event() function to see which window caused the event. If it isn't the right one, just ignore it... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Jan 06, 2004 6:48 pm    Post subject: Reply with quote

Try this out:
Code:

LOADLIB "user32.dll"
Title Disable Window
  DIALOG CREATE,Disable Window,-1,0,240,160
REM *** Modified by Dialog Designer on 1/6/2004 - 13:46 ***
  DIALOG ADD,BUTTON,BUTTON1,50,20,200,24,Disable Window for 3 Seconds
  DIALOG ADD,CHECK,CHECK1,21,20,210,24,Try and click me while disabled
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:BUTTON1BUTTON
  %%hwnd = @STRDEL(@WINEXISTS(Disable Window),1,1)
  %x = @LIB(user32,EnableWindow,INT:,INT:%%hwnd,INT:0)
  WAIT 3
  %x = @LIB(user32,EnableWindow,INT:,INT:%%hwnd,INT:1)
  goto evloop
:Close
  FREELIB "user32.dll"
  exit

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jan 06, 2004 6:52 pm    Post subject: Reply with quote

Nice one! To complete the example: other dialogs are still working! Smile

Code:
LOADLIB "user32.dll"
Title Disable Window

  DIALOG CREATE,Disable Window,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,50,20,200,24,Disable Window for 3 Seconds
  DIALOG ADD,CHECK,CHECK1,21,20,210,24,Try and click me while disabled
  DIALOG SHOW
 
  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,CHECK,CHECK1,50,35,180,20,And click me too... Smile
  DIALOG SHOW

 
:Evloop
  wait event
  goto @event()
 
:BUTTON1BUTTON
  %%hwnd = @STRDEL(@WINEXISTS(Disable Window),1,1)
  %x = @LIB(user32,EnableWindow,INT:,INT:%%hwnd,INT:0)
  WAIT 3
  %x = @LIB(user32,EnableWindow,INT:,INT:%%hwnd,INT:1)
  goto evloop
 
:Close
  FREELIB "user32.dll"
  exit


Ps. SnarlingSheep, you can also use the [ vds ] tags in steed of the [ code ] tags, so that you will get the VDS highlighting... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 06, 2004 7:15 pm    Post subject: Reply with quote

Thanks! Very Happy

Best regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Wed Jan 07, 2004 6:16 pm    Post subject: Reply with quote

Wow... this is a really useful example! Thumbs Up
Thanks so much SnarlingSheep and Skit. Perhaps it should be placed in the Knowledge Base forum?

_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jan 07, 2004 6:18 pm    Post subject: Reply with quote

It was SnarlingSheep who made the example, I only expanded it a bit... Smile I'll place this topic to the Knowledge Base forum indeed... Smile

Edit: Maybe it's better to make a little command or function of it, so it can go into the "VDS 5 Units" forum... Do you like to do that SnarlingSheep, since it is your example? Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jan 07, 2004 10:21 pm    Post subject: Reply with quote

Hortalonus wrote:
Wow... this is a really useful example! Thumbs Up
Thanks so much SnarlingSheep and Skit. Perhaps it should be placed in the Knowledge Base forum?


I've posted an example for disabling a window long ago in the
Advanced VDS 5 Source Code forum. I don't know if anyone
ever saw that. Wink

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jan 08, 2004 4:57 am    Post subject: Reply with quote

Even I had posted some code and Liquidcode made a DSU too I think Smile ..
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Thu Jan 08, 2004 9:03 am    Post subject: Reply with quote

Hmm... I'm using this code in combination with the vdswnd.dll parent command, but then is the whole dialog (including the child window) disabled. Sad

Best regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Thu Jan 08, 2004 3:12 pm    Post subject: Reply with quote

FreezingFire wrote:
I've posted an example for disabling a window long ago in the Advanced VDS 5 Source Code forum. I don't know if anyone
ever saw that. Wink


CodeScript wrote:
Even I had posted some code and Liquidcode made a DSU too I think Smile ..


Oooops! Sorry guys... I never saw your examples. Embarassed

_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Wed Jan 14, 2004 12:22 pm    Post subject: Reply with quote

I have a parent window (let's call it MainWin), and a child window ChildWin). The user has to enter something in the ChildWin, but he must not be able to click at the MainWin.

I've tried to achive this using the vdswnd.dll (see previous post), but when using the 'wnd parent, #ChildWin, #MainWin' command and the code to disable the MainWin, both windows are disabled, probably because MainWin is now the parent window of ChildWin Rolling Eyes

Is there any solution for this?

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
bbelcher
Contributor
Contributor


Joined: 30 Jul 2002
Posts: 172

PostPosted: Wed Jan 14, 2004 1:08 pm    Post subject: Reply with quote

I found a solution to your problem in the forum awhile back. I’m not sure who posted it but it works for me.. Give it a try. Sorry the code is a little messy I just cut and pasted from an old project.

Code:

rem this is the parent
   dialog CREATE,-- Parent Window,-1,0,497,251
   dialog ADD,BUTTON,BUTTON1,6,4,148,34,Dummy Button test only
   dialog ADD,BUTTON,BUTTON2,50,4,146,40,Click to Test Child WIndow
   dialog ADD,COMBO,COMBO1,156,346,138,21,,,LIST
   dialog SHOW
:evloop
   wait event
   goto @event()

:button1button
   goto evloop

:button2button
   rem this is the child
   dialog CREATE,RPWU Warning,-1,0,350,250,INVISIBLE,ONTOP,NOTITLE
   dialog ADD,STYLE,STYLE7,,8,B,,BLACK
   dialog ADD,STYLE,STYLE61,,10,B
   dialog ADD,SHAPE,SHAPE8,0,0,350,250,WHITE,BLACK,,RECTANGLE
   dialog ADD,SHAPE,SHAPE9,0,0,350,24,FBF746,BLACK,,RECTANGLE
   dialog ADD,TEXT,TEXT1,38,15,,,Now click a Parent Window control. You should hear a beep.,,STYLE1,TRANSPARENT
   dialog ADD,TEXT,TEXT2,6,6,,,-- Child Window,,STYLE2,TRANSPARENT
   dialog ADD,BITBTN,CLOSE3,208,150,42,24,,OK
   dialog SHOW

:CLOSE3_evloop
   wait event
   parse "%E;%D",@event(D)
   if @zero(%D)
      beep
      dialog select,1
      dialog focus,CLOSE3
      goto CLOSE3_evloop
   else
      goto CLOSE3_%E
   end

:close3_CLOSE3BUTTON
   dialog CLOSE
   wait event
   %e = @event()
   goto EVLOOP

:close
   exit
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Wed Jan 14, 2004 6:34 pm    Post subject: Reply with quote

It doesn't work for me Sad But thanks for the idea Wink

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List 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