Recent

Author Topic: TPageControl cross-platform question  (Read 1105 times)

jptferreira

  • New Member
  • *
  • Posts: 17
TPageControl cross-platform question
« on: May 23, 2019, 10:52:48 pm »
When porting the code from linux to a windows installation all works great but the TPageControl doesn't show correctly under windows.
Because I selected to the the tabs on the left side, on linux it shows great with the tabs horizontal. On Windows it shows vertically and with the too and that makes it harder to read. At the same time it ruins the layout because it adjust the pagecontrol content.
Any hint on why this happens? Is there any workaround to have the windows layout to be kept the same as linux?
Thanks! ;)

jamie

  • Hero Member
  • *****
  • Posts: 2168
Re: TPageControl cross-platform question
« Reply #1 on: May 23, 2019, 11:00:18 pm »
are you referring to the "TEXT" in the tabs not being horizontal ?
Number 1 at blue screen app creations!

jptferreira

  • New Member
  • *
  • Posts: 17
Re: TPageControl cross-platform question
« Reply #2 on: May 23, 2019, 11:20:54 pm »
Not just the text, even the tabs become vertical while on linux they are horizontal even if on the left, top or bottom.
Even just creating a new TPageControl and moving the tabs to the left will do that, instead of keeping the same orientation, it just changes to horizontal... I'm puzzled! Can be that I'm too tired and cannot see the most obvious! Thanks for your reply

 :D

RAW

  • Hero Member
  • *****
  • Posts: 794
Re: TPageControl cross-platform question
« Reply #3 on: May 23, 2019, 11:23:03 pm »
A picture says more than 1000 words ...  :)
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.4 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1

jamie

  • Hero Member
  • *****
  • Posts: 2168
Re: TPageControl cross-platform question
« Reply #4 on: May 24, 2019, 12:08:19 am »
That problem has been around for a while now..

I fyou set the width of the tabs while they are vertical they kind of do the opposite of what you think.

it's how you think about it..

 Think of the TABS as being rotated as you'll also notice the text is vertical, up for the left and down for the right.

 The Tab widths and height rotate with it in their origination.

 I believe this is how windows implements it..

« Last Edit: May 24, 2019, 12:15:51 am by jamie »
Number 1 at blue screen app creations!

wp

  • Hero Member
  • *****
  • Posts: 6491
Re: TPageControl cross-platform question
« Reply #5 on: May 24, 2019, 12:43:26 am »
Any hint on why this happens? Is there any workaround to have the windows layout to be kept the same as linux?
The pagecontrol is a control which depends strongly on the widget set. I checked several component packages but did not find a pagecontrol-like component in which the tabs can be moved to the left and the text remains horizontal. Maybe you can combine some kind of vertical menu component (such as JVCL's TOutlookbar, or maybe even a TListbox could be sufficient) with a TNotebook.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

jamie

  • Hero Member
  • *****
  • Posts: 2168
Re: TPageControl cross-platform question
« Reply #6 on: May 24, 2019, 01:59:26 am »
The TTabControl if set to LEFT, and with MULTILINE on, will cascade the Tabs down the side with text horizontal.

You can place this beside a TNoteBook and construct what you need.

TPageControl also has this however, the Multiline does not seem to have any effects when doing so?
Number 1 at blue screen app creations!

lucamar

  • Hero Member
  • *****
  • Posts: 2147
Re: TPageControl cross-platform question
« Reply #7 on: May 24, 2019, 03:40:21 am »
A picture says more than 1000 words ...  :)

Enjoy these 2000 words :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.4/2.0.6  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

RAW

  • Hero Member
  • *****
  • Posts: 794
Re: TPageControl cross-platform question
« Reply #8 on: May 24, 2019, 05:14:37 am »
Quote
Enjoy these 2000 words :)
:D

Interesting, I've never seen this kind of bug.
// That's not a standard XP Theme ... is it ???
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.4 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1

lucamar

  • Hero Member
  • *****
  • Posts: 2147
Re: TPageControl cross-platform question
« Reply #9 on: May 24, 2019, 07:46:44 am »
// That's not a standard XP Theme ... is it ???

No, it is Crystal dlb 2.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.4/2.0.6  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 855
Re: TPageControl cross-platform question
« Reply #10 on: May 24, 2019, 09:10:04 am »
When porting the code from linux to a windows installation all works great but the TPageControl doesn't show correctly under windows.
Because I selected to the the tabs on the left side, on linux it shows great with the tabs horizontal. On Windows it shows vertically and with the too and that makes it harder to read. At the same time it ruins the layout because it adjust the pagecontrol content.
Any hint on why this happens? Is there any workaround to have the windows layout to be kept the same as linux?
Thanks! ;)

Not just the text, even the tabs become vertical while on linux they are horizontal even if on the left, top or bottom.
Even just creating a new TPageControl and moving the tabs to the left will do that, instead of keeping the same orientation, it just changes to horizontal... I'm puzzled! Can be that I'm too tired and cannot see the most obvious! Thanks for your reply  :D

A picture says more than 1000 words ...  :)
Attached is the default behavior for Windows 7 and 10.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 855
Re: TPageControl cross-platform question
« Reply #11 on: May 24, 2019, 09:11:16 am »
Any hint on why this happens? Is there any workaround to have the windows layout to be kept the same as linux?
The pagecontrol is a control which depends strongly on the widget set. I checked several component packages but did not find a pagecontrol-like component in which the tabs can be moved to the left and the text remains horizontal. Maybe you can combine some kind of vertical menu component (such as JVCL's TOutlookbar, or maybe even a TListbox could be sufficient) with a TNotebook.

Quote
Enjoy these 2000 words :)
:D
Interesting, I've never seen this kind of bug.
// That's not a standard XP Theme ... is it ???
Neither do I.
As wp said,  I don't see it as bug, but as a simple different behavior between Windows and Linux's widget sets.
Maybe jptferreira should use other component to behave differently on Windows.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 855
Re: TPageControl cross-platform question
« Reply #12 on: May 24, 2019, 09:49:11 am »
The TTabControl if set to LEFT, and with MULTILINE on, will cascade the Tabs down the side with text horizontal.
You can place this beside a TNoteBook and construct what you need.
It's not beautiful, but both TPageControl + TNotebook and TTabControl + TNotebook simulates the expected Linux behavior on Windows.
See attached first small sample.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 855
Re: TPageControl cross-platform question
« Reply #13 on: May 24, 2019, 09:49:57 am »
The TTabControl if set to LEFT, and with MULTILINE on, will cascade the Tabs down the side with text horizontal.
You can place this beside a TNoteBook and construct what you need.
It's not beautiful, but both TPageControl + TNotebook and TTabControl + TNotebook simulates the expected Linux behavior on Windows.
See attached second small sample.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 855
Re: TPageControl cross-platform question
« Reply #14 on: May 24, 2019, 09:50:48 am »
TPageControl also has this however, the Multiline does not seem to have any effects when doing so?
See default behavior on Windows for TPageControl.MultiLine on attached image.