Page 1 of 2

scrollbars on tFolderEx

Posted: Fri Aug 30, 2024 10:05 am
by chiaiese
Hi,
Is it possibile to enable scrollbars on tFolderex control?
the situation: I have an MdiChild container with a Browse on the left and a FolderEx control on the right, the two controls are divided by a Splitter, see some samples in the picture below.
So the tFolderex control is resizeable in every direction (as the browse) and I would like to put scrollbars on it to see the content without enlarge the whole window.
I have changed the style of every dialog in the tFolderex control to paint the bars but they doesn't work (do nothing when i scroll them).
How can I solve the problem?
Roberto

Image

Re: scrollbars on tFolderEx

Posted: Mon Sep 02, 2024 5:07 pm
by chiaiese
Hello, any suggestions?

Roberto

Re: scrollbars on tFolderEx

Posted: Mon Sep 02, 2024 5:09 pm
by Antonio Linares
Dear Roberto,

> I have changed the style of every dialog in the tFolderex control to paint the bars but they doesn't work (do nothing when i scroll them)

Do you have an example for this ? thank you

Re: scrollbars on tFolderEx

Posted: Mon Sep 02, 2024 8:19 pm
by chiaiese
hello Antonio,
first of all, thank you for your answer.
Here's the modified code from tFolderEx Class:

Code: Select all | Expand

#ifdef RECINFORMATICA
// add: lHBar, lVBar - barre di scorrimento
METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, aBitmaps, lPixel,;
            lDesign, aPrompts, nFolderHeight, ;
            aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
            lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
            cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont, ;
            lTransparent, aDialogs, lBorder, nClrPane, cVarName, lHBar, lVBar ) CLASS TFolderEx //-->> byte-one 2010
#else
METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, aBitmaps, lPixel,;
            lDesign, aPrompts, nFolderHeight, ;
            aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
            lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
            cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont, ;
            lTransparent, aDialogs, lBorder, nClrPane, cVarName ) CLASS TFolderEx //-->> byte-one 2010
#endif
...
...

   for n = 1 to nLen

    #ifdef RECINFORMATICA                   // 30/08/2024
        default lHBar := .f.
        default lVBar := .f.
        DEFINE DIALOG oDlg OF Self STYLE nOR( WS_CHILD, If( ! ::oWnd:IsKindOf( "TDIALOG"), WS_CLIPCHILDREN, 0 ),;
                                        if(lHBar, WS_HSCROLL, 0), if(lVBar, WS_VSCROLL, 0));
         FROM 0, 1 TO ::nHeight(), ::nWidth() PIXEL ;
         FONT ::ownd:oFont ;
         HELPID If( Len( ::aHelps ) >= n , ::aHelps[ n ] , NIL )

    // following lines have no effect!! 
        if lVBar
            DEFINE SCROLLBAR oDlg:oVScroll VERTICAL OF oDlg
            oDlg:oVScroll:SetRange( 1, ::nHeight() )
        endif
        if lHBar
            DEFINE SCROLLBAR oDlg:oHScroll HORIZONTAL OF oDlg
            oDlg:oHScroll:SetRange( 1, ::nWidth() )
        endif

    #else
        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 )
    #endif

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

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

   next
 
now the scrollbars appear but if I shrink the window or move the splitter they still are not active, nor if I drag the thumbs neither if I scroll the mouse wheel

Roberto

Re: scrollbars on tFolderEx

Posted: Tue Sep 03, 2024 6:05 am
by Antonio Linares
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

Re: scrollbars on tFolderEx

Posted: Tue Sep 03, 2024 6:05 am
by Antonio Linares
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

Re: scrollbars on tFolderEx

Posted: Tue Sep 03, 2024 6:32 am
by Silvio.Falconi
chiaiese wrote:Hi,
Is it possibile to enable scrollbars on tFolderex control?
the situation: I have an MdiChild container with a Browse on the left and a FolderEx control on the right, the two controls are divided by a Splitter, see some samples in the picture below.
So the tFolderex control is resizeable in every direction (as the browse) and I would like to put scrollbars on it to see the content without enlarge the whole window.
I have changed the style of every dialog in the tFolderex control to paint the bars but they doesn't work (do nothing when i scroll them).
How can I solve the problem?
Roberto

Image
Roberto,
I can't figure out where the problem is without a minimal test, and anyway I don't understand where the tfolderex would be in the figure

Re: scrollbars on tFolderEx

Posted: Tue Sep 03, 2024 2:30 pm
by chiaiese
Hi Silvio,
in the first and third windows, on the right side of the browse we have a tFolderEx object ('Descrizione' and 'Anteprima' folders).
Well, after the controls are first painted on it, we can resize the windows or move the splitter. As you can see, in the folder in the first window the memo field is partially hide at the bottom.
In some cases I can do a resize of the control (see the image on the third window) but if I have simple tSay objects in the folder this may be more difficult and make the text unreadable.
Also notice that when the windows are closed, I save their coordinates and the splitter and toolbar position to restore them at the next open. So can happen that some says at the bottom of the tFolderEx dialog are never displayed until the window is maximized.
For these reasons I would like to have scroll bars inside the folder dialogs to see the entire contents without have to enlarge the windows

Roberto

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 6:28 am
by Silvio.Falconi
I had to enlarge the image to find the tfolderex.
anyway it seems to me too many things in one window, I'm talking to you from the user's point of view, I would have done it in another way but if that's what you see if Antonio finds the solution

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 11:10 am
by karinha
Good morning in the folder, "Anteprima" what control do you use to show the Image to show the invoice?

Buenos días en la carpeta "Anteprima" ¿qué control utiliza para mostrar la Imagen para mostrar la factura?

Gracias, tks.

Regards, saludos.

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 2:36 pm
by chiaiese
Karinha,
it is a tImage control, I use ImageMagick in background to create the preview when the document file is dropped or just created from the app.
Just double-click the preview to open attached documents with their predefined apps (images, text, pdf or whatever you want)

Roberto

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 3:17 pm
by karinha
Why don't you use a TBITMAP? Much simpler to control.

¿Por qué no utilizas un TBITMAP? Mucho más sencillo de controlar.

https://imgur.com/dQPaazc

Image

Regards, saludos.

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 4:22 pm
by chiaiese
Karinha,
I don't use Resource Workshop or other tools to design windows and controls, I think it wastes a lot of time.
I use classes that defines the behavior and positioning of objects by source.
So I use the control objects that seems more complete and gives me more possibilities, once programmed they work on their own.

Here is how I define the content of the 'clip' object (the right panel in the window)

Code: Select all | Expand

Method SetClip()
::oClip:lFolder := .t.

::oClip:addFld( CEditFld():New( "ImageName" ,"File:",, .f. ))       // thi is a simple tSay object
::oClip:Getfld("ImageName"):bData := {|| (::nArea)->(basename(trim(PathFile)+PATHTHUMB+"s"+trim(NomeFile))+THUMBEXT) }

::oClip:addFld( CEditFld():New( "Image" ,"Img.:",, .f. ))
::oClip:Getfld("Image"):bData := {|| (::nArea)->(basename(trim(PathFile)+PATHTHUMB+"s"+trim(NomeFile))+THUMBEXT) }
::oClip:Getfld("Image"):nType := OCTRL_IMAGE             // here I define that I want to display the image

::oClip:bOnDisp := {|oCl,lSet| ::OnDisp(oCl,lSet) }              // everytime the control is updated
return (Self)

******************************************************************************
Method OnDisp(oClip,lSet)
if lSet
    oClip:getFld("Image"):oCtrl:blDblClick := {||::display() }                // open the document
    oClip:getFld("Image"):oCtrl:oCursor := TCursor():New(,"Hand")
endif
return (nil)
 
that's all, nothing to draw, objects and controls are managed by the <oClip> object

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 4:58 pm
by Silvio.Falconi
karinha wrote:Why don't you use a TBITMAP? Much simpler to control.

¿Por qué no utilizas un TBITMAP? Mucho más sencillo de controlar.

https://imgur.com/dQPaazc

Image

Regards, saludos.
Sorry karinha how run the resource Borland on 32/64 bit (win 7/10) ?

Re: scrollbars on tFolderEx

Posted: Wed Sep 04, 2024 5:08 pm
by karinha
Good afternoon Silvio, you can use the EMULATOR to run the 16-bit Workshop.exe on Windows 64, or directly use the 32-bit Workshop.exe, the choice is yours.

Buenas tardes Silvio, puedes usar el EMULADOR para ejecutar el Workshop.exe de 16 bits en Windows 64, o directamente usar el Workshop.exe de 32 bits, la elección es tuya.

Emulator for WorkSop.exe 16 bits:

https://fivewin.com.br/index.php?/topic ... ent-291687

WorkShop.exe de 32 bits:

https://fivewin.com.br/index.php?/topic ... ent-306216

Regards, saludos.