Sponsors
Search
Link to our site
Learning Resources
:pnlgrp. :copyr.Example of F23=More options. Public Domain by Simon Coulter. :class name=optCL basetype='action' width=2. :eclass. :class name=columnCL basetype='char 10'. :eclass. :class name=bin15CL basetype='bin 15'. :eclass. :var name=option class=optCL. :var name=column1 class=columnCL. :var name=column2 class=columnCL. :var name=column3 class=columnCL. :var name=column4 class=columnCL. :var name=column5 class=columnCL. :var name=optRow class=bin15CL. :varrcd name=varpool vars='optRow'. :varrcd name=record1 vars='option column1 column2 column3 column4 column5'. :listdef name=list vars='option column1 column2 column3 column4 column5'. :cond name=Brow1 expr='(optRow=1)'. :cond name=Brow2 expr='(optRow=2)'. :cond name=Brow3 expr='(optRow=3)'. :cond name=Brow4 expr='(optRow=4)'. :cond name=Brow5 expr='(optRow=5)'. :tt name=shwOptRow conds='Brow1 Brow2 Brow3 Brow4 Brow5'. :ttrow values=' 1 0 0 0 0'. :ttrow values=' 0 1 0 0 0'. :ttrow values=' 0 0 1 0 0'. :ttrow values=' 0 0 0 1 0'. :ttrow values=' 0 0 0 0 1'. :ett. :keyl name=keys. :keyi key=f1 action=help help=nohelpatall . :keyi key=f3 action=exit varupd=no help=nohelpatall .F3=Exit :keyi key=f5 action='return 105' varupd=no help=nohelpatall .F5=Refresh :keyi key=f12 action=cancel varupd=no help=nohelpatall .F12=Cancel :keyi key=f23 action='return 123' varupd=no help=nohelpatall .F23=More options :keyi key=f24 action=morekeys varupd=no help=nohelpatall .More keys :keyi key=enter action=enter help=nohelpatall . :keyi key=help action=help help=nohelpatall . :keyi key=pagedown action=pagedown help=nohelpatall . :keyi key=pageup action=pageup help=nohelpatall . :keyi key=print action=print help=nohelpatall . :ekeyl. :panel name=example keyl=keys tt=shwOptRow help=nohelpatall .Example :list depth='*' listdef=list maxhead=1 maxactl=1 actor=uim. :topinst.Type options, press Enter. .* First row of options ... :listact option=1 cond=Brow1 enter='CMD SNDMSG MSG(''Option 1 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .1=Something :listact option=1 enter='CMD SNDMSG MSG(''Option 1 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=2 cond=Brow1 enter='CMD SNDMSG MSG(''Option 2 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .2=Something :listact option=2 enter='CMD SNDMSG MSG(''Option 2 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=3 cond=Brow1 enter='CMD SNDMSG MSG(''Option 3 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .3=Something :listact option=3 enter='CMD SNDMSG MSG(''Option 3 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=4 cond=Brow1 enter='CMD SNDMSG MSG(''Option 4 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .4=Something :listact option=4 enter='CMD SNDMSG MSG(''Option 4 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=5 cond=Brow1 enter='CMD SNDMSG MSG(''Option 5 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .5=Something... :listact option=5 enter='CMD SNDMSG MSG(''Option 5 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . .* Second row of options ... :listact option=6 cond=Brow2 enter='CMD SNDMSG MSG(''Option 6 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .6=Something :listact option=6 enter='CMD SNDMSG MSG(''Option 6 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=7 cond=Brow2 enter='CMD SNDMSG MSG(''Option 7 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .7=Something :listact option=7 enter='CMD SNDMSG MSG(''Option 7 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=8 cond=Brow2 enter='CMD SNDMSG MSG(''Option 8 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .8=Something :listact option=8 enter='CMD SNDMSG MSG(''Option 8 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=9 cond=Brow2 enter='CMD SNDMSG MSG(''Option 9 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .9=Something... :listact option=9 enter='CMD SNDMSG MSG(''Option 9 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . .* Third row of options ... :listact option=10 cond=Brow3 enter='CMD SNDMSG MSG(''Option 10 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .10=Something :listact option=10 enter='CMD SNDMSG MSG(''Option 10 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=11 cond=Brow3 enter='CMD SNDMSG MSG(''Option 11 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .11=Something :listact option=11 enter='CMD SNDMSG MSG(''Option 11 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=12 cond=Brow3 enter='CMD SNDMSG MSG(''Option 12 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .12=Something... :listact option=12 enter='CMD SNDMSG MSG(''Option 12 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . .* Fourth row of options ... :listact option=13 cond=Brow4 enter='CMD SNDMSG MSG(''Option 13 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .13=Something :listact option=13 enter='CMD SNDMSG MSG(''Option 13 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listact option=14 cond=Brow4 enter='CMD SNDMSG MSG(''Option 14 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .14=Something... :listact option=14 enter='CMD SNDMSG MSG(''Option 14 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . .* Fifth row of options ... :listact option=15 cond=Brow5 enter='CMD SNDMSG MSG(''Option 15 pressed'') TOUSR(*REQUESTER)' help=nohelpatall .15=Something... :listact option=15 enter='CMD SNDMSG MSG(''Option 15 pressed'') TOUSR(*REQUESTER)' help=nohelpatall . :listcol var=option usage=inout maxwidth=4 help=nohelpatall .Opt :listcol var=column1 usage=out maxwidth=10 help=nohelpatall .First :listcol var=column2 usage=out maxwidth=10 help=nohelpatall .Second :listcol var=column3 usage=out maxwidth=10 help=nohelpatall .Third :listcol var=column4 usage=out maxwidth=10 help=nohelpatall .Fourth :listcol var=column5 usage=out maxwidth=10 help=nohelpatall .Fifth :listview layout=1 cols='option column1 column2 column3 column4 column5'. :elist. :epanel. :help name=nohelpatall. :ehelp. :epnlgrp. RPG IV source for using UIM panel group with F23=More options H DFTACTGRP(*NO) H COPYRIGHT('Example of F23=More options. Public Domain by Simon Coulter.') H DEBUG(*YES) H DATEDIT(*YMD/) H OPTION(*SRCSTMT : *NODEBUGIO) D QuiOpenDspApp PR EXTPGM('QUIOPNDA') D appHandle 8 D qualPnlGrp 20 CONST D appScope 10I 0 CONST D exitParmItf 10I 0 CONST D helpFull 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiCloseApp PR EXTPGM('QUICLOA') D appHandle 8 CONST D closeOption 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiDspPnl PR EXTPGM('QUIDSPP') D appHandle 8 CONST D function 10I 0 D pnlName 10 CONST D redsplyOption 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiPutDlgVar PR EXTPGM('QUIPUTV') D appHandle 8 CONST D varBuffer 32767 CONST D varBufferLen 10I 0 CONST D varRcdName 10 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiAddListEntry... D PR EXTPGM('QUIADDLE') D appHandle 8 CONST D varBuffer 32767 CONST D varBufferLen 10I 0 CONST D varRcdName 10 CONST D listName 10 CONST D listOption 4 CONST D listEntHandle 4 D errCode 1024 OPTIONS(*VARSIZE) * UIM constants D $UI_REDISPLAY_YES... D C CONST('Y') D $UI_FULL_HELP_NO... D C CONST('N') D $UI_UIM_WAIT_FOREVER... D C CONST(-1) D $UI_APP_SCOPE_CALLER... D C CONST(-1) D $UI_EXIT_PARM_ITF_STRUCT... D C CONST(0) D $UI_FUNC_ENTER... D C CONST(0) D $UI_FUNC_EXIT... D C CONST(-4) D $UI_FUNC_CANCEL... D C CONST(-8) D $UI_LIST_OPT_FIRST... D C CONST('FRST') D $UI_CLOSE_OPT_NORMAL... D C CONST('M') D $F23 C CONST(123) D $MAX_OPT_ROWS C CONST(5) * UIM API declarations D appHandle S 8 D userFunction S 10I 0 D listEntryHandle... D S 10 * UIM variable pool declarations D varpool DS D rowOpt 5I 0 D record1 DS D option 5I 0 D column1 10 D column2 10 D column3 10 D column4 10 D column5 10 * API error code data structure D Qus_Ec DS INZ D Qus_Ec_Bytes_Prov... D 10I 0 D Qus_Ec_Bytes_Avail... D 10I 0 D Qus_Ec_Excp_Id... D 7 D Qus_Ec_Rsvd... D 1 D Qus_Ec_Excp_Dta... D 128 /FREE // Force API errors (during testing) Qus_Ec_Bytes_Prov = *ZERO; // Open the UIM application QuiOpenDspApp( appHandle : 'F23MOREOPG*LIBL ' : $UI_APP_SCOPE_CALLER : $UI_EXIT_PARM_ITF_STRUCT : $UI_FULL_HELP_NO : Qus_Ec ); // Set dialogue variables // Force display of first row of options rowOpt = 1; QuiPutDlgVar( appHandle : varPool : %SIZE(varPool) : 'VARPOOL' : Qus_Ec ); // Stick one entry in the list for testing option = 0; column1 = 'ABCDEFGHIJ'; column2 = 'KLMNOPQRST'; column3 = 'UVWXYZ1234'; column4 = '567890-+=_'; column5 = '!@#$%^&*()'; QuiAddListEntry( appHandle : record1 : %SIZE(record1) : 'RECORD1' : 'LIST' : $UI_LIST_OPT_FIRST : listEntryHandle : Qus_Ec ); // Until the user requests exit ... DOU ( userFunction = $UI_FUNC_ENTER OR userFunction = $UI_FUNC_EXIT OR userFunction = $UI_FUNC_CANCEL ); // Display the UIM panel QuiDspPnl( appHandle : userFunction : 'EXAMPLE' : $UI_REDISPLAY_YES : Qus_Ec ); // User pressed F23=More options? IF ( userFunction = $F23 ); // Condition next row of options /IF DEFINED(*V5R3M0) rowOpt += 1; /ELSE rowOpt = rowOpt + 1; /ENDIF // If more than the maximum allowed then force first row IF ( rowOpt > $MAX_OPT_ROWS ); rowOpt = 1; ENDIF; QuiPutDlgVar( appHandle : varPool : %SIZE(varPool) : 'VARPOOL' : Qus_Ec ); ENDIF; ENDDO; // Close the UIM application QuiCloseApp( appHandle : $UI_CLOSE_OPT_NORMAL : Qus_Ec ); /END-FREE * End the program and go home C SETON LR C RETURN
[report a broken link by clicking here]