Home |
Class PegList HMI (Human-Machine Interface) Classes |
Class PegListPegList is a container class that serves as a base class for PegVertList, PegHorzList, and PegComboBox. PegList positions child objects so that they are stacked left to right or top to bottom. You would not normally create an instance of PegList in your system software, however several of the member functions are important when working with derived PegHorzList, PegVertList, and PegComboBox classes. The LAST child added to the list will be displayed at the leftmost or 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. The position of children added to a list object may be any value, including 0,0, as the list object will reposition objects to fit within the list client area. For vertical lists, child object's widths are also forced to the list client width. Child object height's are not modified, so this value is meaningful when child objects are constructed. Likewise for horizontal lists, while object's heights are forced to fit within the list client area. Child object widths are not modified, and so this value should be set as desired when list children are constructed. class PegList : public PegWindow { public: PegList(const PegRect &Rect, PEGUINT wId = 0, PEGUINT wStyle = FF_THIN); virtual PEGINT Message(const PegMessage &Mesg); virtual void Add(PegThing * What, BOOL bDraw = TRUE); virtual void AddToEnd(PegThing * What, BOOL bDraw = TRUE); virtual PegThing * Remove(PegThing * What, BOOL bDraw = TRUE); virtual PegThing * GetSelected(void); virtual void SetSelected(PegThing * Who); virtual PEGINT GetIndex(PegThing * Of); virtual PEGINT GetSelectedIndex(void); virtual PegThing * SetSelected(int iIndex); virtual PEGINT Clear(void); PegThing * SelectNext(void); PegThing * SelectPrevious(void); PegThing * PageDown(void); PegThing * PageUp(void); void SetSeparation(int iSep); }; Style FlagsFF_NONE, FF_THIN, FF_RAISED, FF_RECESSED, FF_THICK, LS_WRAP_SELECT. SignalsPegList sends PSF_LIST_SELECT signals. pSource has a pointer to the horizontal list container object. iData is the ID of the selected list item. ConstructorThe Rect parameter determines the position and size of the list. The list children are automatically positioned by the list object. Method GetIndexReturns the index of the list item pointed to by Who. If who is not a child of the list, this function return NULL. Method GetSelectedReturns the address of the list child that was last selected. Method GetSelectedIndexReturns the list index of the list child that was last selected. Method MessagePegList catches the PM_SHOW message. Method SelectNextForces the list to advance to the next child item. The list will automatically scroll the newly selected child into view. If LS_WRAP_SELECT is enabled, the list will wrap to the top item if SelectNext() is called when the bottom item is selected. Method SelectPreviousForces the list to back up to the previous child item. The list will automatically scroll the newly selected child into view. If LS_WRAP_SELECT is enabled, the list will wrap to the bottom item if SelectPrevious() is called when the top item is selected. Method SetSelectedForces the last selected member to a certain child under program control. The desired child object is pointed to by Who. Method SetSelectedForces the last selected member to the child item referred to by iIndex. Method ClearDeletes all members from the list. The return value is the number of items removed. Method PageDownThis function scrolls the PegList child items by one full page, meaning that the first non-visible item at the bottom or right of the list client area is scrolled into view and selected. This function returns a pointer to the newly selected item. This function is called by the PegList::Message function in response to the PK_PGDN key message. Method PageUpThis function scrolls the PegList child items by one full page, meaning that the first non-visible item at the top or left of the list client area is scrolled into view and selected. This function returns a pointer to the newly selected item. This function is called by the PegList::Message function in response to the PK_PGUP key message. Method SetSeparationSets the separation amount, in pixels, between child items. The PegList derived class will always position child items such that they are adjacent to each other, and by default there will be no separation between child items. This function can be called after the list is constructed but before the list is displayed to place any amount of space between child items.
|