disabled buttons

Ken Ray kray at sonsothunder.com
Thu Feb 26 12:25:50 EST 2004


Tom,

One approach might be to *use* the disabledIcon as a storage option, but
not *set* the button to be disabled (so a non-available button would use
the disabledIcon, but would still be able to be clicked). Use a custom
property to hold the "normal" icon so you can re-establish it. Something
like this:

  -- Assumes that each button contains a custom property called
  -- "uAvailIcon" that holds the ID number of the image that is to 
  -- be displayed for available buttons.

  on MakeUnavailable pBtnDescriptor
    set the icon of pBtnDescriptor to (the disabledIcon of
pBtnDescriptor)
  end MakeUnavailable

  on MakeAvailable pBtnDescriptor
    set the icon of pBtnDescriptor to (the uAvailIcon of pBtnDescriptor)
  end MakeUnavailable

  on mouseUp
    if the icon of me = the disabledIcon of me then
      -- run "clicked on unavailable button" code
    else
      -- run "clicked on available button" code
    end if
  end mouseUp

Now if you need to have a hilite state for both available and
unavailable buttons, you could swap out the hiliteIcon of the button the
same way...

Just a thought,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 


> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Thomas McGrath III
> Sent: Thursday, February 26, 2004 7:32 AM
> To: How to use Revolution
> Subject: Re: disabled buttons
> 
> 
> Ken yeah that's what I did last time in SC. So I will do it again.
> 
> But for this project a disabled button does not do what a 
> non-disabled 
> button would do BUT if a user hits a disabled button it 'resets' the 
> system of which buttons are available. I should use the term 
> available 
> and non-available (since disabled in rev means dead) whereas my 
> non-available buttons still have life in them ie. they reset the 
> system.
> 
> You see it is the nature of sequenced buttons that on a third 
> hit of a 
> sequence you decided to back out of the sequence you can just hit a 
> non-available button to reset the system to be ready for a first hit 
> again.
> 
> Since I am combining two buttons in a group to get the look 
> and feel I 
> need I am thinking of adding a third invisible image to the 
> group that 
> when the icon is unavailable the image will trap the message.
> 
> Did you look at my buttons example?
> put this in the message box:
> 
> go URL "http://users.adelphia.net/~3mcgrath/Buttons.rev"
> 
> This shows the button without a disabled state/ unavailable 
> state. Each 
> will be  built via script and would show different icons.
> 
> Thanks
> Tom
> 
> On Feb 26, 2004, at 2:30 AM, Ken Norris wrote:
> 
> > I'm having difficulty making any sense of why a user would expect a
> > disabled
> > button to do anything, but you could put a mouseUp handler 
> in the card
> > instead of the button and spec it thus:
> 
> Thomas J. McGrath III
> SCS
> 1000 Killarney Dr.
> Pittsburgh, PA 15234
> 412-885-8541
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-> revolution
> 




More information about the use-livecode mailing list