Guidance
指路人
g.yi.org
Software / Reginald / Examples / RxSet1.rex

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* This creates a Main Window with a Group of radio buttons with the REPORT
 * flag set. Whenever the user clicks upon a button, RXMSG returns, and
 * we force the next radio button (after the selected button) to be selected.
 */


ADDRESS null

/* Trap HALT and SYNTAX in any scripts we call which don't
 * trap HALT or SYNTAX themselves.
 */
OPTIONS 'TRAP'

/* Trap SYNTAX/ERROR/HAT, and ask for ERROR raising */
SIGNAL ON HALT
SIGNAL ON SYNTAX
SIGNAL ON ERROR
CALL RXERR('ERROR|DISPLAY')


/* =============== Create "Main Window" ================= */
/* First Group is RADIO */
rxtype.1 = 'RADIO'

/* Use of a control in this group causes RXMSG to return */
rxflags.1 = 'REPORT'

/* Labels for buttons and groupbox */
rxlabel.1 = '1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|Pick one'

/* Initially select button 1 */
rxval.1 = '1'

/* ControlsPerLine, X Position, Y Position, Width */
rxpos.1 = '4 7 20'

/* Default size and position */
rx = ''

/* NOCLOSE since we want to close the window ourselves.
 * No RESULT Flag, so the ESC and ENTER keys do nothing, and we don't
 * have to bother checking for those
 */
CALL RXCREATE('RX', 1, 'RXSET() VALUE -- buttons', 'NOCLOSE')

more:

/* Do user interaction */
CALL RXMSG()

/* Did user click upon the CLOSE BOX? If so, then exit */
IF rxid == '' THEN SIGNAL HALT

/* Since there is only 1 group, we only need to pay attention to RXSUBID.
 * It's the number of the selected button. Since we didn't skip buttons, we
 * simply increment this to get the next button #, but because we only have
 * 16 buttons, upon the 16th, cycle back to button #1
 */

IF rxsubid > 15 THEN rxsubid = 0
CALL RXSET(, 'VALUE', 1, 1, rxsubid+1)
SIGNAL more





/* ==================== Error Handling ====================== */
syntax:
    CALL RXSAY(CONDITION('D') || '0D0A0D0A'x || SOURCELINE(sigl),,'Error '||condition('E')||' at line '||sigl)

halt:
error:
    /* NOTE: CONDITION('D') fetches error message. CONDITION('E') fetches the
     * error number. SIGL is the line number where the error occurred.
     * Rexx Dialog has already displayed a message since we specified DISPLAY
     * option.
     */
    CALL RXMSG(,'END')
    EXIT
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Mon 2017-7-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-18 23:35:17