List Browsers

From Vectorlab
Jump to: navigation, search
This vcor page needs language cleanup.

If you wish to help, clean up the page, then remove me deleting the line "{{Language cleanup}}". In the category:Language cleanup you'll find a list of all pages marked for cleanup.

List Browsers dissected. By Orso B. Schmid

List Browsers allow for great layout, advanced data management, but also amazing layout features within the single cells. Is not difficult to load them with some text data and make them display a whatever list. Still the advanced settings of List Browsers are quite enigmatic. After years of trial and error, I attempt here to resume what I discovered. If you find an error, I'd be glad to be informed. I am a user and had no reference literature for this article which is based on pure experience, if you are a programmer you will probably find the terms employed not quite the right ones.

Like me, there must be many others who explored extensively List Browsers. Please share your knowledge. Let me know what you know.

Since List Browsers are so complex, the best way to learn how to use them is to have some free code available for experiments. Free code for List Browsers can be counted on one hand and none of the snippets available tells you a single thing about Control Types, Edit Display Types, Item Display Types, Column Data Items and so on. Use the example Dialog with List Browser. It should help experiencing the different List Browser display according to the available options.

This article has been written using VW 13 for compatibility reason. Whenever routines of VW 14 are used, this is mentioned.

For those wishing to deepen the topic: see NSTableView Class (for the MacOs environment).

You'll find a large amount of sub-routines for List Browsers in the category Subroutines - List Browsers.

List Browsers

The display of List Browsers is determined by the right combination of four settings: Control Type, Display Type, cell's Column Owner and Column Data Items. This is all -pardon my French- bloody difficult, mostly because it is not documented. It resembles a 4D-puzzle.

List Browsers are more than tables of cells, they browse lists. You must imagine them like special containers with built-in lists of data which can be created and used on need. These lists have different validity scope:

List of icons
available to the whole List Browser. Items are added with AddListBrowserImage.
Column Data Items
available to one column. Items are added with InsertLBColumnDataItem. Column Data Items will often use images from the List Browser's Image list, but they can also contain only strings.

Then List Browsers use special modifiers for changing display and content through the container -lets call it so- Column. You can -but don't have to- define special behaviors for each singular column. For this you use two settings:

Control Types
determine HOW the cells inside are meant to be displayed. Columns have seven ways of handling data in their cells and user's response. They are called Control Types.
Display Types
determine WHICH DATA the cells inside are meant to display. There are three display types: Text, Image plus the combination of both called: Text and Image. And there are two Display Types: Item Display and Edit Display. Control Types respond to the one or the other indifferently as of VW 2017.

Last, there are the Cells which can also be specialized in displaying various types of data through:

Column Owners
determine WHAT a cell should display. There are nine owner types ranging from generic text and icons up to resource attributes like pen styles, colors or thumbnails. Don't let yourself be misled by the word "column" in "Column Owners", this is a cell property.

Column Data Items List Browser set up
Resource icons, Strings
For each column:
For each row loop down all columns
and set for each cell:
Column Cell
Control Type

display HOW

Edit/Item Display Type

display WHICH DATA

Column Owner Type

display WHAT

  1. Static
  2. Radio
  3. Multi State
  4. Single Instance Icon
  5. Static icon
  6. Number
  7. Multiple Icons
  1. Image
  2. Text only
  3. Image and Text
0. None
  1. Solid rect
  2. Dual solid rect
  3. Pattern rect
  4. Dual pattern rect
  5. Gradient or image
  6. Blank
  7. Text
  8. Dashed line
Example Script

In the Dialog with List Browser we create a List Browser with:

Then there are

You are meant to change the values in the pop-up menus Item Display and Edit Display and click around the List Browsers to see what happens. Then experiment with the other available options.

"Pattern" and "Dual pattern" don't work before VW 2010.

Introduction Part 1: Creation and columns Part 2: Rows and cells