Recent

Author Topic: what does chart title wordwrap do  (Read 6055 times)

Muso

  • Full Member
  • ***
  • Posts: 228
what does chart title wordwrap do
« on: August 02, 2021, 02:33:20 am »
Thanks to the latest ChartEditor demo addition, I discovered the chart title setting "Wordwrap".

What does it do exactly? I cannot see any difference. When I have 2 title lines, I only see that some line spacing is added then wordwrap is on.

(Maybe it is obvious but at least few info as XML in the IDE would help dumb people like me  :).)

wp

  • Hero Member
  • *****
  • Posts: 8753
Re: what does chart title wordwrap do
« Reply #1 on: August 02, 2021, 05:03:26 pm »
Wordwrap is a new property of Laz v2.2 to wrap a title (which is wider than the chart width) into multiple lines. Wrapping is recalculated whenever the chart width changes.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Muso

  • Full Member
  • ***
  • Posts: 228
Re: what does chart title wordwrap do
« Reply #2 on: August 02, 2021, 07:47:45 pm »
Wrapping is recalculated whenever the chart width changes.

Thanks! This was the info I missed; because also without wordwrap adding a long title in the ChartEditor demo, the line was wrapped into several lines.

However the recalculation does not work for me as expected. Attached is a screenshot of the ChartEditor demo where I added a title just as long that it is wrapped into 2 lines. When I now make the chart narrower, the wrapping works, but when I make it wider I expected the title to be wrapped into just one line since there is then enough horizontal space. (see the second screenshot)

wp

  • Hero Member
  • *****
  • Posts: 8753
Re: what does chart title wordwrap do
« Reply #3 on: August 03, 2021, 12:27:38 am »
Please turn off the WordWrap property of the memos in the ChartEditor demo. When this is ON, the memo introduces hard line-breaks into the text, and this is different from the "soft line breaks" introduced by the ChartTitle WordWrap.

This will be fixed in the new version which will contain also a lot of other changes. Just need some more time for testing.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Muso

  • Full Member
  • ***
  • Posts: 228
Re: what does chart title wordwrap do
« Reply #4 on: August 04, 2021, 03:16:20 pm »
Please turn off the WordWrap property of the memos in the ChartEditor demo. When this is ON, the memo introduces hard line-breaks into the text, and this is different from the "soft line breaks" introduced by the ChartTitle WordWrap.

Thanks.

two questions:
- for my real-life program, do you recommend me to use better e.g. a TEdit or a TlabeledEdit to allow the user to modify the title/footer?
- I am now able to get the latest sources (latest FPCupDeluxe - FPC via the stable 3.2.2 and Lazarus via Gitlab). I see that you changed yesterday something in master but I checked out the 2_2_fixes branch. So when you don't backport to this branch, does this mean, the changes are experimental/needs testing? If so, do you want me to test? Then I will switch to master.

wp

  • Hero Member
  • *****
  • Posts: 8753
Re: what does chart title wordwrap do
« Reply #5 on: August 04, 2021, 04:44:35 pm »
- for my real-life program, do you recommend me to use better e.g. a TEdit or a TlabeledEdit to allow the user to modify the title/footer?
The TLabeledEdit has issues with autosizing and align. Better to use separate components; when you anchor them with the Anchor Editor you have the same effect. And the entire ChartEditor demo makes excessive use of the Anchor Editor.

- I am now able to get the latest sources (latest FPCupDeluxe - FPC via the stable 3.2.2 and Lazarus via Gitlab). I see that you changed yesterday something in master but I checked out the 2_2_fixes branch. So when you don't backport to this branch, does this mean, the changes are experimental/needs testing? If so, do you want me to test? Then I will switch to master.
Please test with main. There were numerous changes in this commit and there's a chance that some bugs have crept in. Fixes is intended primarily for bug-fixes only; but since the demo has no effect on the overall performance of Lazarus I am willing to add the new features to fixes, too, but only after more testing.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Muso

  • Full Member
  • ***
  • Posts: 228
Re: what does chart title wordwrap do
« Reply #6 on: August 04, 2021, 06:59:35 pm »
The TLabeledEdit has issues with autosizing and align.

I know, since I once reported the autosize issue in the bug tracker.

I replaced now in my program the memo with an edit.

Quote
Please test with main.

OK. I will try if I can easily change the branch in FPCupDeluxe.

wp

  • Hero Member
  • *****
  • Posts: 8753
Re: what does chart title wordwrap do
« Reply #7 on: August 04, 2021, 08:21:02 pm »
I replaced now in my program the memo with an edit.
But then you cannot enter a multiline title... (this has nothing to do with wordwrap).
« Last Edit: August 04, 2021, 10:00:30 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Muso

  • Full Member
  • ***
  • Posts: 228
Re: what does chart title wordwrap do
« Reply #8 on: August 05, 2021, 04:46:03 am »
Please test with main.

Here I am. The demo works fine so far.

I only see now these compiler messages that could be fixed:
Code: [Select]
cesimplepenframe.pas(34,7) Hint: Parameter "WithThemeSpace" not used
cesimplepenframe.pas(27,5) Note: Private field "TSimpleChartPenFrame.FOnVisibleChange" is never used
cesimplebrushframe.pas(22,5) Note: Private field "TSimpleChartBrushFrame.FOnVisibleChange" is never used
ceshapebrushpenmarginsframe.pas(109,33) Hint: Local variable "h" does not seem to be initialized
ceshapebrushpenmarginsframe.pas(109,30) Hint: Local variable "w" does not seem to be initialized
celegendframe.pas(9,30) Hint: Unit "ColorBox" not used in ceLegendFrame
cecharteditor.pas(31,45) Hint: Parameter "Node" not used
cemain.pas(51,53) Hint: Value parameter "ASender" is assigned but never used
cemain.pas(45,48) Hint: Value parameter "ASender" is assigned but never used
cemain.pas(48,7) Hint: Value parameter "APoint" is assigned but never used
cemain.pas(49,50) Hint: Value parameter "ASender" is assigned but never used


So, I think your latest additiontions should make it into Laz 2.2.

------------

I wonder about the "assigned but never used" messages because in the procedures there is an
Code: Pascal  [Select][+][-]
  1. Unused(ASender);
I see these warnings in my programs now too. I realize now that I have FPC 3.3.1 despite I set in FPCupDeluxe to get FPC 3.2.2. So the Unused() function does not work with FPC 3.3.x
« Last Edit: August 05, 2021, 05:07:15 am by Muso »

wp

  • Hero Member
  • *****
  • Posts: 8753
Re: what does chart title wordwrap do
« Reply #9 on: August 05, 2021, 12:21:39 pm »
Here I am. The demo works fine so far.
[...]
So, I think your latest additiontions should make it into Laz 2.2.
Merged the changes plus some minor ones of today to Fixes_2_2.

I wonder about the "assigned but never used" messages because in the procedures there is an
Code: Pascal  [Select][+][-]
  1. Unused(ASender);
I see these warnings in my programs now too. I realize now that I have FPC 3.3.1 despite I set in FPCupDeluxe to get FPC 3.2.2. So the Unused() function does not work with FPC 3.3.x
I can confirm this. But I don't care about FPC-trunk as long as the package compiles. These warnings will be addressed when a new fpc release has been tagged.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018