RPR GetUserInputs

From CockosWiki

Revision as of 09:06, 1 November 2009 by MikeLacey (Talk | contribs)
Jump to: navigation, search

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetUserInputs
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetUserInputs

Contents

bool GetUserInputs(const char* title, int num_inputs, const char* captions_csv, char* retvals_csv, int max_retval_len)

Displays a dialogue box with the specified number of input boxes and their captions. The uesr can enter values in the input boxes and press either OK or Cancel.

Calling this function is easy, interpreting the returned values is a little more difficult.

It doesn't really return just a boolean (true or false) value based on whether the user pressed OK or Cancel. It actually returns an array, the *first element* of which is boolean, the rest of it is the contents of the parameter list - but the captions_csv element of that returned array is what the user types in the boxes - if OK was pressed.

Parameters

const char* title, The title of the dialogue box displayed to the user.
int num_inputs, The number of input boxes in the dialogue box.
const char* captions_csv, Captions for the input boxes.
char* retvals_csv, The default values for the input boxes
int max_retval_len, The overall length of the CSV value returned.

Returns

An array, the elements of which are:
 boolean value, 1 if user pressed ok, 0 if user pressed cancel
 copy of title, 
 copy of num_inputs, 
 copy of captions_csv, 
 modified copy of retvals_csv, THE REAL RETURN VALUE IS IN HERE
 copy of max_retval_len

Examples

Perl

#
# GetUserInput.pl
#

use strict;
use warnings;

use constant TITLE => "GetUserInputs";
use constant NUM_INPUTS => 2;
use constant CAPTIONS_CSV => "Caption 1,Caption 2";
use constant MAX_RETVAL_LEN => 10;

my $retvals_csv = "one,two";

my @response = RPR_GetUserInputs(TITLE, NUM_INPUTS, CAPTIONS_CSV, $retvals_csv, MAX_RETVAL_LEN);

RPR_ShowConsoleMsg("retvals_csv $retvals_csv\n");
RPR_ShowConsoleMsg("\n");
RPR_ShowConsoleMsg("response @response\n");
RPR_ShowConsoleMsg("\n");
RPR_ShowConsoleMsg("response[4] $response[4]\n");
RPR_ShowConsoleMsg("\n");

Python


See Also

Stuff

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetUserInputs
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetUserInputs

Personal tools