I had a window with 7 OPTION controls where we needed to make it smaller so decided to change those to Drop Lists. Instead of the tedious hand conversion I created a small procedure to read the PROPs and generate the LIST FROM() based on the RADIO Text and Value. Just add a Button and call Option2DropList().
Here’s a test Window from the GIST with 4 Options. Below that is the LIST conversion. There was no editting.
The OPTION’s and RADIO’s:
OPTION('Report Sequence'),AT(3,4,139,26),USE(GLO:PrintRptSequence),BOXED
RADIO('Employee'),AT(9,15),USE(?PrintContractSequence:Radio1),VALUE('E')
RADIO('Acct. No.'),AT(55,15,42),USE(?PrintContractSequence:Radio2),VALUE('A')
RADIO('Dist. Cd.'),AT(98,15,40),USE(?PrintContractSequence:Radio2:2),VALUE('D')
END
OPTION('Contract Year'),AT(156,4,101,26),USE(GLO:ContractYearWanted),BOXED
RADIO('This Year'),AT(160,15,43,10),USE(?ContractYearWanted:Radio1),VALUE('C')
RADIO('Next Year'),AT(208,15,45,10),USE(?ContractYearWanted:Radio2),VALUE('N')
END
OPTION('Contract Status'),AT(275,4,149,26),USE(GLO:ContractStatusWanted),BOXED,TIP('Select "' & |
'Active" for Automatic and Manual Contracts')
RADIO('All'),AT(279,15,25,10),USE(?ContractStatus:Radio1)
RADIO('Active'),AT(303,15,32,10),USE(?ContractStatus:Radio2)
RADIO('Manual'),AT(338,15,36,10),USE(?ContractStatus:Radio4)
RADIO('Inactive'),AT(378,15,41,10),USE(?ContractStatus:Radio3)
END
OPTION('Contract Expiration'),AT(441,4,131,26),USE(ExpiredStatus),BOXED
RADIO('Expired'),AT(445,15,37,10),USE(?ExpendedStatus:Radio1),VALUE('E')
RADIO('Unexpired'),AT(489,15,44,10),USE(?ExpendedStatus:Radio2),VALUE('U')
RADIO('Both'),AT(541,15,27),USE(?ExpendedStatus:Radio3),VALUE('B')
END
Code generated for LIST with PROMPT(‘Option text’). The AT() are calculated pretty well. The FROM is built by reading the RADIO Prop:Text and Prop:Value. The #ORDINAL is optional. Get it right and you connect the new LIST to the existing Option Embed code.
!------------------------------------------------------------------------------
!Warning: #Oridinal() set to FEQ. If WRONG you will link to the WRONG Embeds and messs things up !!!
!---------------------------------------------------------------------- FEQ # 2 -----
PROMPT('Report Sequence'),AT(6,4),USE(?GLO:PRINTRPTSEQUENCE:Prompt),TRN
LIST,AT(6,15,54,11),USE(GLO:PRINTRPTSEQUENCE),VSCROLL,DROP(9), |
FROM('Employee|#E|Acct. No.|#A|Dist. Cd.|#D'), |
#ORDINAL( 2 )
!---------------------------------------------------------------------- FEQ # 6 -----
PROMPT('Contract Year'),AT(159,4),USE(?GLO:CONTRACTYEARWANTED:Prompt),TRN
LIST,AT(159,15,53,11),USE(GLO:CONTRACTYEARWANTED),VSCROLL,DROP(9), |
FROM('This Year|#C|Next Year|#N'), |
#ORDINAL( 6 )
!---------------------------------------------------------------------- FEQ # 9 -----
PROMPT('Contract Status'),AT(278,4),USE(?GLO:CONTRACTSTATUSWANTED:Prompt),TRN
LIST,AT(278,15,49,11),USE(GLO:CONTRACTSTATUSWANTED),VSCROLL,DROP(9), |
FROM('All|#All|Active|#Active|Manual|#Manual|Inactive|#Inactive'), |
TIP('Select "Active" for Automatic and Manual Contracts'), |
#ORDINAL( 9 )
!---------------------------------------------------------------------- FEQ # 14 -----
PROMPT('Contract Expiration'),AT(444,4),USE(?EXPIREDSTATUS:Prompt),TRN
LIST,AT(444,15,52,11),USE(EXPIREDSTATUS),VSCROLL,DROP(9), |
FROM('Expired|#E|Unexpired|#U|Both|#B'), |
#ORDINAL( 14 )
I think Option and Radio are easier to use because you can see all choices and pick them easily, but we needed the space. Also having a lot of RADIO’s can look cluttered.