Recent

Author Topic: Form1.Caption alignment  (Read 277 times)

Barry55

  • New Member
  • *
  • Posts: 20
Form1.Caption alignment
« on: January 24, 2021, 07:54:02 pm »
I have an odd problem that I cannot find a way to fix.

If I create a new form on Windows the Form1.Caption is left justified
If I create a new form on a Raspberry Pi the Form1.Caption is centre justified and I just can't seem to find a way to change it to left justified.

I have a very small Raspberry Pi application that I cannot see the Form caption if centred so I need to find a way to left justify it.

I just wondered if anyone had any suggestions

Many thanks
Barry

lucamar

  • Hero Member
  • *****
  • Posts: 3601
Re: Form1.Caption alignment
« Reply #1 on: January 24, 2021, 08:26:01 pm »
That's probably an artifact of the desktop theme; do other applications show different caption alignment? If not, then your theme just draws the captions that way and, unless it can be configured, there is little you can do about it.

If you really want to show some needed information I'd suggest using a top-aligned TLabel, with whose properties you can play to your heart's content. :)
« Last Edit: January 24, 2021, 08:28:25 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

jamie

  • Hero Member
  • *****
  • Posts: 4189
Re: Form1.Caption alignment
« Reply #2 on: January 24, 2021, 08:31:38 pm »
add spaces to it.. and maybe a White space at the end incase it tried to trim right.
The only true wisdom is knowing you know nothing

Barry55

  • New Member
  • *
  • Posts: 20
Re: Form1.Caption alignment
« Reply #3 on: January 24, 2021, 11:38:23 pm »
It does indeed seem like the theme, and I can't see a way to change it and I haven't been able to find one online either.

Adding spaces and whitespace (and indeed anything) doesn't work. Its not centred as such it starts in the centre so

"The Quick Brown Fox jumps over the lazy dog", displays "The Qu......g" with the T starting position in the centre of the form.

Having looked at other programs they almost all seem to have a minimum size, so for instance calculator and file manager will not shrink small enough to make the center'ing of the text an issue. Terminal window which will shrink acts like my program.

I was hoping for some sort of escape sequence or something but it looks like I might be out of luck. I will post a question on the Raspberry Pi boards just in case anyone there knows a solution.

I thought about a top aligned TLabel, but I am trying to keep the program as small as possible. I guess I could remove the window bar altogether and add a right click menu to exit etc, I did use that once before in a delphi program now I think about it.

Its a bit of a pain, but for now, thanks for your comments and if I find anything out I will post it back here in case anyone else asks about it in the future. For not I have abbreviated the text and its sort of ok (ish).

Barry

Barry55

  • New Member
  • *
  • Posts: 20
SOLVED Re: Form1.Caption alignment
« Reply #4 on: January 25, 2021, 11:15:18 am »
Just a quick update to say I have found and fixed the issue. I have added it below as although its really as Raspberry Pi issue I found it in the context of a Lazarus program so it might be of use to someone else. Hope that's OK.

On the Raspberry PI

1.Click the start menu

2.Then go to preferences and click "Main Menu Editor"

3.Go down to preferences and enable "Theme and Appearance Settings" (Not "Appearance Settings")

4.Go back to start menu and Preferences and open "Theme and Appearance Settings"

5.Click "Window Border" and you're free to do whatever

I set my theme to Natura and not only is it left justified the title bar is half height which is even better.

Barry

 

TinyPortal © 2005-2018