Page 2 of 2

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 5:21 pm
by karinha
Silvio, Workshop.exe de 32 bits:

https://imgur.com/Qy9Xmaf

Image

Regards, saludos.

Re: scrollbars on tFolderEx

Posted: Fri Sep 06, 2024 11:19 am
by chiaiese
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: Select all | Expand

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

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)

 

Re: scrollbars on tFolderEx

Posted: Sun Sep 08, 2024 7:17 am
by Antonio Linares
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!

Re: scrollbars on tFolderEx

Posted: Sun Sep 08, 2024 6:03 pm
by chiaiese
Antonio,
I already tried it but it seems that the ScrollPanel class has no methods to manage it:

Code: Select all | Expand

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

Re: scrollbars on tFolderEx

Posted: Sun Sep 08, 2024 6:53 pm
by Antonio Linares
I am afraid yes as it never had support for horizontal scroll

Re: scrollbars on tFolderEx

Posted: Sun Sep 08, 2024 8:40 pm
by Silvio.Falconi
Antonio Linares wrote:I am afraid yes as it never had support for horizontal scroll
I asked It much time ago....

Re: scrollbars on tFolderEx

Posted: Mon Sep 09, 2024 10:20 am
by chiaiese
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

Re: scrollbars on tFolderEx

Posted: Mon Sep 09, 2024 11:36 am
by Antonio Linares
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! :-)

Re: scrollbars on tFolderEx

Posted: Sat Oct 05, 2024 10:02 pm
by chiaiese
Hi Antonio,
did you received the source file?
I sent it to you on september 09

regards
Roberto

Re: scrollbars on tFolderEx

Posted: Sun Oct 06, 2024 6:11 am
by Antonio Linares
Dear Roberto,

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

many thanks

Re: scrollbars on tFolderEx

Posted: Tue Oct 08, 2024 9:52 pm
by chiaiese
done...

regards
Roberto

Re: scrollbars on tFolderEx

Posted: Wed Oct 09, 2024 5:30 am
by Antonio Linares
Dear Roberto,

got it, many thanks!