Assembly Posted August 31, 2012 Share Posted August 31, 2012 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); Quote Link to comment
JBenghiat Posted August 31, 2012 Share Posted August 31, 2012 GetSelectedChoiceInfo (or getting any dialog value) needs to be part of the dialog handler. Use global variables (declared in the very top VAR statement) to use values in the main part of your script. -Josh Quote Link to comment
Assembly Posted August 31, 2012 Author Share Posted August 31, 2012 thanks Josh. Quote Link to comment
Recommended Posts
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.