Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

BevelButton that handles masks properly? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Getting the last character typed in an editfield
Next thread: can httpsocket do http 1.1?


Reading *CSV Files versus *.Txt Files   -   Claude Stone
  BevelButton that handles masks properly?   -   Joe Strout
   Re: BevelButton that handles masks properly?   -   Tim Jones

BevelButton that handles masks properly?
Date: 28.01.09 20:55 (Wed, 28 Jan 2009 12:55:16 -0700)
From: Joe Strout
The built-in BevelButton class does not appear to properly handle icons
with masks (at least, on the Mac). It draws them, but it looks like
it's doing only 1-bit transparency rather than 8-bit. Or perhaps
something else equally ugly.

The same images drawn in a Canvas work fine, so one could make a
Canvas-based class that looks good. It would take some effort to make
this have a native-looking appearance on both Mac and Windows, though.
Has anybody already made such a thing that they're willing to share?

Thanks,
- Joe

Re: BevelButton that handles masks properly?
Date: 28.01.09 21:15 (Wed, 28 Jan 2009 13:15:14 -0700)
From: Tim Jones
On Jan 28, 2009, at 12:55 PM, Joe Strout wrote:

> The built-in BevelButton class does not appear to properly handle
> icons with masks (at least, on the Mac). It draws them, but it
> looks like it's doing only 1-bit transparency rather than 8-bit.
> Or perhaps something else equally ugly.
>
> The same images drawn in a Canvas work fine, so one could make a
> Canvas-based class that looks good. It would take some effort to
> make this have a native-looking appearance on both Mac and Windows,
> though. Has anybody already made such a thing that they're willing
> to share?

I cheat - I create the bevelbutton when a blank area for my image and
then snapshot it in enabled, pressed, and disabled modes. Bring it
into Gimp and clear the outside edges and add the proper images
(masked) into the BB image and then I mask THAT image. I then load
those into a canvas that has the three states coded with the
appropriate image drawn. The canvas accepts the masked PNG and the
button looks correct on each platform. A bit of work, but it's
solved both the image drawing and the BevelButton being disabled on
window switch and requiring a theButton.Enabled = True in the parent
window's Activate event.

Tim

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>