Home |
Class PegVertList HMI (Human-Machine Interface) Classes |
Class PegVertListPegVertList is a container class for displaying a scrolling list of child objects. PegVertList automatically positions and sizes child objects, and it it therefore not necessary to manually position objects before adding them to PegVertList. The LAST child 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 receives the PM_SHOW message, which is a system message sent automatically when the list is first displayed. PegVertList forces the width of child objects to the width of the list client area. The height of each child object is not modified, and therefore you should use the correct object height when constructing child objects. class PegVertList : public PegList { public: PegVertList(const PegRect &Rect, PEGUINT wId = 0, PEGUINT wStyle = FF_THIN); }; PegVertList has the same styles, signals, constructors, and methods as PegList. Demo program PegDemo uses class PegVertList. ExamplesThe following is a PegVertList with PegPrompt children: The following example creates a PegVertList and adds several PegBitmapButton children. The bitmaps for the bitmaps buttons can be generated using PegImageConvert. 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); }
|