FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour scrollbars on tFolderEx
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: scrollbars on tFolderEx
Posted: Wed Sep 04, 2024 05:21 PM
Silvio, Workshop.exe de 32 bits:

https://imgur.com/Qy9Xmaf



Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: scrollbars on tFolderEx
Posted: Fri Sep 06, 2024 11:19 AM
Antonio Linares wrote:Dear Roberto,

If you want to scroll the dialog contents in a TFolderEx control probably using a TScrollPanel is the way to go.

We are going to test it and share an example

Please wait for us, thank you
Antonio,
I did it!
As you suggest I used TScrollPanel to make folders scrollable and, with a few modifications in the container object to manage window and splitter resizing, now it works.
All the controls are now painted on the TScrollPanel instead of the FolderEx dialogs
Only, it would be nice to have horizontal scrollBars too...

here is the code I modified in the TFolderEx():New() method:
Code (fw): Select all Collapse
for n = 1 to nLen

    DEFINE DIALOG oDlg OF Self STYLE nOR( WS_CHILD, If( ! ::oWnd:IsKindOf( "TDIALOG"), WS_CLIPCHILDREN, 0 ) );
     FROM 0, 1 TO ::nHeight(), ::nWidth() PIXEL ;
     FONT ::ownd:oFont ;
     HELPID If( Len( ::aHelps ) >= n , ::aHelps[ n ] , NIL )
    #ifdef RECINFORMATICA                   // 06/09/2024
        default lHBar := .f.
        default lVBar := .f.
        if lVBar
            oPanel := TScrollPanel():New( 1, 1, ::nHeight()-30, ::nWidth()-30, oDlg, .T. )
            oPanel:SetColor( CLR_WHITE, nClrPane )
        endif
    #endif

      oDlg:SetBrush( ::oBrush )
      ::aDialogs[ n ] = oDlg

      oDlg:cVarName := "Page" + AllTrim( Str( n ) )
      oDlg:Hide()
      // oDlg:lTransparent := .T.

   next
How to get the actual window to put controls on:
Code (fw): Select all Collapse
Method GetWnd() CLASS CClip
local oWnd
if ::oFolder # NIL      // folder non ancora creato
    oWnd := if( ::lFolder, ::oFolder:aDialogs[::oFolder:nOption], ::oWnd )
    #ifdef SCROLLCLIP
        // add: 05/09/2024 gestione tScrollPanel() per <oClip>
        if ::lFolder .and. ::oFolder:isKindof("TFOLDEREX") .and. !empty(oWnd:aControls) .and. oWnd:aControls[1]:isKindof("TSCROLLPANEL")
            oWnd := oWnd:aControls[1]
        endif
    #endif
endif
Return (oWnd)

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: scrollbars on tFolderEx
Posted: Sun Sep 08, 2024 07:17 AM
Excellent Roberto! :-)

Class TScrollPanel needs to use WS_HSCROLL too and add an horizontal scrollbar:

DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self RANGE 1,2
DEFINE SCROLLBAR ::oHScroll HORIZONTAL OF Self RANGE 1,2

You are very close to have it!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: scrollbars on tFolderEx
Posted: Sun Sep 08, 2024 06:03 PM
Antonio,
I already tried it but it seems that the ScrollPanel class has no methods to manage it:
Code (fw): Select all Collapse
for n = 1 to nLen

    DEFINE DIALOG oDlg OF Self STYLE nOR( WS_CHILD, If( ! ::oWnd:IsKindOf( "TDIALOG"), WS_CLIPCHILDREN, 0 ) );
     FROM 0, 1 TO ::nHeight(), ::nWidth() PIXEL ;
     FONT ::ownd:oFont ;
     HELPID If( Len( ::aHelps ) >= n , ::aHelps[ n ] , NIL )
    #ifdef RECINFORMATICA                   // 06/09/2024
        default lHBar := .f.
        default lVBar := .f.
        if lVBar .or. lHBar
            oPanel := TScrollPanel():New( 1, 1, ::nHeight()-30, ::nWidth()-30, oDlg, .T. )
            oPanel:SetColor( CLR_WHITE, nClrPane )
            // this does not work, they are not managed?
            if lHBar
                DEFINE SCROLLBAR oPanel:oHScroll HORIZONTAL OF oPanel RANGE 1,2
                
                oPanel:nStyle := nOr(  WS_CHILD, WS_VSCROLL, WS_HSCROLL,;
                                    WS_VISIBLE, WS_TABSTOP, WS_CLIPCHILDREN )
                oPanel:refresh()
            endif
            //
        endif
    #endif

      oDlg:SetBrush( ::oBrush )
      ::aDialogs[ n ] = oDlg

      oDlg:cVarName := "Page" + AllTrim( Str( n ) )
      oDlg:Hide()
      // oDlg:lTransparent := .T.

   next
where am I going wrong?
Do I have to write all the methods as for the vertical scrollbar?
regards

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: scrollbars on tFolderEx
Posted: Sun Sep 08, 2024 06:53 PM

I am afraid yes as it never had support for horizontal scroll

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: scrollbars on tFolderEx
Posted: Sun Sep 08, 2024 08:40 PM
Antonio Linares wrote:I am afraid yes as it never had support for horizontal scroll
I asked It much time ago....
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: scrollbars on tFolderEx
Posted: Mon Sep 09, 2024 10:20 AM

Antonio

ok, I wrote the missing methods and now full scrolling is supported, even with mouse dragging.

If you wish I can send to you the modified full source code by mail

thank you for support

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: scrollbars on tFolderEx
Posted: Mon Sep 09, 2024 11:36 AM
Dear Roberto,

Great!!! :-)

It is so encouraging when FWH users reach a real Masters level!

Yes please, send me the code and we will include it in FWH, big thank you! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: scrollbars on tFolderEx
Posted: Sat Oct 05, 2024 10:02 PM

Hi Antonio,

did you received the source file?

I sent it to you on september 09

regards

Roberto

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: scrollbars on tFolderEx
Posted: Sun Oct 06, 2024 06:11 AM

Dear Roberto,

I apologize as I may have missed it. Please resend it and we will include it

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: scrollbars on tFolderEx
Posted: Tue Oct 08, 2024 09:52 PM

done...

regards

Roberto

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: scrollbars on tFolderEx
Posted: Wed Oct 09, 2024 05:30 AM

Dear Roberto,

got it, many thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion