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

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

  
/* This demos how REXX Dialog updates a window's dimensions string when the
 * window is closed. Therefore, if a window is reopened using the same
 * dimensions string, it reopens with the same size and position as when it was
 * closed. This also demos how you can reopen a window with the same values for
 * its Groups if you don't alter the returned RXVAL strings
 */


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 "Spin Group" window ================= */
/* First Group is SPIN */
rxtype.1 = 'SPIN'

/* Default */
rxflags.1 = ''

/* Label for each slider, and groupbox */
rxlabel.1 = 'Range 1:|Range 2:|Try us'

/* Values for each slider */
rxval.1 = '64 19'

/* Min/Max */
rxinfo.1 = '0 255 10 20'

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

rx = ''

CALL RXCREATE('RX', 1, 'Spin Group', 'RESULT|SETVAL')

/* Do user interaction */
CALL RXMSG()

/* Display "Spin Group" values */
values = rxval.1   /* Copy it so that we don't alter what was returned to us */
DO i = 1 TO 2
   PARSE VAR values knob values
   CALL RXSAY('Spin #' || i || ' = ' || knob)
END





/* ================ Create "Spin Group" window ================= */
/* Create the same window again. Leave the window's RXWIN1, and the Spin
 * Group's RXVAL.1 strings, the same as the previous RXMSG returned. Note
 * that the same location and spin values as used as what were returned the
 * last time we created this window are used now
 */
CALL RXCREATE('RX', 1, 'Spin Group', 'RESULT|SETVAL')

/* Do user interaction */
CALL RXMSG()

/* Display "Spin Group" values */
IF rxid \== '' THEN DO
   values = rxval.1
   DO i = 1 TO 2
      PARSE VAR values knob values
      CALL RXSAY('Spin #' || i || ' = ' || knob)
   END
END

EXIT



/* ==================== 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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2017-6-22  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-18 23:35:17