round pushbutton?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

round pushbutton?

Shaping-3
Has anyone implemented a round pushbutton?


Shaping


Reply | Threaded
Open this post in threaded view
|

Re: round pushbutton?

Chris Uppal-3
Shaping wrote:
> Has anyone implemented a round pushbutton?

You could try the IconButton in 'WalicXe - Widget.pac' available from:

    http://www.walicxe.com/pages/descargas.htm

Or us the OwnerDrawButton in the same package as a basis if you want to try
something more ambitious.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: round pushbutton?

Martin Rubi
In reply to this post by Shaping-3
Hello, Shaping.
I think you may do it by using an owner draw button, as Chris suggested, in
combination with a windows region. To make a rounded window, you can do
something like this:

----
setWindowRegion: aRegionOrNil for: aView
    "Set the window region. Anything outside the region is clipped by
Windows.
    If aRegionOrNil is nil, then aView will clear any previous region it
could had.
    Please note that aRegionOrNil will be detached, i.e., it can not be a
region owned by other object"

    | hRegion |

    aRegionOrNil ifNotNil: [:r | hRegion := r detachHandle].

    UserLibrary default
        setWindowRegion: aView asParameter
        region: hRegion
        redraw: true

----
"to create a circular region"

    Region ellipse: (Rectangle origin: 0@0 corner: 100@100)

"to create a rounded region"

    Region rectangle: (Rectangle origin: 0@0 corner: 100@100) rounded: 10@10

Best regards.
Martin