Recent

Author Topic: Laz 2.2 IDE default issues for new Radio and Check groups  (Read 3017 times)

Muso

  • Sr. Member
  • ****
  • Posts: 356
Laz 2.2 IDE default issues for new Radio and Check groups
« on: July 21, 2021, 01:47:47 pm »
- add a new radio/check group to a form
- look at the object inspector's properties section

result: the following properties are highlighted with bold font as not being default, see that attached sreenshot:
- "AutoFill"
  -> is is true and the property description also states that the default is true. So the IDE should not highlight it with bold font
- "ChildSizing" is highlighted with bold red font, see the second screenshot
   -> looking at the comboboxes, e.g. for "EnlargeHorizontal", I see that the default would be "crsAnchorAligning" (the italic entry in the combobox)

I am using Lazarus 2.3.0 r65474 FPC 3.2.2 x86_64-win64-win32/win64 but that means the issue is also in Laz 2.2.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Laz 2.2 IDE default issues for new Radio and Check groups
« Reply #1 on: July 21, 2021, 06:11:23 pm »
- add a new radio/check group to a form
- look at the object inspector's properties section

result: the following properties are highlighted with bold font as not being default, see that attached sreenshot:
- "AutoFill"
  -> is is true and the property description also states that the default is true. So the IDE should not highlight it with bold font
The bold brown highlight of "AutoFill" means that its value is different from the value declared as default in the property definition. But since AutoFill does not declare at all any value as default it will always appear in the object inspector as bold brown. It should probably mark "true" as its default value - you should post a bug report if you need it for some reason.

Declaring values as "default" is usually a trick to introduce new properties in a component and to avoid that an older version will choke on this unkown value in the lfm file. This is because a property is not written to the lfm file when its value is equal to the value specified as default. Since "AutoFill" is an "old" property it does not make much sense to change anything here from this argument (except for a small decrease of the lfm file size).

- "ChildSizing" is highlighted with bold red font, see the second screenshot
   -> looking at the comboboxes, e.g. for "EnlargeHorizontal", I see that the default would be "crsAnchorAligning" (the italic entry in the combobox)
That "ChildSizing" is bold brown means that at least one of its sub-properties deviates from its default values of the TChildsizing class. And this happens here because the automatic layout if the checkboxes and radiobuttons in TCheckGroup and TRadiogroup is based on the childsizing mechanism. By setting Layout to cclLeftTorigthThenTopToBottom and ControlsPerLine to 1 the subcontrols are automatically aligned in a single column. In fact you can change more of the ChildSizing subproperties. For example I usually find that the controls are too close to the left border; but when I increase the ChildSizing.LeftRightSpace the layout looks better to me.

The crsAnchorAligning value is the default value of the TChildControlResizeStyle enumeration. The ChildSizing.EnlargeHorizontal|Vertical switches between crsAnchorAligning and crsHomogeneousChildResize when AutoFill is toggled. So you can say that "AutoFill" is just an alias for a particular value in Enlargevertical|Horizontal here.

You could also work with ChildSizing.ShrinkHorizontal|Vertical to crsAnchorAligning; the difference becomes visible when there are several columns and the  groupbox is too narrow: with crsAnchorAligning the rightmost checkbox/radiobutton would be truncated, while with crsScaleChilds all columns become narrower proportionately.

Muso

  • Sr. Member
  • ****
  • Posts: 356
Re: Laz 2.2 IDE default issues for new Radio and Check groups
« Reply #2 on: July 23, 2021, 12:59:58 am »
since AutoFill does not declare at all any value as default it will always appear in the object inspector as bold brown. It should probably mark "true" as its default value - you should post a bug report if you need it for some reason.

I opened now a bugreport:
https://bugs.freepascal.org/view.php?id=39283

Quote
this happens here because the automatic layout if the checkboxes and radiobuttons in TCheckGroup and TRadiogroup is based on the childsizing mechanism. By setting Layout to cclLeftTorigthThenTopToBottom and ControlsPerLine to 1 the subcontrols are automatically aligned in a single column. In fact you can change more of the ChildSizing subproperties. For example I usually find that the controls are too close to the left border; but when I increase the ChildSizing.LeftRightSpace the layout looks better to me....

Many thanks. I did not yet know about these features. They are very useful.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Laz 2.2 IDE default issues for new Radio and Check groups
« Reply #3 on: July 23, 2021, 01:13:08 am »
I don't understand the problem I guess.

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018