Home |
Class PegHorzList HMI (Human-Machine Interface) Classes |
Class PegHorzListPegHorzList is a container class for displaying a scrolling list of child objects. PegHorzList automatically positions and sizes child objects, and it it therefore not necessary to manually position objects before adding them to PegHorzList. The LAST child 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 receives the PM_SHOW message, which is a system message sent automatically when the list is first displayed. PegHorzList set the height of each child object to fit within the horizontal list client area. The widths of child objects are not modified, and should be set as desired when each child object is constructed. class PegHorzList : public PegList { public: PegHorzList(const PegRect &Rect, PEGUINT wId = 0,PEGUINT wStyle = FF_THIN); }; PegHorzList has the same styles, signals, constructors, and methods as PegList. Demo program PegDemo uses class PegHorzList. ExamplesThe following is a PegHorzList with PegTextButton children: The following example creates a PegHorzList 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, 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); }
|