[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proxy for RadioButton


Il 23/09/24 15:34, Bruce Steers ha scritto:


On Mon, 23 Sept 2024 at 13:41, Gianluigi <gradobag@xxxxxxxxxxx
<mailto:gradobag@xxxxxxxxxxx>> wrote:

    Il 23/09/24 11:49, Gianluigi ha scritto:
     > Il 23/09/24 11:39, Gianluigi ha scritto:
     >> Il 23/09/24 03:05, Jussi Lahtinen ha scritto:
     >>>     I was thinking more of something like this (see
    attachment), but the
     >>>     opening doesn't convince me and I haven't understood how to
     >>> activate it
     >>>     correctly.
     >>>
     >>>
     >>> I think this should be written as custom control and it needs
    some work.
     >>> Honestly, I would not see the trouble when togglebutton is already
     >>> available.
     >>> Many things I don't like... example you need to get the used
    theme and
     >>> use the icons from there, otherwise it does not follow the user
    chosen
     >>> theme.
     >>>
     >>>
     >>> Jussi
     >>>
     >>
     >> If it's an organization where everyone uses the same system, the
    theme
     >> doesn't appear to be a problem.
     >> Action also allows you to add Tooltips, Shortcuts etc.
     >> However, mine was just a suggestion, I'm not interested in
    creating a
     >> component.
     >>
     >> Regards
     >> Gianluigi
     >>
     >>
     >
     > I forgot, in Gambas there is a PaintCheck Style, I don't know if
    it can
     > be exploited by your component...
     >
     > Regards
     > Gianluigi
     >
     >

    If you want you can use the Gambas icons:

    Public Sub tato_Click()

        Action["check"].Picture = Picture["icon:/16/draw-circle"]
        Last.Picture = Picture["icon:/16/modified"]

    End

    Regards
    Gianluigi


To stay true to the desktop theme this is how you use Style.PaintOption()

Private hPicTrue As Picture
Private hPicFalse As Picture

Public Sub _new()

   hPicTrue = New Picture(16, 16, True)
   hPicFalse = New Picture(16, 16, True)

Paint.Begin(hPicTrue)
   Style.PaintOption(0, 0, 16, 16, True)
Paint.End

Paint.Begin(hPicFalse)
   Style.PaintOption(0, 0, 16, 16, False)
Paint.End

End

Public Sub tato_Click()

    Action["check"].Picture = hPicFalse
    Last.Picture = hPicTrue

End



If you use Style you have to take into account gtk and qt, which have
different measurements and I don't know if it changes further with
wayland...

Regards
Gianluigi


Follow-Ups:
Re: Proxy for RadioButtonBruce Steers <bsteers4@xxxxxxxxx>
References:
Proxy for RadioButtonBB <adamnt42@xxxxxxxxx>
Re: Proxy for RadioButtonJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Proxy for RadioButtonBB <adamnt42@xxxxxxxxx>
Re: Proxy for RadioButtonBruce Steers <bsteers4@xxxxxxxxx>
Re: Proxy for RadioButtonJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Proxy for RadioButtonBruce Steers <bsteers4@xxxxxxxxx>
Re: Proxy for RadioButtonJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Proxy for RadioButtonJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Proxy for RadioButtonGianluigi <gradobag@xxxxxxxxxxx>
Re: Proxy for RadioButtonJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Proxy for RadioButtonGianluigi <gradobag@xxxxxxxxxxx>
Re: Proxy for RadioButtonGianluigi <gradobag@xxxxxxxxxxx>
Re: Proxy for RadioButtonGianluigi <gradobag@xxxxxxxxxxx>
Re: Proxy for RadioButtonBruce Steers <bsteers4@xxxxxxxxx>