Entry dialog for a text

Entry dialog for a text

Name Type Default Description
Return int   != 0 Okay, 0 Cancel
str String or char* - When opening, the passed text will be used as the initial text of the entry field of the dialog. After accepting the dialog, the text contains the content of the entry field. In the case of parameter type char * the parameter must be a variable that is large enough to accommodate the expected result.
label String or char* - Short caption of the entry field
title String or char* "Question" Window title
okay String or char* "Okay" Caption of the Okay button
cancel String or char* "Cancel" Caption of the Cancel button
multiline int 1 Is the edit field of the dialog to contain several lines? If the field can contain several lines, the return button will not accept the dialog but insert a new line instead. In this case the dialog may only be ended by a mouse-click.
maxchars int 0 max. input length (str must allocated with at least one more by with 1 byte more for the terminating 0!)

int main ()
    char str[2048];
strcpy (str, "Little Red Riding Hood"); askstring (str, "Fairy story time", "Grimm", "Yes", "No"); return 0; }

String instead of char *

int main()
    String 	str 	= string::alloc("Rötkäppchen");
    String 	label 	= string::alloc("Märchenstunde");
    String 	title 	= string::alloc("Grimmig");
    String 	yes 	= string::alloc("Ja");
    String 	no 		= string::alloc("Nein");
askstring (str, label, title, yes, no);
string::release(str); string::release(label); string::release(title); string::release(yes); string::release(no); }

Parameter multiline from version 1.2 (18. Juni 2005)
Parameter maxchars from version 1.3.4 (R172)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

See Also

Alphabetic index HTML hierarchy of classes or Java