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

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* This creates a Main Window with 2 Groups. The first Group contains 2 SPINs
 * with the REPORT flag set. The second Group contains 1 LIST. Whenever the user
 * changes the SPIN's value, RXMSG() returns, and we move the LIST's x and y
 * position to the value of the SPINs (ie, for example 8, -10 moves the LIST 8
 * pixels left, and 10 pixels up toward the titlebar).
 */

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 SPIN */
rxtype.1 = 'SPIN'

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

/* Minimum, Maximum, Labels for each spin, and Groupbox */
rxlabel.1 = 'X:| Y:|Position'

/* Initial value of each spin */
rxval.1 = '0 0'

/* Min/Max */
rxinfo.1 = '-40 40 -10 10'

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




rxtype.2 = 'LIST'
rxflags.2 = 'ALLNONE|MULTIPLE'
rxlabel.2 = 'One:|Listbox'
rxval.2 = 'ONE'
one.1 = 'Hello'
one.2 = 'Hi'
one.3 = 'Bye'
one.4 = 'Goodbye'
one.5 = ' '

/* Position */
rxpos.2 = '1 100 40 110 3'

/* 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', 2, 'RXSET() MOVE', 'NOCLOSE')

DO FOREVER

/* Do user interaction */
CALL RXMSG()

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

/* See which of the two SPINs was reported */
IF rxsubid == '1' THEN ,

   /* Set LISTBOX X position to value of the SPIN. We don't
    * care about changing the Y position, so omit it.
    */
   CALL RXSET(, 'MOVE', rxval.1, 2, 1) 

ELSE ,

   /* Set LISTBOX Y position to value of the SPIN. We don't
    * care about changing the Y position, so specify 0.
    */
   CALL RXSET(, 'MOVE', 0 rxval.1, 2, 1) 

END /* DO FOREVER */

/* ==================== 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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-26  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-08-27 06:46:24