Class XbpColumn() Foundation

Class function of the XbpColumn class


Instances of the XbpColumn class are used together with XbpBrowse objects to display tables in graphic mode. The creation of a GUI browser starts with an XbpBrowse object to which XbpColumn objects are attached or inserted. One XbpColumn object displays data of one table column.

XbpColumn objects consist of three distinct areas, each of which can be configured in detail: heading, data area, and footing. Configuration of these areas is accomplished using presentation parameters, which are specified as a two-column array. This array must be passed to either method :new() or :create(). Presentation parameters for columns can be specified already for the XbpBrowse object that is to contain XbpColumn objects. In this case, the presentation parameters are valid for all XbpColumn objects subsequently attached to the XbpBrowse object with the :addColumn() method.

To enable an XbpColumn object to display data of a table column, a data code block must be assigned to its instance variable :dataLink. The return value of this code block is displayed in the data area of the object. Data can be displayed in different visual representation, such as literal, bitmap or icon. The instance variable :type of an XbpColumn object determines how data is displayed.

Class methods
Creates instances of the XbpColumn class.

The instance variables in this group configure system resources. If changes are made to these values, they must either be made before the :create() method is executed or the :configure() method must be used to activate the changes.

Depending on column type, the data code block stored in :dataLinkmust return corresponding data:


The default value of :type (XBPCOL_TYPE_TEXT) is used to display data stored in a database or an array. In this case, :dataLinkaccesses a variable and returns its value.


When the constants XBPCOL_TYPE_BITMAP or XBPCOL_TYPE_ICON are specified, :dataLink must return the numeric resource ID of a bitmap or icon. Either must be linked as a resource to the EXE. Alternatively, :dataLink may return an object of the XbpBitmap or XbpIcon classes. This allows to display images loaded from disk, for example. Furthermore, if a transparent color has been defined for the bitmap object, transparent areas within the bitmap are automatically replaced with the background color defined for the individual cells in the column.

If the :dataLink code block returns XbpBitmap or XbpIcon objects, either :load() or :loadFile() must have been called previously. For bitmaps created in memory, method :make() must have been called. Furthermore, reusing the same bitmap or icon object to load a different image is discouraged as long as the object is used as the value for a cell. Instead, a new bitmap or icon object should be returned for each individual image loaded from disk.


With XBPCOL_TYPE_SYSICON, :dataLink must return a constant prefixed with XBPSTATIC_SYSICON_. These constants are defined in XBP.CH.


An XbpColumn object displays file names as symbols when either constant XBPCOL_TYPE_FILEICON or XBPCOL_TYPE_FILEMINIICON defines the column type. The :dataLink code block must return a fully-qualified file name including drive and path as character string.

Changes the color of cells depending on displayed data.
Contains the data code block of a column.
Specifies the drawing mode of the XbpColumn object.
Defines how data is displayed by an XbpColumn object.
Object displaying the data area of the column.
Contains the display position of the column.
Object displaying the footing of the column.
Object displaying the heading of the column.
Contains the ordinal number of the column.
Contains the PICTURE format for formatted display.
The data type of the displayed values.
Life cycle
Requests system resources for the XbpColumn object.
Reconfigures the XbpColumn object after :create() has been executed.
Releases the system resources of the XbpColumn object.
Display methods
Refreshes a single row in the data area of the column.
Retrieves the value displayed in a row of the data area.
Displays a row of the data area in normal or highlight color.
Refreshes one or more rows in the data area of the column.
Determines the number of rows displayed in the data area of the column.
Scrolls rows in the data area upwards and refreshes the rows at the bottom.
Scrolls rows in the data area downwards and refreshes the rows at the top.
Configure a table column of a graphic browser

// This example demonstrates how to configure a single XbpColumn 
// object using presentation parameters before it is attached 
// to an XbpBrowse object with :addColumn(). 

aPresParam := { ; 
   { XBP_PP_COL_HA_CAPTION     , "Name"                     }, ; 
   { XBP_PP_COL_DA_FGCLR       , GRA_CLR_BLACK              }, ; 
   { XBP_PP_COL_DA_BGCLR       , GRA_CLR_WHITE              }, ; 
   { XBP_PP_COL_DA_HILITE_FGCLR, GRA_CLR_WHITE              }, ; 

oXbpColumn          := XbpColumn():new(,,,,aPresParam) 
oXbpColumn:dataLink := {|| CUSTOMER->NAME } 

oXbpBrowse:addColumn( oXbpColumn ) 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.