PSF_KEY_RECEIVED
PSF_LIST_SELECT
PegComboBox is similar to (and derived from) PegVList. PegComboBox adds the
concept of "Opening and Closing", which can conserve space when a large number of
items are added to the combo box. A drop-down arrow is provided to open the combo
box. The box closes when an item is selected or the combo box loses focus.
PegComboBox will send the signal PSF_LIST_SELECT to the parent window if the
PegComboBox has a non-zero ID value and the selected child also has a non-zero ID
value.
The following example creates a PegComboBox and populates it:
PegRect ListRect;
ListRect.Set(2, 2, 90, 150);
PegComboBox *pList = new PegComboBox(ListRect);
for (int iLoop = 20; iLoop > 0; iLoop--)
{
CP_CHAR cTemp[20];
CP_StringCopy(cTemp, (CP_CHAR*)"Select ");
CP_CHAR nTemp[10];
CP_IntToString(iLoop, nTemp);
CP_StringCat(cTemp, nTemp);
pList->Add(new PegPrompt(0, 0, (PEGCHAR*)cTemp, iLoop,
FF_NONE|TJ_LEFT|AF_ENABLED|TT_COPY));
}
pList->SetScrollMode(WSM_VSCROLL);
pList->SetSelected(5);
AddR(pList);
The result of this code is:
79