| View previous topic :: View next topic |
| Author |
Message |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 06, 2004 6:26 pm Post subject: TOPDIALOG dialog style |
|
|
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?
Or could some API do the trick?
Best regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Jan 06, 2004 6:42 pm Post subject: |
|
|
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...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Tue Jan 06, 2004 6:48 pm Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Jan 06, 2004 6:52 pm Post subject: |
|
|
Nice one! To complete the example: other dialogs are still working!
| 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...
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...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 06, 2004 7:15 pm Post subject: |
|
|
Thanks!
Best regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Jan 07, 2004 6:16 pm Post subject: |
|
|
Wow... this is a really useful example!
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Jan 07, 2004 6:18 pm Post subject: |
|
|
It was SnarlingSheep who made the example, I only expanded it a bit... I'll place this topic to the Knowledge Base forum indeed...
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?  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jan 07, 2004 10:21 pm Post subject: |
|
|
| Hortalonus wrote: | Wow... this is a really useful example!
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.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jan 08, 2004 4:57 am Post subject: |
|
|
Even I had posted some code and Liquidcode made a DSU too I think .. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Thu Jan 08, 2004 9:03 am Post subject: |
|
|
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.
Best regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Thu Jan 08, 2004 3:12 pm Post subject: |
|
|
| 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.  |
| CodeScript wrote: | Even I had posted some code and Liquidcode made a DSU too I think .. |
Oooops! Sorry guys... I never saw your examples.  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Wed Jan 14, 2004 12:22 pm Post subject: |
|
|
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
Is there any solution for this?
Regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Wed Jan 14, 2004 1:08 pm Post subject: |
|
|
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 |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Wed Jan 14, 2004 6:34 pm Post subject: |
|
|
It doesn't work for me But thanks for the idea
Regards,
Vic _________________ phpBB Development Team |
|
| 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
|
|