Recent

Author Topic: ScrollBars in TMemo  (Read 805 times)

AgriMensor

  • New Member
  • *
  • Posts: 35
ScrollBars in TMemo
« on: February 20, 2024, 11:17:52 pm »
Has anyone else had this rather fundamental problem and, if so, how did you solve it?
I have a standard TMemo on a standard TPanel on a standard TForm. TMemo has the following design-time settings:
Alignment: taCenter
Anchors: akBottom, akLeft, akRight
Read Only: True
ScrollBars: ssVertical
TabStop: False
WordWrap: True (although I have also tried it with False)
The problem is that the scroll bar is always greyed out and I cannot read the whole text (see photo - can be zoomed to read better).
Any help on this gratefully received.
Many thanks!

AgriMensor

  • New Member
  • *
  • Posts: 35
Re: ScrollBars in TMemo
« Reply #1 on: February 20, 2024, 11:30:22 pm »
Better screen shot

dbannon

  • Hero Member
  • *****
  • Posts: 2792
    • tomboy-ng, a rewrite of the classic Tomboy
Re: ScrollBars in TMemo
« Reply #2 on: February 20, 2024, 11:45:14 pm »
That is pretty weird Agri.

The scroll bar to be greyed out means the TMemo thinks all your text is visible. Just how much is missing ? Just the line we see the top of or is there more txt below that ? What if you put a couple of line feed, carriage returns at the end of the text ?

I think there must be some confusion with how much space the font reports it needs. Have you tried any other fonts to see if its a font problem ? Or a DPI scaling issue ?

You could, possibly, make a stand alone app with just the TMemo, same font and same text, see if its replicated ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2054
  • Fifty shades of code.
    • Delphi & FreePascal
Re: ScrollBars in TMemo
« Reply #3 on: February 20, 2024, 11:47:06 pm »
Can you attach a minimalistic demo of what you have done? (tform + tmemo + demo text + your tmemo property settings)
No code needed since its just properties (i guess)

Beside of that it would be useful to know what Lazarus/FPC combination (version number) you use and the target platform it runs on.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

AgriMensor

  • New Member
  • *
  • Posts: 35
Re: ScrollBars in TMemo
« Reply #4 on: February 21, 2024, 02:42:39 pm »
Sorry - forgot to post platform details earlier; here they are:

Windows 10 Pro, Version 22H2
OS build   19045.4046
Windows Feature Experience Pack 1000.19053.1000.0

Lazarus Version 2.2.6
Date 2024-02-19
FPC Version 3.2.2

The prog will eventually be ported to Linx Mint, Mac and Chromebook

TRon

  • Hero Member
  • *****
  • Posts: 2506
Re: ScrollBars in TMemo
« Reply #5 on: February 21, 2024, 02:48:48 pm »
Judging on the screenshots it looks like the memo component itself is not fitting the form, e.g. the bottom of the memo is situated underneath the form. E.g. note that the bottom arrow of the scrollbar of the memo is not visible (and it should).

Do you perhaps have a statusbar or a panel aligned to the bottom of your form (as well) ? It might be the memo is situated below the z-order of another component or simply does not fit the form.

As KodeZwerg wrote: try to make reproducible example so that we are able to test/check/verify.
« Last Edit: February 21, 2024, 02:53:08 pm by TRon »

AgriMensor

  • New Member
  • *
  • Posts: 35
Re: ScrollBars in TMemo
« Reply #6 on: February 21, 2024, 03:14:01 pm »
Hi Davo (dbannon)!
Thanks for your suggestions :-)
The whole of the text is shown in the Word file on the green background in the first screen shot.
I've tried inserting 20 CRLFs after the last line and then ***END*** to demarcate the end of the text. Using this, it now comfortably fits in all of the "real" text but not down to the ***END***. However, the scroll bars are still greyed out.
I've also tried changing the font from whatever the default is to Times New Roman but no significant difference there either.
I'll take a look at making a stand-alone prog if none of the other contributors' suggestions work.
Thanks once again, and any other suggestions welcomed!
Steve

AgriMensor

  • New Member
  • *
  • Posts: 35
Re: ScrollBars in TMemo
« Reply #7 on: February 21, 2024, 03:25:14 pm »
Hi KodeZwerg!
Thanks for your comments and suggestions :-)
You're right, no code yet, but please see my reply to dbannon today and also my earlier post regarding the platform environment.
I'll take a look at making a minimalistic demo if none of the other contributors' suggestions work. I'm working my way through them now . . .
BTW, I rebuilt Lazarus a couple of days ago in order to add some more 3rd-party components, so there may be something frightful in the latest version. However, my own feeling is that it may be something seriously dumb that I have done wrong myself since this is such a fundamental problem :-(
Thanks once again, and any other suggestions welcomed!
Steve

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: ScrollBars in TMemo
« Reply #8 on: February 21, 2024, 03:48:27 pm »
The problem is that the scroll bar is always greyed out and I cannot read the whole text (see photo - can be zoomed to read better).
Looking at that image... I don't see the bottom of the TMemo.
The reason why I see that is because the vertical scrollbar should have a similar arrow at the bottom as at the top.
And the bottom arrow isn't visible.
So your TMemo is bigger than the panel which is holding it.

Make sure the alignment of your TMemo is correct (alBottom, alClient or alTop) and it should become visible.

AgriMensor

  • New Member
  • *
  • Posts: 35
Re: ScrollBars in TMemo
« Reply #9 on: February 21, 2024, 06:57:56 pm »
Hi TRon and rvk!
Thanks for both of your suggestions and WELL SPOTTED :-)
I thought it would be a dumb error on my part and I was right!
I've corrected it now and I can see the whole of the scroll up and scroll down arrows.
However, they're dead, even with short and long content in the TMemo area.
Thanks to everyone for their helpful suggestions!
Steve

 

TinyPortal © 2005-2018