Function of Vertical ScrollBar of Browse object
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Function of Vertical ScrollBar of Browse object
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.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Thanks yet again - And some advice needed please
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)
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)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Thanks
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.
Onto browsing arrays.
Thanks.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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():
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
//----------------------------------------------------------------//
- xProgrammer
- Posts: 464
- Joined: Tue May 16, 2006 7:47 am
- Location: Australia
Getting There!
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.
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.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: