SilverScreen Solid Modeler

box_prompt

box_prompt

Previous topic Next topic  

box_prompt

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

int box_prompt ( char *message, char *buf, int sort_flag )

 

char *message;        // box_prompt messages

char *buf;            // buffer to receive selection

int   sort_flag;      // enables/disables item sorting

 

 




Synopsis

#include "silver.h"

 

The box_prompt function allows selection of an item from a list of text items. The items are displayed in a box panel. Items are added to the list by previous calls to attach_box_item .

 

 

Parameters

message is a null-terminated string with three components, separated by vertical bars ('|'), as follows:

 

  <text1>|<text2>|<text3>

 

where <text1> is the title of the panel. <text2> is the text that appears beneath the title. "*" specifies that text is not to be displayed beneath the title. <text3> is the prompting message that is to be used for keyboard entry; if this text is "*", no keyboard entry is allowed.

 

buf is a character buffer into which the selected item, if any, will be copied. sort_flag , if non-zero, will cause the items to be sorted alphabetically; otherwise, they will retain the order in which they were received.

 

 

Return Value

If the user successfully selects an item, then the selection is copied into buf , and box_prompt returns 1; otherwise, 0 is returned.

 

 

Comments

The list of items used by box_prompt is freed before it returns.

 

 

See Also

attach_box_item , box_prompt_multiple

 

Example

Two Examples:

C / C++ Code

 

if ( box_prompt ( "Cities|*|Enter city", buf, 1 ) )

 . . .

 

if ( box_prompt ( "Cities|*|*", buf, 0 ) )

 . . .