Page 1 of 1
Function of Vertical ScrollBar of Browse object
Posted: Fri Aug 03, 2007 7:00 am
by xProgrammer
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.
Posted: Fri Aug 03, 2007 11:44 am
by Antonio Linares
Doug,
We email you new FiveLinux libraries with the right thumb behavior
Thanks yet again - And some advice needed please
Posted: Fri Aug 03, 2007 12:42 pm
by xProgrammer
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)
Posted: Fri Aug 03, 2007 1:20 pm
by Antonio Linares
Doug,
RecNo()
is that what you mean ?
Thanks
Posted: Sat Aug 04, 2007 1:46 am
by xProgrammer
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.
Posted: Sat Aug 04, 2007 6:46 am
by Antonio Linares
Doug,
Or OrdKeyNo() if you are using an index
Posted: Sat Aug 04, 2007 6:58 am
by Antonio Linares
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
// 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
//----------------------------------------------------------------//
Getting There!
Posted: Sun Aug 05, 2007 2:17 am
by xProgrammer
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.
Posted: Sun Aug 05, 2007 6:06 pm
by Antonio Linares
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