scrollbars on tFolderEx

User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: scrollbars on tFolderEx

Post by karinha »

Silvio, Workshop.exe de 32 bits:

https://imgur.com/Qy9Xmaf

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
chiaiese
Posts: 85
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Re: scrollbars on tFolderEx

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

 
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: scrollbars on tFolderEx

Post 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!
regards, saludos

Antonio Linares
www.fivetechsoft.com
chiaiese
Posts: 85
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Re: scrollbars on tFolderEx

Post 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
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: scrollbars on tFolderEx

Post by Antonio Linares »

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

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: scrollbars on tFolderEx

Post by Silvio.Falconi »

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 November 2023 - January 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
chiaiese
Posts: 85
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Re: scrollbars on tFolderEx

Post 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
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: scrollbars on tFolderEx

Post 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! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
chiaiese
Posts: 85
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Re: scrollbars on tFolderEx

Post by chiaiese »

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.
http://www.recinformatica.it
info@recinformatica.it
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: scrollbars on tFolderEx

Post by Antonio Linares »

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
chiaiese
Posts: 85
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Re: scrollbars on tFolderEx

Post by chiaiese »

done...

regards
Roberto
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: scrollbars on tFolderEx

Post by Antonio Linares »

Dear Roberto,

got it, many thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply