Hello,
I tried to make a few radio buttons next to each other but found that every radio has a little bar to its right that covers the next radio.
Two commas for the radio text parameter shortens that bar by half size, but it still covers the next radio.
Clicking the bar in front of the radio to the right will activate the left radio.
Does anyone know a workaround for this?
Thanks in advance!
Bar after Radio or Checkbox Topic is solved
Re: Bar after Radio or Checkbox
This sounds like a spacing problem.
Try this:
set your first radio the same way you are doing it now, and for your other radios, set the x position to "x+10"
Sort of like this
Try this:
set your first radio the same way you are doing it now, and for your other radios, set the x position to "x+10"
Sort of like this
Code: Select all
Gui,add,radio,x10 ,rad1
Gui,add,radio,x+10,rad2
Gui,add,radio,x+10,rad3
Re: Bar after Radio or Checkbox
Hi bud,
thanks for the reply.
I've seen your youtube videos showing this, but it didn't remember to try it.
I used set coordinates like x10, x20, etc.
I wish i hadn't changed my gui doubling the size of the background image so i could try that.
I'm going to write a test gui with your insructions and set coordinates, both with and without the ",," and report the results here.
Thanks again!
thanks for the reply.
I've seen your youtube videos showing this, but it didn't remember to try it.
I used set coordinates like x10, x20, etc.
I wish i hadn't changed my gui doubling the size of the background image so i could try that.
I'm going to write a test gui with your insructions and set coordinates, both with and without the ",," and report the results here.
Thanks again!
Re: Bar after Radio or Checkbox
Here's the results of my test:
The radio does show the little bar to its right regardless of coordinates.
Adding an empty text parameter ",," reduces that bar by half, from around 20 pixels to 10.
Addon coordinates are respective to that bar, not the radio position.
Fixed coordinates placed the radios on top of that bar, unlikely my original script, where the bar would cover the next radio to its right.
Hovering the mouse over a radio makes its bar cover the next radio to its right.
This seems to be related to the text parameter.
I have noticed checkboxes behave similarly.
I believe AHK code reserves a double space for its text parameter when its not present, and a single space when the user inputs an empty parameter ",,".
Maybe this can help with the next AHK version since this seems to be unintended.
Best Regards!
The radio does show the little bar to its right regardless of coordinates.
Adding an empty text parameter ",," reduces that bar by half, from around 20 pixels to 10.
Addon coordinates are respective to that bar, not the radio position.
Fixed coordinates placed the radios on top of that bar, unlikely my original script, where the bar would cover the next radio to its right.
Hovering the mouse over a radio makes its bar cover the next radio to its right.
This seems to be related to the text parameter.
I have noticed checkboxes behave similarly.
I believe AHK code reserves a double space for its text parameter when its not present, and a single space when the user inputs an empty parameter ",,".
Maybe this can help with the next AHK version since this seems to be unintended.
Best Regards!
Re: Bar after Radio or Checkbox
Are you putting the radios on a picture background? If so, set the radios with the option "BackgroundTrans".
Re: Bar after Radio or Checkbox Topic is solved
I'm successfully using to restrict the width and height of Radios and Checkboxes:
Code: Select all
SysGet, SGW, 71 ; SM_CXMENUCHECK
Code: Select all
#NoEnv
SysGet, SGW, 71 ; SM_CXMENUCHECK
Gui, Color, Black
Gui, Margin, 100, 50
Gui, Add, Radio, xm ym w%SGW% h%SGW% vRadio1 gRadioLabel
Gui, Add, Radio, x+0 yp wp hp vRadio2 gRadioLabel
Gui, Add, Radio, x+0 yp wp hp vRadio3 gRadioLabel
Gui, Add, Radio, x+0 yp wp hp vRadio4 gRadioLabel
Gui, Add, Checkbox, x+0 yp wp hp vCheck1 gCheckLabel
Gui, Show, , Radio Test
Return
GuiClose:
ExitApp
RadioLabel:
MsgBox, 0, %A_ThisLabel%, You selected %A_GuiControl%
Return
CheckLabel:
GuiControlGet, Check1
MsgBox, 0, %A_ThisLabel%, % "You " . (CHeck1 ? "" : "de") . "selected " . A_GuiControl
Return
Re: Bar after Radio or Checkbox
Hi,
Thanks for the replies.
Hellbent, unfortunately using BackgroundTrans did not make the little boxes transparent to the picture here.
Setting a color together with the picture showed they are transparent to the color only, with or without using the parameter like I did.
I might have used the option at the wrong location; I tried around the coordinates.
just me, I tried your approach, and after wasting a little time on doubled file edits and what not, I finally succeded.
Your approach was very easy to understand.
Also, nice example with the "selected" and "deselected" toggle function.
Thank you both for your efforts.
Kind regards!
Thanks for the replies.
Hellbent, unfortunately using BackgroundTrans did not make the little boxes transparent to the picture here.
Setting a color together with the picture showed they are transparent to the color only, with or without using the parameter like I did.
I might have used the option at the wrong location; I tried around the coordinates.
just me, I tried your approach, and after wasting a little time on doubled file edits and what not, I finally succeded.
Your approach was very easy to understand.
Also, nice example with the "selected" and "deselected" toggle function.
Thank you both for your efforts.
Kind regards!
Who is online
Users browsing this forum: Anput, Google [Bot] and 218 guests