scrollbars on tFolderEx

Re: scrollbars on tFolderEx

Postby karinha » Wed Sep 04, 2024 5:21 pm

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
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: scrollbars on tFolderEx

Postby chiaiese » 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: Select all  Expand view

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 view

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

Re: scrollbars on tFolderEx

Postby Antonio Linares » Sun Sep 08, 2024 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: scrollbars on tFolderEx

Postby chiaiese » Sun Sep 08, 2024 6:03 pm

Antonio,
I already tried it but it seems that the ScrollPanel class has no methods to manage it:

Code: Select all  Expand view

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

Re: scrollbars on tFolderEx

Postby Antonio Linares » Sun Sep 08, 2024 6:53 pm

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: scrollbars on tFolderEx

Postby Silvio.Falconi » Sun Sep 08, 2024 8: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 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: scrollbars on tFolderEx

Postby chiaiese » 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.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: scrollbars on tFolderEx

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

Re: scrollbars on tFolderEx

Postby chiaiese » 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.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: scrollbars on tFolderEx

Postby Antonio Linares » Sun Oct 06, 2024 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: scrollbars on tFolderEx

Postby chiaiese » Tue Oct 08, 2024 9:52 pm

done...

regards
Roberto
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: scrollbars on tFolderEx

Postby Antonio Linares » Wed Oct 09, 2024 5:30 am

Dear Roberto,

got it, many thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests