[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proxy for RadioButton
[Thread Prev] | [Thread Next]
- Subject: Re: Proxy for RadioButton
- From: Fabien Bodard <gambas.fr@xxxxxxxxx>
- Date: Mon, 23 Sep 2024 20:54:08 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
https://gambaswiki.org/wiki/comp/gb.qt4/style/paintoption?l=fr&nh Note: Different toolkits behave differently with this function. As a general example if you supply width and height size as 32x32px QT5 will paint an option image 32x32px in size but GTK3 will only paint an image of 16x16px inside a 32x32 frame regardless of what size you request. To get a truly different size Option image with gtk3 you must paint the 16x16 Option and then stretch the image. Le lun. 23 sept. 2024 à 18:22, Gianluigi <gradobag@xxxxxxxxxxx> a écrit : > Il 23/09/24 17:57, Bruce Steers ha scritto: > > > > > > On Mon, 23 Sept 2024 at 15:34, Gianluigi <gradobag@xxxxxxxxxxx > > <mailto:gradobag@xxxxxxxxxxx>> wrote: > > > > Il 23/09/24 15:34, Bruce Steers ha scritto: > > > > > > > > > On Mon, 23 Sept 2024 at 13:41, Gianluigi <gradobag@xxxxxxxxxxx > > <mailto:gradobag@xxxxxxxxxxx> > > > <mailto: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 > > > > > > Yes you do to a certain extent. > > > > But actually that's only if you want to play around with non default > > sizes, it's fine with 16x16 > > one of the toolkits (gtk or qt) only ever renders a 16x16 Style Option > > picture regardless of the chosen size, where as the other one will give > > larger sizes. > > so if you want bigger you need to stretch the rendered 16x16 image. > > > > I was just showing a real way to honor the users toolkit preferences as > > Jussi pointed out was an issue and you didn't seem to have the right > answer. > > > > but it's cool , I'm not actually making a control either and am just > > trying to be clever too ;) lol > > > > I don't even think bruce is making a custom control anymore either, he's > > gone a completely different route now :D > > 🤣 > > I think I didn't explain myself well, here if I use 16x16 I see as in > the image. > To see correctly I have to use 22x22 but if I use it with qt then it's > too big etc. > First you need to check the libraries, otherwise you will have to settle > for Gambas icons > > Regards > Gianluigi > -- Fabien Bodard
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Proxy for RadioButton | BB <adamnt42@xxxxxxxxx> |
Re: Proxy for RadioButton | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: Proxy for RadioButton | BB <adamnt42@xxxxxxxxx> |
Re: Proxy for RadioButton | Bruce Steers <bsteers4@xxxxxxxxx> |
Re: Proxy for RadioButton | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: Proxy for RadioButton | Bruce Steers <bsteers4@xxxxxxxxx> |
Re: Proxy for RadioButton | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: Proxy for RadioButton | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Re: Proxy for RadioButton | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Re: Proxy for RadioButton | Bruce Steers <bsteers4@xxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |
Re: Proxy for RadioButton | Bruce Steers <bsteers4@xxxxxxxxx> |
Re: Proxy for RadioButton | Gianluigi <gradobag@xxxxxxxxxxx> |