Xojo Conferences
XDCMay2019MiamiUSA

Coding Button (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: MySQL and MySQL plugin performance
Next thread: [RB List] CheckBox compile error


RB Database   -   tom.russell transport.alstom.com
  Coding Button   -   Lennox Jacob
   Re: Coding Button   -   Aaron Ballman
    Re: Coding Button   -   Lennox Jacob
   RE: Coding Button   -   Lennox Jacob
    Re: Coding Button   -   Aaron Ballman
     Re: Coding Button   -   Lennox Jacob
      Re: Coding Button   -   Aaron Ballman

Coding Button
Date: 30.01.05 23:12 (Sun, 30 Jan 2005 22:12:00 +0000)
From: Lennox Jacob
I have two EditFields named Ht and Wt, I also have a Pushbutton named
BMIPushButton, which is disabled and not defaulted at startup. I want the
Pushbutton to be enabled and defaulted only when data is input into both Ht
and Wt editFields, I did this

if (Ht.string and me.string) <> 0 then
(BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled and
BSAPushButton.default) = true
else (BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled
and BSAPushButton.default) = false

I also tried it with EditFieldHt instead of Ht.string.

Please help.
Thanks.
Lennox.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Coding Button
Date: 30.01.05 23:18 (Sun, 30 Jan 2005 16:18:30 -0600)
From: Aaron Ballman
> if (Ht.string and me.string) <> 0 then
> (BMIPushButton.enabled, BMIPushButton.default,
> BSAPushButton.enabled and BSAPushButton.default) = true
> else (BMIPushButton.enabled, BMIPushButton.default,
> BSAPushButton.enabled and BSAPushButton.default) = false

You cannot set multiple values like that -- you need to separate them
out into individual lines, like this:

BMIPushButton.Enabled = true
BMIPushButton.Default = true
BSAPushButton.Enabled = true

Note that you can only have one default (and one cancel) button per
window, so making both BSAPushbutton and BMIPushButton default will
provide you with unexpected results.

HTH!

~Aaron

Re: Coding Button
Date: 30.01.05 23:21 (Sun, 30 Jan 2005 22:21:07 +0000)
From: Lennox Jacob
Thanks Aaron,
I will work on it.
Thanks again.
Lennox.

>From: Aaron Ballman <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Coding Button
>Date: Sun, 30 Jan 2005 16:18:30 -0600
>
>>if (Ht.string and me.string) <> 0 then
>> (BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled
>>and BSAPushButton.default) = true
>> else (BMIPushButton.enabled, BMIPushButton.default,
>>BSAPushButton.enabled and BSAPushButton.default) = false
>
>You cannot set multiple values like that -- you need to separate them out
>into individual lines, like this:
>
>BMIPushButton.Enabled = true
>BMIPushButton.Default = true
>BSAPushButton.Enabled = true
>
>Note that you can only have one default (and one cancel) button per window,
>so making both BSAPushbutton and BMIPushButton default will provide you
>with unexpected results.
>
>HTH!
>
>~Aaron
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

RE: Coding Button
Date: 30.01.05 23:19 (Sun, 30 Jan 2005 22:19:24 +0000)
From: Lennox Jacob
that was a mistake, this is what I meant,
I have two EditFields named Ht and Wt, I also have two Pushbutton named
BMIPushButton and BSAPushbutton which are  disabled and not defaulted at
startup. I want the BMIPushbutton to be enabled and defaulted only when data
is input into both Ht and Wt editFields, I did this


>From: "Lennox Jacob" <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: <email address removed>
>Subject: Coding Button
>Date: Sun, 30 Jan 2005 22:12:00 +0000
>
>I have two EditFields named Ht and Wt, I also have a Pushbutton named
>BMIPushButton, which is disabled and not defaulted at startup. I want the
>Pushbutton to be enabled and defaulted only when data is input into both Ht
>and Wt editFields, I did this

if (Ht.string and me.string) <> 0 then
(BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled and
BSAPushButton.default) = true
else (BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled
and BSAPushButton.default) = false

I also tried it with EditFieldHt instead of Ht.string.
>
>Please help.
>Thanks.
>Lennox.

>
>if (Ht.string and me.string) <> 0 then
> (BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled
>and BSAPushButton.default) = true
> else (BMIPushButton.enabled, BMIPushButton.default, BSAPushButton.enabled
>and BSAPushButton.default) = false
>
>I also tried it with EditFieldHt instead of Ht.string.
>
>Please help.
>Thanks.
>Lennox.
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Coding Button
Date: 30.01.05 23:23 (Sun, 30 Jan 2005 16:23:42 -0600)
From: Aaron Ballman
> that was a mistake, this is what I meant,
> I have two EditFields named Ht and Wt, I also have two Pushbutton
> named BMIPushButton and BSAPushbutton which are  disabled and not
> defaulted at startup. I want the BMIPushbutton to be enabled and
> defaulted only when data is input into both Ht and Wt editFields, I
> did this

Make a method like this:

Sub SetButtonProperties()
if Ht.Text <> "" and Wt.Text <> ""
BMIPushButton.Enabled = true
BMIPushButton.Default = true
else
BMIPushButton.Enabled = false
BMIPushButton.Default = false
end if
End Sub

Then in the TextChange event for both Ht and Wt, call
SetButtonProperties.

HTH!

~Aaron
-

Re: Coding Button
Date: 30.01.05 23:34 (Sun, 30 Jan 2005 22:34:09 +0000)
From: Lennox Jacob
Thank you Aaron, it worked but I had to insert the keyword then at the end
of the if line.
Thanks again.
Lennox.

>From: Aaron Ballman <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Coding Button
>Date: Sun, 30 Jan 2005 16:23:42 -0600
>
>>that was a mistake, this is what I meant,
>>I have two EditFields named Ht and Wt, I also have two Pushbutton named
>>BMIPushButton and BSAPushbutton which are  disabled and not defaulted at
>>startup. I want the BMIPushbutton to be enabled and defaulted only when
>>data is input into both Ht and Wt editFields, I did this
>
>Make a method like this:
>
>Sub SetButtonProperties()
> if Ht.Text <> "" and Wt.Text <> ""
> BMIPushButton.Enabled = true
> BMIPushButton.Default = true
> else
> BMIPushButton.Enabled = false
> BMIPushButton.Default = false
> end if
>End Sub
>
>Then in the TextChange event for both Ht and Wt, call SetButtonProperties.
>
>HTH!
>
>~Aaron
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Coding Button
Date: 30.01.05 23:36 (Sun, 30 Jan 2005 16:36:50 -0600)
From: Aaron Ballman
> Thank you Aaron, it worked but I had to insert the keyword then at the
> end of the if line.

Good catch -- I coded it up in the email editor instead of the code
editor. ;-)

~Aaron