TFolderEx

Post Reply
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

TFolderEx

Post 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).
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TFolderEx

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: TFolderEx

Post by Natter »

Everything is working fine. Thanks !

Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: TFolderEx

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TFolderEx

Post 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:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: TFolderEx

Post by Natter »

Understood. Thank you. I'll try.

User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TFolderEx

Post by Antonio Linares »

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
User avatar
richard-service
Posts: 868
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: TFolderEx

Post 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

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
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TFolderEx

Post 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 ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
richard-service
Posts: 868
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: TFolderEx

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

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
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TFolderEx

Post by Antonio Linares »

Dear Richard,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
richard-service
Posts: 868
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: TFolderEx

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

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
Post Reply