FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TFolderEx
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx
Posted:

Dear Richard,

You do need updated FWH libs.

Please let me know which ones you need: 32 or 64, bcc or msvc ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
TFolderEx
Posted: Wed Mar 04, 2026 01:15 PM

TFolderEx is located on the left.

  1. Is it possible to make vertical writing of the text (PROMPT) its TAB's ?
  2. The width of the TAB's depends on the PROMPTS. Is it possible to make the tabs evenly distributed over the entire width of the TFolderEx (or specify the width of the tabs yourself).
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx
Posted: Wed Mar 04, 2026 01:46 PM

Dear Yuri,

Here are the answers to both of your questions about TFolderEx with LEFT layout:


---

1. Vertical text on LEFT tabs โ€” Already built-in

When you set the layout to LEFT (or RIGHT), TFolderEx automatically rotates the font for vertical text rendering. In the New() method:

Code (prg): Select all Collapse
if ::nLayOut == LAYOUT_RIGHT .OR. ::nLayOut == LAYOUT_LEFT
   oFont := ::oFont:Escapement( If( ::nLayOut == LAYOUT_RIGHT, 2700, 900 ) )
   ::SetFont( oFont )
   oFont:End()
endif
``` [0-cite-0](#0-cite-0) 

For `LAYOUT_LEFT`, the escapement is set to `900` (90 degrees), which rotates text bottom-to-top. The `PaintLR()` method then draws this rotated text using `DrawTextTransparent()`. [0-cite-1](#0-cite-1) 

The same applies in `SetLayOut()` โ€” switching to LEFT/RIGHT at runtime also recreates the font with the proper escapement: [0-cite-2](#0-cite-2) 

So if you use `LEFT` in the command syntax, text is already written vertically. No extra work needed.

---

## 2. Even tab distribution โ€” Use `STRETCH`

By default, each tab's size (height in LEFT layout) is calculated from the text width of its prompt:

```prg
nWidth = GetTextWidth( 0, StrTran( ::aPrompts[ n ], "&", "" ), ::oFont:hFont ) + TXTLPAD + TXTRPAD + nBmpWidth
``` [0-cite-3](#0-cite-3) 

This is why tabs have different sizes depending on prompt length.

To make tabs **evenly distributed over the entire height** of the TFolderEx, use the **`STRETCH`** clause:

```prg
@ 0, 0 FOLDEREX oFld PIXEL ;
   PROMPT "Tab1", "Tab2", "Tab3" ;
   SIZE 200, 400 ;
   LEFT STRETCH
``` [0-cite-4](#0-cite-4) 

Or set it programmatically:

```prg
oFld:lStretch := .T.
oFld:CalPos()
oFld:Refresh()

When lStretch is .T., the CalPos() function redistributes the remaining space among tabs to fill the full dimension (::nHeight for LEFT/RIGHT layouts): 0-cite-5 0-cite-6

The stretch algorithm gives extra space to tabs that are smaller than the average, while tabs already larger keep their natural width. This effectively distributes them across the full height.

Controlling the tab strip width

The perpendicular dimension (how wide the tab strip is on the left side) is controlled by nFolderHeight (default 25 pixels). You can set it via the TAB HEIGHT clause: 0-cite-7

Code (prg): Select all Collapse
@ 0, 0 FOLDEREX oFld PIXEL ;
   PROMPT "Tab1", "Tab2", "Tab3" ;
   TAB HEIGHT 40 ;
   SIZE 200, 400 ;
   LEFT STRETCH

Setting exact custom tab sizes

If you need precise control over individual tab sizes, you can directly modify the ::aSizes array after the control is created and then call ::Refresh(). However, this is fragile because CalPos() recalculates sizes on resize. The STRETCH approach is the supported way.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TFolderEx
Posted: Wed Mar 04, 2026 08:12 PM

Everything is working fine. Thanks !

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TFolderEx
Posted: Fri Mar 06, 2026 12:32 PM

Is it possible with the FolderEx position Left or Right to show the text in bookmarks like this:

            T
            E
            S
            T
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx
Posted: Fri Mar 06, 2026 01:08 PM

Dear Yuri,

No, TFolderEx does not have built-in support for stacked vertical text (characters one below another like a column). What it currently supports is rotated text โ€” the entire string is drawn at a 90ยฐ angle using font escapement.

The cleanest solution is to modify PaintLR() in source/classes/tfoldex.prg to add the same Chr(13) multiline support that PaintTB() has, combined with using a non-rotated font when multiline prompts are detected.

We have already enhanced method PaintLR() so this example works fine:

FWH\samples\test\testfx6.prg

// TFolderEx - Stacked vertical text on LEFT tabs using Chr(13)
// Demonstrates multiline support in PaintLR() for LEFT/RIGHT layouts

#include "FiveWin.ch"

function main()

   local oWnd, oFld

   DEFINE WINDOW oWnd TITLE "TFolderEx - Stacked Vertical Text (LEFT layout)"

   @ 3, 3 FOLDEREX oFld PIXEL ADJUST ;
      PROMPT StackVert( "Social" ), ;
             StackVert( "Email" ), ;
             StackVert( "Games" ), ;
             StackVert( "Settings" ) ;
      TAB HEIGHT 50 ;
      LEFT STRETCH

   @ 10, 10 SAY "This is the Social page"    OF oFld:aDialogs[ 1 ] PIXEL TRANSPARENT
   @ 10, 10 SAY "This is the Email page"     OF oFld:aDialogs[ 2 ] PIXEL TRANSPARENT
   @ 10, 10 SAY "This is the Games page"     OF oFld:aDialogs[ 3 ] PIXEL TRANSPARENT
   @ 10, 10 SAY "This is the Settings page"  OF oFld:aDialogs[ 4 ] PIXEL TRANSPARENT

   ACTIVATE WINDOW oWnd ;
      ON INIT oFld:Resize()

RETURN NIL

//----------------------------------------------------------------------------//
// Helper function: inserts Chr(13) + Chr(10) between each character

FUNCTION StackVert( cText )

   LOCAL cResult := ""
   LOCAL i

   FOR i := 1 TO Len( cText )
      cResult += SubStr( cText, i, 1 )
      IF i < Len( cText )
         cResult += Chr( 13 ) + Chr( 10 )
      ENDIF
   NEXT

RETURN cResult


Please let me know if you are using 32 bits and bcc, so we email you the updated FWH libs :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TFolderEx
Posted: Fri Mar 06, 2026 02:00 PM

Understood. Thank you. I'll try.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx
Posted: Fri Mar 06, 2026 02:05 PM

Please let me know if you are using 32 bits and bcc, so we email you the updated FWH libs

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: TFolderEx
Posted: Sun Mar 08, 2026 06:10 AM
Antonio Linares wrote:

Please let me know if you are using 32 bits and bcc, so we email you the updated FWH libs

Dear Antonio,

This is fwh2512 not upgrade and show it.

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: TFolderEx
Posted: Mon Mar 09, 2026 08:00 AM
Antonio Linares wrote:

Dear Richard,

You do need updated FWH libs.

Please let me know which ones you need: 32 or 64, bcc or msvc ?

Dear Antonio,

I test 32bit with bcc. 64bit bcc later...

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TFolderEx
Posted: Mon Mar 09, 2026 02:28 PM

Dear Richard,

Modified FWH libs (TFolderEx and cGetFile()) sent to your email :!:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: TFolderEx
Posted: Tue Mar 10, 2026 12:16 PM
Antonio Linares wrote:

Dear Richard,

Modified FWH libs (TFolderEx and cGetFile()) sent to your email :!:

Dear Antonio,

I got it and work fine.

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion