KwikPeg Manuals
Home
PegHorzList
Examples
Examples
Index
Index


Members
Styles
Signals
Overview Derived from class PegList

The PegHorzList class provides a container for a list of objects to be displayed horizontally.

The last child object added to the list will be displayed at the leftmost 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 PegHorzList object to which it is added.

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



 See Also

PegVertList

PegWindow



 Styles

The PegHorzList 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 PegHorzList object is enabled using the SetScrollMode() function, as for all windows derived from the PegWindow class.



 Signals

The PegHorzList 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 PegHorzList object if, and only if, both the horizontal 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 PegHorzList object.
 

Top of page


 Members

Constructors:

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

This constructor creates a PegHorzList object at a specific location within a rectangle specified by parameter Rect. Objects added to the list are automatically positioned horizontally, next to each 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 PegHorzList object is derived.


Top of page


 Examples

The following example illustrates a PegHorzList object with PegTextButton children:



The following code fragment creates a PegHorzList object and adds several PegBitmapButton objects to the horizontal list. The PegBitmap images for the bitmaps on the buttons can be generated by the PEG Image Converter from separate image files. A horizontal scroll bar is added to the list window. The horizontal 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, 180, 44);

    PegHorzList *pList = new PegHorzList(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_HSCROLL);
    Add(pList);
}



Top of page
KwikPeg Manuals
Home
Index
Index

 
Copyright © 2000-2003