Menu button with different fonts in label and menu?

Jonathan Lynch jonathandlynch at gmail.com
Thu Aug 26 14:55:29 EDT 2010


I am just putting this in, in case someone needs to do this in the future.
This script creates a disabled image of the button, slightly cropped in, and
places it in the spot on the button where it should go.

This way, you can then go in and change the font of the button to a symbol
or wingding font, and the button will still appear to have a label with a
standard font.

This is the script:

on mousedown tButton
  if (tButton = 3) and (the environment = "development") and (the commandkey
is down) then
    put the short name of me into tName
    if exists(image (tName & "-Button Image")) = true then
      delete image (tName & "-Button Image")
    end if
    put 3 into tCropAmount
    put the rect of me into tRect

    put item 1 of tRect into tLeft
    put item 2 of tRect into tTop
    put item 3 of tRect into tRight
    put item 4 of tRect into tBottom
    put tLeft + tCropAmount into tNewLeft
    put tTop + tCropAmount into tNewTop

    put the left of this stack into tStackLeft
    put the Top of this stack into tStackTop
    put (tCropAmount + tStackLeft + tLeft) into tLeft
    put (tCropAmount + tStackTop + tTop) into tTop
    put (tStackLeft + tRight - tCropAmount) into tRight
    put (tStackTop + tBottom - tCropAmount) into tBottom

    import snapshot from rect tLeft,tTop,tRight,tBottom
    put the id of the last image of this stack into tImageID
    put the owner of me into tOwner
    if word 1 of tOwner = "Group" then
      put the short name of the owner of me into tGroupName
      Copy image id tImageID to group tGroupName
      put the id of it into tNewID
      delete image id tImageID
      put tNewID into tImageID
    end if
    set the name of image id tImageID to tName & "-Button Image"
    set the topleft of image ID tImageID to tNewLeft,tNewTop
    set the disabled of image id tImageID to true
  else
    pass mousedown
  end if
end mousedown


Peace,

J


On Wed, Aug 25, 2010 at 5:03 PM, Jonathan Lynch <jonathandlynch at gmail.com>wrote:

> In case anyone needs to do this, I figured out how.
>
> Create an image, with the desired label text and place it over the the
> pulldown menu button. Then set the disabled of the image to true. The image
> is not altered when it is disabled, so the button still appears to have a
> standard font - actually it is the image made to look like the button, but
> the user will not realize that. When you click on a disabled image, the
> click goes through to the object below. In this case, the object below is a
> button using wingdings font.
>
> Peace,
>
> J
>
>   On Wed, Aug 25, 2010 at 9:58 AM, <jonathandlynch at gmail.com> wrote:
>
>> Sending mouseup to a pulldown menu does not make the menu appear. Using
>> popup on a pulldown menu messes up the appearance of the button. This is on
>> an older version or Rev that I use at work.
>>
>> If you disable a field, you can click through it - but the text in the
>> disabled field will be grey.
>>
>> Thanks, though - do you have any other suggestions? I think I am going to
>> have to resort to using a substack for the menuitems of that button.
>>
>> Peace,
>>
>> J
>>  ------Original Message------
>> From: DunbarX at aol.com
>> Sender: use-revolution-bounces at lists.runrev.com
>> To: use-revolution at lists.runrev.com
>> ReplyTo: How to use Revolution
>> Subject: Re: Menu button with different fonts in label and menu?
>> Sent: Aug 25, 2010 8:47 AM
>>
>> When you say graying out the text, have you set the blendLevel of the
>> field
>> to some number, like 50? If so, you can see the underlying object, but the
>> text is grayed. Try setting the "transparent" of the field instead. Then
>> the
>> text remains sharp, and only the white space is removed.
>>
>> As for letting messages through, I think you will have to script this,
>> sending a mouseUp to the object of interest explicitly. The lockText of
>> the
>> field should be set to "true".
>>
>> Craig Newman
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>  Sent from my Verizon Wireless BlackBerry
>>
>
>
>
> --
> Do all things with love
>



-- 
Do all things with love



More information about the use-livecode mailing list