FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to end/hide oVscroll/oHscroll in dialog
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
How to end/hide oVscroll/oHscroll in dialog
Posted: Fri May 28, 2010 06:01 AM

Dear all,

I have a scroll dialog (from Eric Yang) which I adapted with my apps..

If I re-size the dialog and display scrolls (V/H) if dialog's height and width are at the minimum or lower.. the V/H scrollbars appears..
BUT if the dialog's coordinates higher than the minimum the scrollbars should be hidden because they are not need..

I tried oDlg:oVScroll:SetRange(0,0) or oDlg:oHScroll:SetRange(0,0) but still the scrollbars are showing..
I also tried oDlg:oVScroll:Destroy().. oDlg:oVScroll:End().. I even refresh.. repaint oDlg.. I cant make them disappear after it was created...

Im using FWH v10.5

Any Ideas are most welcome..

Regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to end/hide oVscroll/oHscroll in dialog
Posted: Fri May 28, 2010 06:47 AM

Frances,

Could you please provide a small and self contained example ? thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: How to end/hide oVscroll/oHscroll in dialog
Posted: Fri May 28, 2010 07:35 AM
Dear Mr. Antonio,

This is a portion from samples\testdscr_.prg just for the idea..

Code (fw): Select all Collapse
...
FUNCTION Main() 

   LOCAL oDlg, oScrDlg

   DEFINE DIALOG oDlg RESOURCE "dlgComScroll" ;  
         TITLE "Scroll dialog"            ; 
         STYLE nOR( WS_VSCROLL, WS_HSCROLL ) 

   oDlg:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | MouseWheel( nKey, nDelta, nXPos, nYPos, oScrDlg ) }

   ACTIVATE DIALOG oDlg ; 
      ON INIT ( oScrDlg := TScrDlg():New( oDlg, 1, 65, 1, 70), oDlg:SetSize( 560, 550 ), oDlg:Center(),;
                oDlg:oVscroll:SetRange(0,0),;
        oDlg:oVscroll:Destroy()  ) 

RETURN( NIL ) 
...



The
oDlg:SetRange(0,0),;
oDlg:Destroy()
in ON INIT is to end/hide/destroy so no oVscroll is visible

Here the Idea is to hide oVscroll/oHscroll when not needed.. after it was defined.. Just an example.


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to end/hide oVscroll/oHscroll in dialog
Posted: Fri May 28, 2010 09:30 AM
Frances,

With this code you can remove the thumbs from the scrollbars but we can not hide them, unless we change the style of the dialog again:
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg STYLE nOR( WS_VSCROLL, WS_HSCROLL, WS_SYSMENU )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oDlg:oVScroll:SetRange( 0, 0 ),;
                oDlg:oHScroll:SetRange( 0, 0 ) )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion