Function of Vertical ScrollBar of Browse object

Function of Vertical ScrollBar of Browse object

Postby xProgrammer » Fri Aug 03, 2007 7:00 am

The vertical scroll bar of the Browse object in my code and in testbrow.prg doesn't behave as I think it should in that you can drag the slider? bit up and down and nothing happens except if you go right to the bottom you disable the down arrow and the up arrow if you go right to the top. You can still move around OK with mouse clicks on rows and on the up and down arrows (provided the slider isn't right at the top or the bottom) and any of these seems to update the slider accordingly, but the slider doesn't update the browse. It's not really a major issue but some end users are a bit fussy.
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby Antonio Linares » Fri Aug 03, 2007 11:44 am

Doug,

We email you new FiveLinux libraries with the right thumb behavior :-)
regards, saludos

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

Thanks yet again - And some advice needed please

Postby xProgrammer » Fri Aug 03, 2007 12:42 pm

Thanks Antonio

What is the best way of determining which row of a browse the user has selected. oBrw:nRowPos gives which visible row (as per your documentation) but to process selection we need to know which overall row. Do we need to do that by supplying appropriate skip blocks updating a known variable or is there some easier way?

Thanks

Doug (xProgrammer)
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby Antonio Linares » Fri Aug 03, 2007 1:20 pm

Doug,

RecNo()

is that what you mean ?
regards, saludos

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

Thanks

Postby xProgrammer » Sat Aug 04, 2007 1:46 am

In FiveWin I used oBrw:GetPos() as an index into an array which worked for browsing arrays. I hadn't worked out that the record pointer for a file browse was positioned at the highlighted record. Now I know.

Onto browsing arrays.

Thanks.
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby Antonio Linares » Sat Aug 04, 2007 6:46 am

Doug,

Or OrdKeyNo() if you are using an index
regards, saludos

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

Postby Antonio Linares » Sat Aug 04, 2007 6:58 am

Doug,

If it is a single dimensioned array then you can use a standard listbox instead of a browse. Here you have a sample for the Clipper classic AChoice():
Code: Select all  Expand view  RUN
// Using ListBoxes to perform simple selections
#include "FiveLinux.ch"

//----------------------------------------------------------------//

function Main()

   MsgInfo( MsgSelect( { "one", "two", "three" }, "two" ) )

return nil

//----------------------------------------------------------------//

function MsgSelect( aItems, cValue, cTitle )

   local oDlg

   DEFAULT cTitle := "Please, select"

   DEFINE DIALOG oDlg TITLE cTitle SIZE 220, 150

   @  1, 2 LISTBOX cValue ITEMS aItems SIZE 180, 95 OF oDlg

   @ 12, 2 BUTTON "_OK" OF oDlg SIZE 80, 25 ;
       ACTION oDlg:End()

   @ 12, 12 BUTTON "_Cancel" OF oDlg SIZE 80, 25 ;
       ACTION ( cValue := nil, oDlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

return cValue

//----------------------------------------------------------------//

Image
regards, saludos

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

Getting There!

Postby xProgrammer » Sun Aug 05, 2007 2:17 am

Thanks Antonio

Then I can use oLB:nAt - and I can use LISTBOX frequently by combining what would have been separate columns into a single dimension array, for example

LINARES, Antonio

rather than 2 columns.

I can browse arrays fine by writing appropriate code blocks but it appears that if you have more than 1 browse on a window then the vertical scroller only works for the first one.

That shouldn't be a big problem as if I use LISTBOXes wherever posible I will probably only need one BROSE on any dialog.

I note that LISTBOX seems to defaults to item 1 selected but doesn't show that on the screen. I can change the default setting with

oLB:Change(5)

but that isn't shown either.

How can I get it to paint with default selection shown?

Ideally I would like a LISTBOX that initially returned 0 for oLB:nAT - ie no selection has been made.
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby Antonio Linares » Sun Aug 05, 2007 6:06 pm

Doug,

> it appears that if you have more than 1 browse on a window then the vertical scroller only works for the first one.

Fixed. We send you new libs
regards, saludos

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


Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 3 guests