Page 1 of 1

TFolderEx

Posted: Wed Mar 04, 2026 1:15 pm
by Natter

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).

Re: TFolderEx

Posted: Wed Mar 04, 2026 1:46 pm
by Antonio Linares

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: Select all | Expand

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: Select all | Expand

@ 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.


Re: TFolderEx

Posted: Wed Mar 04, 2026 8:12 pm
by Natter

Everything is working fine. Thanks !


Re: TFolderEx

Posted: Fri Mar 06, 2026 12:32 pm
by Natter

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

Code: Select all | Expand

            T
            E
            S
            T

Re: TFolderEx

Posted: Fri Mar 06, 2026 1:08 pm
by Antonio Linares

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

Code: Select all | Expand

// 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

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


Re: TFolderEx

Posted: Fri Mar 06, 2026 2:00 pm
by Natter

Understood. Thank you. I'll try.


Re: TFolderEx

Posted: Fri Mar 06, 2026 2:05 pm
by Antonio Linares

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


Re: TFolderEx

Posted: Sun Mar 08, 2026 6:10 am
by richard-service
Antonio Linares wrote: Fri Mar 06, 2026 2:05 pm

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.

Image


Re: TFolderEx

Posted: Sun Mar 08, 2026 9:07 pm
by Antonio Linares

Dear Richard,

You do need updated FWH libs.

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


Re: TFolderEx

Posted: Mon Mar 09, 2026 8:00 am
by richard-service
Antonio Linares wrote: Sun Mar 08, 2026 9:07 pm

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...


Re: TFolderEx

Posted: Mon Mar 09, 2026 2:28 pm
by Antonio Linares

Dear Richard,

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


Re: TFolderEx

Posted: Tue Mar 10, 2026 12:16 pm
by richard-service
Antonio Linares wrote: Mon Mar 09, 2026 2:28 pm

Dear Richard,

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

Dear Antonio,

I got it and work fine.