cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ewgoforth
Level 4

List box control doesn't populate

Hi,

I have a listbox on a dialog. At design-time, I've added 3 entries to its items collection. However, when I hit the dialog when running setup.exe I don't see the items.

Do I need to set another property, or do I need to do some installscript to see the elements in my design-time items collection show up at run-time?

I just did some more tests and I'm seeing the same behavior on a Combo box as well.

Thanks,
Eric
Labels (1)
0 Kudos
(6) Replies
hidenori
Level 17

Have you checked the following article?

Populating List Boxes at Run Time
0 Kudos
ewgoforth
Level 4

hidenori wrote:
Have you checked the following article?

Populating List Boxes at Run Time


I saw that article, but didn't read it, since I don't want to populate my listbox at runtime, but rather at design time.

Is it possible to populate at design time, if not what's the Items property on the Listbox and Combobox for?

-Eric
0 Kudos
hidenori
Level 17

If you are authoring InstallScript dialogs, the Items setting does not apply to this type of the dialogs. You need to populate the items through InstallScript code. I filed the work order #IOA-000074184 so that the Items setting will be removed from the project types that use InstallScript dialogs.
0 Kudos
ewgoforth
Level 4

hidenori wrote:
If you are authoring InstallScript dialogs, the Items setting does not apply to this type of the dialogs. You need to populate the items through InstallScript code. I filed the work order #IOA-000074184 so that the Items setting will be removed from the project types that use InstallScript dialogs.


Hidenori,

I'm following the example at http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=installshield19helplib-helplibrary-FAQUIListboxhtm&sliceId=&docTypeID=DT_MACROVISIONHELPNET_1_1&dialogID=135145530&stateId=0%200%20135139770. I'm not clear on how I can control the number that is assigned to each entry in the list, is that possible? How would I know which entry my user picked? Also, how would I internationalize this? With the items collection, each string that I created was associated to a numeric value, this would not be the case when doing it programmatically.

Thanks,
Eric
0 Kudos
ewgoforth
Level 4

Hidori,

I tried just using hard-coded strings for now, like in the example. I have the following snippet now:

    

// control identifiers
#define BUTTON_NEXT 1306
#define BUTTON_BACK 1307
#define COMBO_BOX_ID 1308


prototype NUMBER MyDialogSetup();


function NUMBER MyDialogSetup()
NUMBER nReturn;
NUMBER nControl;
BOOL bDone;
STRING dialogName;
STRING szControl;
STRING szComboBoxVal;
LIST listItem;
STRING szcomboboxcount;
begin
dialogName = "MyDialog"
nReturn = EzDefineDialog(dialogName, ISUSER, "MyDialog", 0);
if(nReturn = DLG_ERR) then
MessageBox("error on exDefineDialog", INFORMATION);
endif;

listItem = ListCreate(STRINGLIST);

ListAddString(listItem, "Entry1", AFTER);
ListAddString(listItem, "Entry2", AFTER);
ListAddString(listItem, "Entry3", AFTER);

Sprintf(szcomboboxcount, "%d", ListCount(listItem));

MessageBox("Combo box count= " + szcomboboxcount, INFORMATION);

CtrlSetList("MyDialog", COMBO_BOX_ID, listItem);



When I enter my dialog, I see a message box that says "Combo box count= 3", but I don't see anything show up in my combobox. I'm thinking that the CtrlSetList isn't working correctly.

-Eric
0 Kudos
RobertDickau
Flexera Alumni

Perhaps see the code on the "CtrlSetList Example" help topic. I seem to remember that you need to call CtrlSetList from inside the DLG_INIT case of your custom dialog processing loop. (And later, call CtrlGetCurSel sometime before you call EndDialog to get what the user selected.)
0 Kudos