Disabling scrollbars(H and V) in redefined xbrowse at runtim

Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Wed Feb 02, 2011 12:15 am

Dear All,
Do you have any code to solve my problem for the above topic... pls. help... thanks in advance...

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Wed Feb 02, 2011 1:36 am

Try:

oBrw:lHScroll := .f.
oBrw:lVScroll := .f.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Wed Feb 02, 2011 2:37 am

Dear Sir james,

Thanks for the prompt reply, i already tried those properties but the scrollbars are still not disabled, my xbrowse is defined using resource of UDC control.

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Wed Feb 02, 2011 2:57 am

Apollo,

Are you also disabling them in the resource editor?

Are you calling oBrw:createFromCode()?

Can we see your code where you define the browse?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Wed Feb 02, 2011 4:01 am

Dear Sir James,

In resource editor,scrollbars in xbrowse (UDC) control are both enabled. Here's code in resource editor:

DLG_PRINTRPT DIALOGEX -2,-16,461,308
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION
BEGIN
CONTROL "",1601,"TXBROWSE",WS_CHILDWINDOW|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL,7,6,447,262



And the code in FWH:



Select(0)
REDEFINE XBROWSE oBrwPrintRpt ID 1601 OF oDlgPrintRpt;
ALIAS 'PRINTRPT';
AUTOSORT UPDATE AUTOCOLS LINES CELL;

oBrwPrintRpt:lHScroll := .F.
//oBrwPrintRpt:createFromCode()


Sir James, i received an error when i used "oBrwPrintRpt:createFromCode()" saying "duplicate ID"

thank you very much...

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby nageswaragunupudi » Wed Feb 02, 2011 5:49 am

If you use resource, decide whether you want to have scrollbars when you design your resource itself. If you want to toggle scrollbars on and off at runtime, you better create the dialog by code.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby Gale FORd » Wed Feb 02, 2011 3:31 pm

Can they be hidden. I have used resources that overlap each other before. For instance a radio control might need different fields for different choices. So I hide and disable some and unhide and enable the ones I need for the corresponding radio selection.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Wed Feb 02, 2011 4:59 pm

Apollo,

My mistake. Instead of CreateFromCode() you need to use CreateFromResource( nID ).

You can also try:

oBrw:oHScroll:disable()
oBrw:oVScroll:disable()

I don't think that Gale's idea of hiding the scrollbars will work since the mouse wheel and arrow keys would still provide scrolling.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby Gale FORd » Wed Feb 02, 2011 8:51 pm

You would still disable them but in addition you would hide them so they did not show up at all.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Wed Feb 02, 2011 11:32 pm

Gale,

Thanks, that makes sense.

I think that when you use lHScroll, and lVScroll set to false, the scrollbars don't show. At least that is what I remember. I suspect that they are not created.

If you disable them after the control is created, then I am not sure what happens. I don't remember ever trying that.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Thu Feb 03, 2011 5:31 am

Dear All,

Thanks for ur great ideas. Sir James, i've tried the function disable() but the function was not present neither the oHScroll/oVScroll objects. I still wondered why these objects are not present in xbrowse object...


thanks.

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Thu Feb 03, 2011 7:30 am

Apollo,

It appears the oHVScroll and oVScroll objects are created by the resource editor when you use a resource and by code when you create the browse with code.

Let me ask, are you wanting to disable the scrollbars at runtime before the browse is created or after the browse is created (perhaps on and off while it is active)?

Maybe you could create two browses as resources, one with scrollbars and one without and use the appropriate one at runtime.

Or maybe you could just build the browse with code instead.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Thu Feb 03, 2011 8:11 am

Dear Sir James,

I want to disable scroll bars after the xbrowse is created. The reason why i want to disable the scroll bars what if the number of records loaded in xbrowse is less than the height of Hscroll bar(means records are few or just one record for instance), it is valid to just hide or disable the hscroll bar because there's no need for it.... though, thanks for the ideas.... :D

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby James Bott » Thu Feb 03, 2011 3:28 pm

Apollo,

Hmm, if I remember correctly a browse will automatically hide or disable (I don't remember which) the scrollbar when it isn't needed (as determined by the number of records). Have you tested this?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Disabling scrollbars(H and V) in redefined xbrowse at runtim

Postby amnunez » Fri Feb 04, 2011 12:22 am

Dear Sir James,

Yes sir, that's the idea. The vertical scroll bar is the one i want to hide or disable when the number of records are few. Also, i tried to revised my code so that the objects of scroll bars (oHScroll and oVScroll) become present but still disabling function and/or property are not working. thanks.

regards,
apollo
FWH10.6|BCC5.82|PELLEC|XMATE
amnunez
 
Posts: 24
Joined: Mon Jan 11, 2010 8:18 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests