Recent

Author Topic: [Fixed] Wrong default brush color settings for new charts  (Read 5669 times)

Muso

  • Sr. Member
  • ****
  • Posts: 356
[Fixed] Wrong default brush color settings for new charts
« on: July 21, 2021, 04:41:56 am »
I have an issue with the default settings of new charts:

- add a new chart to a form

result: the following properties are not at their default according to the IDE:
- Foot.Brush.Color is at "clForm" -> IDE says default is "clWhite"
- Title.Brush.Color is at "clForm" -> IDE says default is "clWhite"

Maybe the IDE is wrong with the default?

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

Should I open a bug report?
« Last Edit: July 23, 2021, 01:01:33 am by Muso »

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Wrong default brush color settings for new charts
« Reply #1 on: July 21, 2021, 10:29:47 am »
What does this mean: "IDE says default is clWhite"?

I place a TChart onto a new form, set Chart.Title1.Visible to true, then go to Chart1.Title.Brush.Color, it says: clForm, and Chart1.Title.Brush.Style is bsSolid. And in the form editor and at runtime the title backgroundcolor is the color of the form. So, what's wrong with it?

Muso

  • Sr. Member
  • ****
  • Posts: 356
Re: Wrong default brush color settings for new charts
« Reply #2 on: July 21, 2021, 01:26:56 pm »
What does this mean: "IDE says default is clWhite"?

- add a chart to a form. Do nothing else.
- look at the object inspector's properties section

result: everything is set to default except of the brush color. The IDE shows you this by highlighting the property "Foot" in red bold font, see the attached screenshot.
Then open the Foot property in the tree and see that the non-default value is "clForm", see the second screenshot attached.
Now look what the IDE tells you is the default by clicking at the Color combobox. You can see that the default is "clWhite" (the italic entry).
When you now set the color to "clWhite" the IDE shows you now as everything being in default state, see the third screenshot attached.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Wrong default brush color settings for new charts
« Reply #3 on: July 21, 2021, 07:01:04 pm »
It's fairly tricky to chance the default value of a subproperty (Color) of a subproperty (Brush) of a subproperty (Title, Foot) of a component (Chart). Therefore, and because Chart.Title|Foot.Brush.Color is created with a dynamic value of "Owner.Color", I think no default value has been declared for it by the initial authors of TAChart. As a consequence the Color dropdown in the Object Inspector still highlights clWhite as default (declared as such by TBrush).

Muso

  • Sr. Member
  • ****
  • Posts: 356
Re: Wrong default brush color settings for new charts
« Reply #4 on: July 21, 2021, 07:35:37 pm »
I think no default value has been declared for it by the initial authors of TAChart. As a consequence the Color dropdown in the Object Inspector still highlights clWhite as default (declared as such by TBrush).

Is this fixable? If not, no big problem.

I stumbled over this because I have 3 charts in my program and one behaved different. So I stepped through all settings to find out which one I mangled accidentally.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Wrong default brush color settings for new charts
« Reply #5 on: July 22, 2021, 11:19:51 pm »
Changed the default value of TChartTitle.Brush.Color to clDefault, and clDefault translates here to Owner.Color (where Owner is a TChart here).

Muso

  • Sr. Member
  • ****
  • Posts: 356
Re: Wrong default brush color settings for new charts
« Reply #6 on: July 23, 2021, 01:01:17 am »
Changed the default value of TChartTitle.Brush.Color to clDefault, and clDefault translates here to Owner.Color (where Owner is a TChart here).

Many thanks!

 

TinyPortal © 2005-2018