KwikPeg Manuals
Home
PegVertList
Examples
Examples
Index
Index


Members
Styles
Signals
Overview Derived from class PegList

The PegVertList class provides a container for a list of objects to be displayed vertically.

The last child object added to the list will be displayed at the topmost position in the list if the Add() function is used to add children. The order of display can be reversed by using the function AddToEnd() to add children to the list.

Child objects are positioned when the list is first displayed. When an object is added to the list, the position information provided with the call to Add() (or AddToEnd()) is ignored. The object will be positioned to fit within the client area of the PegVertList object to which it is added.

For vertical lists, the width of a child object is forced to match the width of the client area of the PegVertList object to which it has been added. The child object's height is not modified.



 See Also

PegHorzList

PegWindow



 Styles

The PegVertList class supports the following style flags:

FF_NONE No frame.
FF_THIN Thin frame.
FF_THICK Thick 3D frame.
FF_RAISED Raised 3D frame.
FF_RECESSED Recessed 3D frame.
LS_WRAP_SELECT  Wrap selection of items managed by a PegList object or its derivatives. Selection of the previous item on the list will wrap from the head of the list to the last item on the list. Selection of the next item on the list will wrap from the end of the list to the head of the list.

Note that scrolling of the list of objects within a PegVertList object is enabled using the SetScrollMode() function, as for all windows derived from the PegWindow class.



 Signals

The PegVertList class generates the following signals:

PSF_LIST_SELECT Sent by PegList derived objects (including PegHorzList, PegVertList and PegComboBox) when list item is selected.
 
A PSF_LIST_SELECT signal is sent to the parent of a PegVertList object if, and only if, both the vertical list object AND the child object in the list have a non-zero object ID.
 
The signal message contains the following information:
 
Message.lData  Not used.
Message.iData  Object ID of the selected list item.
Message.pSource  Pointer to the PegVertList object.
 

Top of page


 Members

Constructors:

PegVertList(const PegRect &Rect,
  WORD wId = 0,
  WORD wStyle = FF_THIN)

This constructor creates a PegVertList object at a specific location within a rectangle specified by parameter Rect. Objects added to the list are automatically positioned vertically, one above the other, within this rectangle.

 

Public Functions:

Objects are added and removed from the list using member functions of the PegThing class, the base class from which most KwikPeg objects object are derived.

Specific objects on the list can be manipulated using member functions of the PegList class from which the PegVertList object is derived.


Top of page


 Examples

The following example illustrates a PegVertList object with PegPrompt children:



The following code fragment creates a PegVertList object and adds several PegBitmapButton objects to the vertical list. The PegBitmap images for the bitmaps on the buttons can be generated by the PEG Image Converter from separate image files. A vertical scroll bar is added to the list window. The vertical list is added to the current window.

extern PegBitmap gbThunderBitmap;
extern PegBitmap gbLightBitmap;
extern PegBitmap gbSateliteBitmap;
extern PegBitmap gbDynamiteBitmap;
extern PegBitmap gbAppleBitmap;

void MyWindow::AddHList(void)
{
    PegRect ListRect;
    ListRect.Set(10, 10, 80, 180);

    PegVertList *pList = new PegVertList(ListRect);

    pList->Add(new PegBitmapButton(0, 0,
        &gbThunderBitmap));
    pList->Add(new PegBitmapButton(0, 0,
        &gbLightBitmap));
    pList->Add(new PegBitmapButton(0, 0,
        &gbSateliteBitmap));
    pList->Add(new PegBitmapButton(0, 0,
        &gbDynamiteBitmap));
    pList->Add(new PegBitmapButton(0, 0,
        &gbAppleBitmap));

    pList->SetScrollMode(WSM_VSCROLL);
    Add(pList);
}



Top of page
KwikPeg Manuals
Home
Index
Index

 
Copyright © 2000-2003