Jump to content
Developer Wiki and Function Reference Links ×

Returning a PullDownList Value?


Assembly

Recommended Posts

I'm trying to return the value of a PullDownMenu.

I think I'm supposed to use: GetSelectedChoiceInfo(PIODialog,kPIOLIST,0,iReturnValue,gPIOSTRING);

All I seem to get is iReturnValue=0

I tried other functions on the developer page. This should be an easy answer..

How do I get the values back out of the dialog pulldown?

Procedure NewTestPIO;

VAR

hobject:HANDLE;

ObjectName:STRING;

X,y:REAL;

gPIOSTRING:STRING;

PROCEDURE GetPioName;

CONST

kOK = 1;

kCancel = 2;

kPIOLIST = 5;

kRight = 1;

kBottom = 2;

kLeft = 3;

kColumn = 4;

kResize = 0;

kShift = 1;

VAR

PIODialog :INTEGER;

cnt, tmp :INTEGER;

boo :BOOLEAN;

sReturnValue:STRING;

iReturnValue:INTEGER;

FUNCTION GetPlugInString(ndx :INTEGER) :STRING;

BEGIN

{Static Text}

IF ndx = 1001 THEN GetPlugInString := 'OK'

ELSE IF ndx = 1002 THEN GetPlugInString := 'Cancel'

ELSE IF ndx = 1003 THEN GetPlugInString := 'Create Pio'

ELSE IF ndx = 1005 THEN GetPlugInString := ''

; {Help Text}

IF ndx = 2001 THEN GetPlugInString := 'Insert the PIO'

ELSE IF ndx = 2002 THEN GetPlugInString := '

'

ELSE IF ndx = 2005 THEN GetPlugInString := 'Help text.'

;END;

FUNCTION GetStr(ndx :INTEGER) :STRING;

BEGIN

GetStr := GetPlugInString(ndx + 1000);

END;

FUNCTION GetHelpStr(ndx :INTEGER) :STRING;

BEGIN

GetHelpStr := GetPlugInString(ndx + 2000);

END;

PROCEDURE dialog_Handler(VAR item :LONGINT; data :LONGINT);

BEGIN

CASE item OF

SetupDialogC: BEGIN

AddChoice( PIODialog, kPIOLIST, 'Keynote2011V2', 0 );

AddChoice( PIODialog, kPIOLIST, 'TimberWindow3D', 1 );

AddChoice( PIODialog, kPIOLIST, 'PlaceIt', 2 );

END;

END;

END;

BEGIN

PIODialog := CreateResizableLayout(GetStr(3), TRUE, GetStr(kOK), GetStr(kCancel), FALSE, TRUE );

{create controls}

CreatePulldownMenu( PIODialog, kPIOLIST, 45);

{set relations}

SetFirstLayoutItem( PIODialog, kPIOLIST );

{set alignments}

{set bindings}

{set help strings}

FOR cnt := 1 TO 5 DO SetHelpText(PIODialog, cnt, GetHelpStr(cnt));

{run PIODialog}

IF RunLayoutDialog( PIODialog, dialog_Handler ) = 1 then

BEGIN

GetSelectedChoiceInfo(PIODialog, kPIOLIST,0,iReturnValue,gPIOSTRING);

AlrtDialog(Concat(iReturnValue));

END;

END;

BEGIN;

GetPioName;

END;

Run(NewTestPIO);

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...