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 


How can I enable a button as soon as...

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


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Oct 14, 2002 4:57 pm    Post subject: How can I enable a button as soon as... Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Oct 14, 2002 5:04 pm    Post subject: Re: How can I enable a button as soon as... Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Oct 14, 2002 5:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Oct 14, 2002 5:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1567

PostPosted: Mon Oct 14, 2002 5:55 pm    Post subject: Reply with quote

Here is some code I made, sorry Chris I did this while you were also posting ur code Wink

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Oct 14, 2002 5:57 pm    Post subject: Reply with quote

Sure, trying to take my spotlight... Smile. NP Prakash. Wink
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Tue Oct 15, 2002 9:08 am    Post subject: Reply with quote

You could also just use if @dlgtext(Edit1)
in the timer loop... Wink

Cheers, Mac Smile

_________________
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
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