Jump to content
Developer Wiki and Function Reference Links ×

Populate AddChoiceItem list


WhoCanDo

Recommended Posts

I've search this forum and could not find any postings for AddChoiceItem

I have created a dialog box and used

AddChoiceItem('Standard Angle',4,1,120,12,300,28);

which works well but I can't get AddChoiceItem populated.

Help suggests using

InsertChoice(3,1,'30 x 30 x 5');

but I get a VW error "dialog not found"

Any suggestions would be appreciated.

Link to comment

The ItemID has to be the same on both procedure calls. The itemID is assigned by you for each control in the dialog.

PROCEDURE AddChoiceItem(choiceTitle :STRING; itemID, choiceType, x1, y1, x2, y2 :INTEGER);

PROCEDURE InsertChoice(itemID, before :INTEGER; choice :STRING);

I also noticed that AddChoiceItem does not have a dialog ID to associate with the dialog and consequently, that may be the reason for the error. If you want a pulldown menu use:

PROCEDURE CreatePullDownMenu(dialogID, itemID, widthInCharacters :LONGINT; );

You can find custom dialog examples at this site:

Vectorscript examples

Link to comment

I've got it ! The InsertChoice populates the AddChoiceItem list after the dialog is open.

Here's the basics .....

BeginDialog(1,.....

AddChoiceItem(What the hell,4,......

EndDialog;

GetDialog(1);

InsertChoice(4,LineNo,Text);

repeat

DialogEvent(Item);

case (Item) of

1 : {OK} GetSelChoice(4,0,......

etc.

"What the hell" is the "Choice Title" but does not appear to be used for anything except testing your typing skills.

Hope this helps other searches in the future.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...