Is a vertical ListBox possible?

Hey Clarion folk
Is it possible to create a listbox or browse that will display vertically?
By that I mean having the fields in a column on the left and the data for each record in a column rather than a row.

Cheers
Marc

I guess you mean horizontal.

Not really. I’ve done color swatch kinds of things that flow with the columns, but a Clarion listbox doesn’t do anything like that out of the box.

You could probably finagle that behavior with a VLB, but it would be a bit of work.

There’s no native support but maybe you could get close.

How many fields are in your file that you want to see? I.e. the number of Rows.

How many records in the file? How many would you want to see on the window? I.e. the number of Columns.

A Column can be a [Group] and contain multiple rows of fields using Last On Line so have all the fields in 1 record defined in 1 column. Then you replicate that [Group] multiple times by manipulating the Format string directly.

Another way would be to have each row have the same column. I.e. a file with 7 fields would have 7 tired. List Styles could be used to format each cell.

You could post a screen capture of the Form showing all the fields to give us an idea of what the data looks like.

I was looking at my code, and it’s really not that hard to fill horizontally. All I’m doing in my listbox is showing colors in the cells though.

This is an example of how the listbox looks.

image

3 Likes

This is a listbox too, using the same class.

image

3 Likes


Hi Carl
I have attached a mock up which my BA put together.
For whichever record is highlighted in the box on the left I need to show the corresponding records on the right. Because of the amount of fields to be shown it makes sense to try to fit it in this way rather than displaying it across the screen.
Any thoughts would be helpful.
Marc

So the left list box could be a browse. I dont know what your database file relationships are like, but the browse grid might work for you with little effort for the right hand pane layout.

There should be an example app showing the Clarion BrowseGrid with Dynamic Image, but I’d just drop the images as you dont show any in the example.

Your data would suggest this place might be involved.
NZ Forest Products Ltd, Kinleith, Sou… | Items | National Library of New Zealand | National Library of New Zealand (natlib.govt.nz)

This sure looks like a browse with an adjacent browse of child records

Except that the records in the second list are running top to bottom instead of left to right.

Marc Brierley
Trimble Forestry
+64212855568

Is the right hand list going to scroll off to the right like a spreadsheet, with the first column showing the fields staying fixed, or is this right hand list only ever going to show 5 sites?

I would still stick with using the clarion list box, but I’d probably be looking to extend the abc browse class to pivot, for want of a better word, or rotate, the column headers into column 1 and then each row into its own column

Typical Browse Box

Surname Col1    Firstname Col2     Fields Col3
Smith           John               PersonID
Michael         Schumacher         AnotherPersonID

Filter to restrict row count to say upto 5 and then extra class methods to rotate the fields.

Fields Col3           PersonID              AnotherPersonID
Firstname Col2        John                  Michael
Surname Col3          Smith                 Schumacher 

There is a few ways to tackle this.
I’d probably create a separate Q in the browse class and then transpose the fields and column headers into the separate Q and then use that to populate the list box, taking into account the extra fields used for formatting each cell, like background colour, font size etc etc.

Maybe deriving the browse class would be safer.

I dont know if anyone has written such a class, but thats how I’d approach to begin with or something along those lines.

Potentially the field list and the first and second columns will need to be fixed with the rest scrolling as there could be several columns to be shown.

Marc Brierley
Trimble Forestry
+64212855568

Hi,

Put each field name into a local variable.
Build your list box by taking all your local variables into one group and the contents into a second group.
Mark each content field as ‚last in line‘.

Remove all headers.

The number of rows for each dataset must not exceed the size of the list box. Otherwise the box remains empty.

I would love to add screen shots but I am ill with Covid and too weak to start my computer.

Kind regards,

Volker

It is doable with hand coding, it could be using listbox control associated with a Queue if maximum columns is predictable or with VLB technique.

On the other hand, see the Browse Grid examples included in Clarion: Examples\How to ABC\BrGrid , there is a Customer vertical browse and a Products horizontal browse (although it is navigable with Up and Down arrow), it may fit your needs too and avoid hand coding.

Thanks to everyone for your ideas.
I have added a BrowseGrid to a window containing an existing BrowseBox (picture attached).
However when I build and then open the application, the screen is blank apart from the buttons.
Can anyone tell me what I have missed? Maybe some configuration that needs to be set.
Marc

Scratch that. I now see that I have to use text boxes inside of the BrowseGrid.
I am confused however…
I assumed that this sort of set up with a prop and text box would produce something but the screen is again blank.