How to end/hide oVscroll/oHscroll in dialog

How to end/hide oVscroll/oHscroll in dialog

Postby fraxzi » Fri May 28, 2010 6: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: How to end/hide oVscroll/oHscroll in dialog

Postby Antonio Linares » Fri May 28, 2010 6:47 am

Frances,

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

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

Re: How to end/hide oVscroll/oHscroll in dialog

Postby fraxzi » Fri May 28, 2010 7:35 am

Dear Mr. Antonio,

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

Code: Select all  Expand view

...
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:oVscroll:SetRange(0,0),;
oDlg:oVscroll: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: How to end/hide oVscroll/oHscroll in dialog

Postby Antonio Linares » Fri May 28, 2010 9: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: Select all  Expand view

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 22 guests