Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>@ id ... blistbox</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
@ ID ... BLISTBOX
Use a browse control in a dialog
------------------------------------------------------------------------------

Syntax
#include "windows.ch"
#include "topclass.ch"   --or--   #define  NO_C4WCLASS
#include "commands.ch"
@ ID  <nId>  BLISTBOX
     COLUMNS <aCols>
     [ GOTOPBLOCK <bGoTop> ]
     [ GOBOTTOMBLOCK <bGoBottom> ]
     [ SKIPBLOCK <bSkip> ]
     [ ALIAS <cAlias> ]
     [ FONT <hBFont> ]
     [ UPDATEBLOCKS <aUpdate> ]
     [ AUTOGOTOP <lGoTop> ]
     [ <clauses> ]

Arguments
COLUMNS <aCols> is an array with a sub-array for each column:
     {  <aCol1>, ... <aColN>  }
where each <aCol> is:
     {  <cHeading>, <bBlock> , [ <cPicture> ] , [ <bFGcolor> ] ,
        [ <bBGcolor> ] , [ <nAlign> ] , [ <nWidth> ] , [ <nBitmap> ] ,
        [ <nBitAlign> ] , [ <HeadBlock> ] , [ <cargo> ]  }

<cHeading> is a string, or an array of strings, for the column
heading.

<bBlock> is a code block which fetches data for the column.

<cPicture> is an optional picture, suitable for the TRANSFORM()
function.

<bFGcolor> is an optional code block that returns a Windows
RGB() value for the foreground color.

<bBGcolor> is an optional code block that returns a Windows
RGB() value for the background color.

<nAlign> is an optional value specifying the column alignment
(one of DT_LEFT, DT_CENTER, DT_RIGHT, defined in WINDOWS.CH).

<nWidth> is an optional column width in pixels.

<nBitmap> is an optional bitmap id for the column heading
(must be a resource).

<nBitAlign> is an optional value specifying the bitmap
alignment (one of DT_LEFT, DT_CENTER, DT_RIGHT, defined in
WINDOWS.CH).

<HeadBlock> is an optional code block to be evaluated if the
user clicks on the column heading.

<cargo> is an optional value.

GOTOPBLOCK <bGoTop> optionally specifies a code block.

GOBOTTOMBLOCK <bGoBottom> optionally specifies a code block.

SKIPBLOCK <bSkip> optionally specifies a code block.

ALIAS <cAlias> optionally specifies the alias.

FONT <hBFont> optionally specifies the font.

UPDATEBLOCKS <aUpdate> optionally specifies an array of code
blocks for updating controls in the dialog.

AUTOGOTOP <lGoTop> optionally specifies, if .F., that the
:goTop() method is not to be performed automatically - so the
browse will not be visible until you do a :goTop()
explicitly.

For a lot more detail, consult the WBROWSES.HLP file.

See the generic @ ID ... <ControlType> command for details of
the other <clauses> and/or parameters allowed.

Description
This command uses the WBListBox class to put a browse into a
dialog.  You must define a list box at the position to be
used, using the styles:
     LBS_NOTIFY
     LBS_OWNERDRAWVARIABLE
     LBS_NOINTEGRALHEIGHT
     WS_CHILD
     WS_VISIBLE
     WS_TABSTOP

For a lot more detail, consult the WBROWSES.HLP file.

See the generic @ ID ... <ControlType> command for more
information.

Example
// From SOURCE\OO\ODBCBROW.PRG:
local     aCols :=                                   ;
{                                                    ;
     {"CourseID",    {|| ::oTable:FieldGet(1) } },   ;
     {"CourseTitle", {|| ::oTable:FieldGet(2) } }    ;
}

@ Id IDD_BROWSE  Obj ::oB  BListBox                  ;
     Columns aCols                                   ;
     GoBottomBlock {|| ::oTable:GoBottom() }         ;
     GoTopBlock    {|| ::oTable:GoTop() }            ;
     SkipBlock     {|oB, n| DoSkip(oB, ::oTable, n) }


See Also: @ ID ...

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson