| View previous topic :: View next topic |
| Author |
Message |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Mon Oct 14, 2002 4:57 pm Post subject: How can I enable a button as soon as... |
|
|
| A user types something in an edit box? Is that possible? And another thing, how can I search a string for a specific letter? Sorry, I haven't used VDS in a few months and have forgotten much. |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Oct 14, 2002 5:04 pm Post subject: Re: How can I enable a button as soon as... |
|
|
You should be able to use the @focus() function to see what edit box
has focus and then have it enable a button.
You can use the @pos() to find the first occurance of a string (or letter) in
a string.
| flypaper wrote: | | A user types something in an edit box? Is that possible? And another thing, how can I search a string for a specific letter? Sorry, I haven't used VDS in a few months and have forgotten much. |
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Mon Oct 14, 2002 5:47 pm Post subject: |
|
|
| How can I constantly test the @focus() then to know when to enable the button? Sorry if I'm being a tard here. |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Oct 14, 2002 5:50 pm Post subject: |
|
|
You should just be able to add a timer and check it every # of sec.
Something like this:
| Code: |
wait event,1
%e = @event()
goto %e
:Timer
if @equal(@focus(),Edit1)
Dialog enable,Button1
end
goto evloop
|
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1567
|
Posted: Mon Oct 14, 2002 5:55 pm Post subject: |
|
|
Here is some code I made, sorry Chris I did this while you were also posting ur code
| Code: |
option decimalsep,.
DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG ADD,EDIT,EDIT1,28,30,180,19
DIALOG ADD,BUTTON,BUTTON1,52,146,64,24,BUTTON1
DIALOG ADD,TEXT,TEXT1,94,44,,,type the word HELLO in the box
DIALOG SHOW
DIALOG DISABLE,BUTTON1
:evloop
wait event,0.3
goto @event()
:button1button
info @dlgtext(edit1)
rem Lets search for the string 'hello'
if @greater(@pos("hello",@dlgtext(edit1)),0)
info Text 'hello' found at position: @pos("hello",@dlgtext(edit1))
else
warn Text 'hello' NOT FOUND!
end
goto evloop
:timer
if @greater(@len(@dlgtext(edit1)),0)
dialog enable,button1
else
dialog disable,button1
end
goto evloop
:close
exit
|
Last edited by PGWARE on Mon Oct 14, 2002 10:00 pm; edited 1 time in total |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Oct 14, 2002 5:57 pm Post subject: |
|
|
Sure, trying to take my spotlight... . NP Prakash.  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Oct 15, 2002 9:08 am Post subject: |
|
|
You could also just use if @dlgtext(Edit1)
in the 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 |
|
 |
|
|
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
|
|