Recent

Author Topic: problem with radio buttons!  (Read 1200 times)

wp

  • Hero Member
  • *****
  • Posts: 7964
Re: problem with radio buttons!
« Reply #15 on: December 04, 2020, 10:34:19 am »
If you don't want the TRadioGroup border and caption you can also get an automatic two-column layout in a panel by using the ChildSizing property. In fact, that's the way how TRadioGroup does the layout internally. Just set ChildSizing.Layout to cclLeftToRightThenTopToBottom and  .ControlsPerLine to 2. The distance between the columns is determined by .HorizontalSpace, left/right margin to the container border by .LeftRightSpacing. Additional control to positioning is given by Enlarge|ShrinkHorizontal|Vertical (too lazy to describe...). Important: the radiobuttons must not be aligned (Align = alNone), the can only have their standard anchors ([akLeft, akTop]). The order of the radiobuttons is determined by the order in which they were added; later rearrangement is possible by calling the "Z Order" context menu. If you finally set the AutoSize of the parent to true you have a very robust layout of the radiobuttons so that they will never overlap.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

speter

  • Full Member
  • ***
  • Posts: 102
Re: problem with radio buttons!
« Reply #16 on: December 06, 2020, 05:24:00 am »
If you don't want the TRadioGroup border and caption you can also get an automatic two-column layout in a panel
Thanks, but I am really liking the way the TRadioGroup simplifies my radio buttons (& checkboxes). Prior to the comments in this thread I had used Panels instead.

The program I am working on had 21 radio buttons and 47 checkboxes; and now has 3 groups (each with 21 items) and 5 checkboxes; which is a huge improvement! :)

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Laz 2.0.8 / FPC 3.0.4 / Windows 10 (64bit)

jamie

  • Hero Member
  • *****
  • Posts: 4052
Re: problem with radio buttons!
« Reply #17 on: December 06, 2020, 02:58:10 pm »
I wouldn't want to be the person that has to read all of those check boxes and radio buttons...

I envision a change in strategy soon  :o
The only true wisdom is knowing you know nothing

speter

  • Full Member
  • ***
  • Posts: 102
Re: problem with radio buttons!
« Reply #18 on: December 06, 2020, 11:35:59 pm »
I wouldn't want to be the person that has to read all of those check boxes and radio buttons...

I envision a change in strategy soon  :o
They are in 4 tabs and the 3 x 21 all have the same captions; so it is not as bad as it sounds.
It allows me to change the (sudoku solving techniques) being used. :)

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Laz 2.0.8 / FPC 3.0.4 / Windows 10 (64bit)

winni

  • Hero Member
  • *****
  • Posts: 2122
Re: problem with radio buttons!
« Reply #19 on: December 06, 2020, 11:43:53 pm »
Hi!

I think if you want to code some Sudoko stuff you should use a TStringGrid.
In the FixedRows and the FixedCold you can write your caption stuff.

And in the other fields you can let the computer play Sudoku.

Winni


 

TinyPortal © 2005-2018