home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / aquick.x < prev    next >
Text File  |  1996-01-22  |  44KB  |  1,425 lines

  1. '
  2. ' ####################
  3. ' #####  PROLOG  #####
  4. ' ####################
  5. '
  6. PROGRAM    "aquick"
  7. VERSION    "0.0026"
  8. '
  9. IMPORT    "xst"
  10. IMPORT    "xgr"
  11. IMPORT    "xui"
  12. '
  13. ' This program demonstrates the non-modal "convenience functions"
  14. ' in GuiDesigner.  Programs can create and operate simple or complex
  15. ' GUI windows with less than a dozen convenience functions.
  16. '
  17. ' This program lets the user display and operate all 32 standard
  18. ' toolkit grids, and it displays the callback messages from these
  19. ' grids as they happen.  That makes this program a good way to learn
  20. ' or review the standard toolkit grids and how they operate.
  21. '
  22. ' #######################
  23. ' #####  FUNCTIONS  #####
  24. ' #######################
  25. '
  26. INTERNAL FUNCTION  Entry              ( )
  27. INTERNAL FUNCTION  CreateDisplayGrid  ( @label, x, y, w, h )
  28. INTERNAL FUNCTION  CreateGrids        ( x, y, w, h, grid[] )
  29. INTERNAL FUNCTION  DisplayCallback    ( label, grid, message$, v0, v1, v2, v3, kid, r1$ )
  30. INTERNAL FUNCTION  CreateListWindow   ( grid, x, y, w, h, grid$[] )
  31. '
  32. '
  33. ' #######################
  34. ' #####  CONSTANTS  #####
  35. ' #######################
  36. '
  37. ' grid numbers of standard toolkit grids in grid[]
  38. '
  39.     $$XuiColor        =  0
  40.     $$XuiLabel        =  1
  41.     $$XuiCheckBox     =  2
  42.     $$XuiRadioBox     =  3
  43.     $$XuiPressButton  =  4
  44.     $$XuiPushButton   =  5
  45.     $$XuiToggleButton =  6
  46.     $$XuiRadioButton  =  7
  47.     $$XuiScrollBarH   =  8
  48.     $$XuiScrollBarV   =  9
  49.     $$XuiTextLine     = 10
  50.     $$XuiTextArea     = 11
  51.     $$XuiMenu         = 12
  52.     $$XuiMenuBar      = 13
  53.     $$XuiPullDown     = 14
  54.     $$XuiList         = 15
  55.     $$XuiMessage1B    = 16
  56.     $$XuiMessage2B    = 17
  57.     $$XuiMessage3B    = 18
  58.     $$XuiMessage4B    = 19
  59.     $$XuiProgress     = 20
  60.     $$XuiDialog2B     = 21
  61.     $$XuiDialog3B     = 22
  62.     $$XuiDialog4B     = 23
  63.     $$XuiDropButton   = 24
  64.     $$XuiDropBox      = 25
  65.     $$XuiListButton   = 26
  66.     $$XuiListBox      = 27
  67.     $$XuiRange        = 28
  68.     $$XuiFile         = 29
  69.     $$XuiFont         = 30
  70.     $$XuiListDialog2B = 31
  71. '
  72. ' windows in this program
  73. '
  74.     $$SwitchWindow    = 32
  75.     $$CallbackWindow  = 33
  76. '
  77. '
  78. ' ######################
  79. ' #####  Entry ()  #####
  80. ' ######################
  81. '
  82. '
  83. ' CreateListWindow() creates window with list of all 32 standard grids.
  84. ' CreateDisplayGrid() creates window to display callback arguments in.
  85. ' CreateGrids() creates one window each for the 32 standard grids.
  86. '
  87. '
  88. ' the message loop is typical for a convenience function program
  89. '
  90. ' 1: Wait for one message in XgrProcessMessages(1) then process it.
  91. ' 2: Call XuiGetNextCallback() to check for a pending callback message.
  92. ' 3: If a callback message is ready & returned by XuiGetNextCallback(),
  93. '    call the subroutine designed to handle callbacks from that grid.
  94. ' 4: Once the callback is processed, loop to continue processing.
  95. '
  96. '
  97. ' SUB ReportCallback displays the values of the callback arguments
  98. ' and calls a function for each grid type to get information about
  99. ' any callback arguments that are significant, plus other comments.
  100. '
  101. '
  102. ' SUB GridName subroutines set up v0$, v1$, v2$, v3$ with strings
  103. ' that describe each callback argument with a defined meaning.
  104. '
  105. '
  106. '
  107. FUNCTION  Entry ()
  108.     STATIC  SUBADDR  sub[]
  109.     STATIC  terminate
  110. '
  111.     IFZ sub[] THEN GOSUB Initialize
  112. '
  113.     visible = -1
  114.     XgrGetDisplaySize ("", @dw, @dh, @bw, @th)
  115.     XgrCreateFont (@bigfont, @"Courier", 480, 700, 0, 0)
  116. '
  117.     xx = bw : yy = bw + th : ww = 160 : hh = 420
  118.     CreateListWindow (@grid, xx, yy, ww, hh, @grid$[])
  119. '
  120.     x = xx + ww + bw + bw : y = yy + 320 : w = 420 : h = dh - y - bw
  121.     CreateDisplayGrid ( @call, x, y, w, h )
  122. '
  123.     x = xx + ww + bw + bw : y = yy : w = 200 : h = 80
  124.     CreateGrids (x, y, w, h, @grid[])
  125. '
  126.     DO
  127.         XgrProcessMessages (1)
  128.         DO WHILE XuiGetNextCallback (@grid, @message$, @v0, @v1, @v2, @v3, @rr0, @r1$)
  129.             GOSUB Callback
  130.         LOOP
  131.     LOOP UNTIL terminate
  132. '
  133.     RETURN ($$FALSE)
  134. '
  135. '
  136. '
  137. ' *********************************
  138. ' *****  SUPPORT SUBROUTINES  *****
  139. ' *********************************
  140. '
  141. ' *****  Callback  *****
  142. '
  143. SUB Callback
  144.     wintag = rr0 >> 16
  145.     kid = rr0 AND 0xFFFF
  146.     IF (message$ = "CloseWindow") THEN QUIT (0)            ' from any window
  147. '
  148.     SELECT CASE wintag
  149.         CASE $$SwitchWindow    :    GOSUB SwitchWindow
  150.         CASE ELSE                        :    GOSUB ReportCallback
  151.     END SELECT
  152. END SUB
  153. '
  154. '
  155. ' *****  ReportCallback  *****
  156. '
  157. SUB ReportCallback
  158.     xx$ = ""
  159.     v0$ = ""
  160.     v1$ = ""
  161.     v2$ = ""
  162.     v3$ = ""
  163.     kid$ = ""
  164.     comments$ = ""
  165.     IF (grid <= 0) THEN EXIT SUB
  166.     IF (wintag < 0) THEN EXIT SUB
  167.     IF (wintag > 31) THEN EXIT SUB
  168.     XuiSendStringMessage (grid, @"GetGridName", 0, 0, 0, 0, 0, @name$)
  169.     XuiSendStringMessage (grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @type$)
  170.     hgrid$ = HEX$(grid,8)
  171.     hv0$ = HEX$(v0,8)
  172.     hv1$ = HEX$(v1,8)
  173.     hv2$ = HEX$(v2,8)
  174.     hv3$ = HEX$(v3,8)
  175.     hkid$ = "    " + HEX$(kid,4)
  176.     hwt$ = LEFT$(HEX$(rr0,8),4)
  177.     image$ = image$[wintag]
  178.     XuiSendStringMessage (call, @"SetImage", 0, 0, 8, 8, 0, @image$)
  179.     GOSUB @sub[wintag]
  180.     a$ = "\n\n\n\n"
  181.     a$ = a$ + "    grid = " + hgrid$ + "\n"
  182.     a$ = a$ + " message = " + message$ + "\n"
  183.     a$ = a$ + "      v0 = " + hv0$ + " : " + v0$ + "\n"
  184.     a$ = a$ + "      v1 = " + hv1$ + " : " + v1$ + "\n"
  185.     a$ = a$ + "      v2 = " + hv2$ + " : " + v2$ + "\n"
  186.     a$ = a$ + "      v3 = " + hv3$ + " : " + v3$ + "\n"
  187.     a$ = a$ + "     kid = " + hkid$ + " : " + kid$ + "\n"
  188.     a$ = a$ + "     r1$ = " + r1$ + "\n"
  189.     a$ = a$ + "  wintag = " + hwt$
  190.     IF xx$ THEN a$ = a$ + "\n\n" + xx$
  191. '
  192.     XuiSendStringMessage (call, @"SetTextString", 0, 0, 0, 0, 0, a$)
  193.     XuiSendStringMessage (call, @"RedrawGrid", 0, 0, 0, 0, 0, 0)
  194.     IF bigfont THEN
  195.         XgrMoveTo (call, 48, 18)
  196.         XgrGetGridFont (call, @temp)
  197.         XgrSetGridFont (call, bigfont)
  198.         XgrDrawText (call, $$LightCyan, @type$)
  199.         XgrSetGridFont (call, temp)
  200.     END IF
  201. END SUB
  202. '
  203. '
  204. ' *****  SwitchWindow  *****
  205. '
  206. SUB SwitchWindow
  207.     IF (v0 < 0) THEN EXIT SUB
  208.     IF (v0 > 31) THEN EXIT SUB
  209.     grid = grid[v0]
  210.     IF grid THEN
  211.         IF (visible >= 0) THEN
  212.             XuiSendStringMessage (visible, @"HideWindow", 0, 0, 0, 0, 0, 0)
  213.         END IF
  214.         visible = grid
  215.         XuiSendStringMessage (visible, @"DisplayWindow", 0, 0, 0, 0, 0, 0)
  216.     END IF
  217.     type$ = grid$[v0]
  218.     XgrClearGrid (call, -1)
  219.     image$ = image$[v0]
  220.     XuiSendStringMessage (call, @"SetImage", 0, 0, 8, 8, 0, @image$)
  221.     XuiSendStringMessage (call, @"SetTextString", 0, 0, 0, 0, 0, "")
  222.     XuiSendStringMessage (call, @"RedrawGrid", 0, 0, 0, 0, 0, 0)
  223.     IF bigfont THEN
  224.         XgrMoveTo (call, 48, 18)
  225.         XgrGetGridFont (call, @temp)
  226.         XgrSetGridFont (call, bigfont)
  227.         XgrDrawText (call, $$LightCyan, @type$)
  228.         XgrSetGridFont (call, temp)
  229.     END IF
  230. END SUB
  231. '
  232. '
  233. ' *****  Help  *****
  234. '
  235. SUB Help
  236.     v0$ = "x : mouse cursor"
  237.     v1$ = "y : mouse cursor"
  238. END SUB
  239. '
  240. '
  241. ' *****  Selection  *****
  242. '
  243. SUB Selection
  244. END SUB
  245. '
  246. '
  247. ' *****  TextEvent  *****
  248. '
  249. SUB TextEvent
  250.     v0$ = "xDisp : mouse cursor"
  251.     v1$ = "yDisp : mouse cursor"
  252.     v2$ = "state"
  253.     v3$ = "time"
  254. END SUB
  255. '
  256. '
  257. ' *****  TextStringSelection  *****
  258. '
  259. SUB TextStringSelection
  260.     XuiSendStringMessage (grid, @"GetTextString", 0, 0, 0, 0, kid, @text$)
  261.     IF text$ THEN
  262.         xx$ = "\n"
  263.         xx$ = xx$ + "\n " + r1$ + " TextString : " + text$
  264.     END IF
  265. END SUB
  266. '
  267. '
  268. ' ******************************
  269. ' *****  GRID SUBROUTINES  *****
  270. ' ******************************
  271. '
  272. '
  273. ' *****  XuiColor  *****
  274. '
  275. SUB XuiColor
  276.     SELECT CASE message$
  277.         CASE "Selection"    : GOSUB XuiColorSelection
  278.         CASE "Help"                : GOSUB Help
  279.     END SELECT
  280. END SUB
  281. '
  282. '
  283. ' *****  XuiColorSelection  *****
  284. '
  285. SUB XuiColorSelection
  286.     XgrColorNumberToName (v0, @color$)
  287.     IF color$ THEN color$ = " : " + color$
  288.     v0$ = "color #" + color$
  289.     v1$ = "red     : 0x0000 to 0xFFFF"
  290.     v2$ = "green   : 0x0000 to 0xFFFF"
  291.     v3$ = "blue    : 0x0000 to 0xFFFF"
  292. END SUB
  293. '
  294. '
  295. ' *****  XuiLabel  *****
  296. '
  297. SUB XuiLabel
  298.     SELECT CASE message$
  299.         CASE "Help"                : GOSUB Help
  300.     END SELECT
  301. END SUB
  302. '
  303. '
  304. ' *****  XuiCheckBox  *****
  305. '
  306. SUB XuiCheckBox
  307.     SELECT CASE message$
  308.         CASE "Selection"    : GOSUB XuiCheckBoxSelection
  309.         CASE "Help"                : GOSUB Help
  310.     END SELECT
  311. END SUB
  312. '
  313. '
  314. ' *****  XuiCheckBoxSelection  *****
  315. '
  316. SUB XuiCheckBoxSelection
  317.     IF v0 THEN
  318.         v0$ = "selected"
  319.     ELSE
  320.         v0$ = "not selected"
  321.     END IF
  322.     v2$ = "state"
  323.     v3$ = "time"
  324. END SUB
  325. '
  326. '
  327. ' *****  XuiRadioBox  *****
  328. '
  329. SUB XuiRadioBox
  330.     SELECT CASE message$
  331.         CASE "Selection"    : GOSUB XuiRadioBoxSelection
  332.         CASE "Help"                : GOSUB Help
  333.     END SELECT
  334. END SUB
  335. '
  336. '
  337. ' *****  XuiRadioBoxSelection  *****
  338. '
  339. SUB XuiRadioBoxSelection
  340.     IF v0 THEN
  341.         v0$ = "selected"
  342.     ELSE
  343.         v0$ = "not selected"
  344.     END IF
  345. END SUB
  346. '
  347. '
  348. ' *****  XuiPressButton  *****
  349. '
  350. SUB XuiPressButton
  351.     SELECT CASE message$
  352.         CASE "Selection"    : GOSUB XuiPressButtonSelection
  353.         CASE "Help"                : GOSUB Help
  354.     END SELECT
  355. END SUB
  356. '
  357. '
  358. ' *****  XuiPressButtonSelection  *****
  359. '
  360. SUB XuiPressButtonSelection
  361.     v2$ = "state"
  362.     v3$ = "time"
  363. END SUB
  364. '
  365. '
  366. ' *****  XuiPushButton  *****
  367. '
  368. SUB XuiPushButton
  369.     SELECT CASE message$
  370.         CASE "Selection"    : GOSUB XuiPushButtonSelection
  371.         CASE "Help"                : GOSUB Help
  372.     END SELECT
  373. END SUB
  374. '
  375. '
  376. ' *****  XuiPushButtonSelection  *****
  377. '
  378. SUB XuiPushButtonSelection
  379.     v2$ = "state"
  380.     v3$ = "time"
  381. END SUB
  382. '
  383. '
  384. ' *****  XuiToggleButton  *****
  385. '
  386. SUB XuiToggleButton
  387.     SELECT CASE message$
  388.         CASE "Selection"    : GOSUB XuiToggleButtonSelection
  389.         CASE "Help"                : GOSUB Help
  390.     END SELECT
  391. END SUB
  392. '
  393. '
  394. ' *****  XuiToggleButtonSelection  *****
  395. '
  396. SUB XuiToggleButtonSelection
  397.     IF v0 THEN
  398.         v0$ = "selected"
  399.     ELSE
  400.         v0$ = "not selected"
  401.     END IF
  402.     v2$ = "state"
  403.     v3$ = "time"
  404. END SUB
  405. '
  406. '
  407. ' *****  XuiRadioButton  *****
  408. '
  409. SUB XuiRadioButton
  410.     SELECT CASE message$
  411.         CASE "Selection"    : GOSUB XuiRadioButtonSelection
  412.         CASE "Help"                : GOSUB Help
  413.     END SELECT
  414. END SUB
  415. '
  416. '
  417. ' *****  XuiRadioButtonSelection  *****
  418. '
  419. SUB XuiRadioButtonSelection
  420.     IF v0 THEN
  421.         v0$ = "selected"
  422.     ELSE
  423.         v0$ = "not selected"
  424.     END IF
  425. END SUB
  426. '
  427. '
  428. ' *****  XuiScrollBarH  *****
  429. '
  430. SUB XuiScrollBarH
  431.     SELECT CASE message$
  432.         CASE "MuchLess"        : GOSUB XuiScrollBarCallback
  433.         CASE "SomeLess"        : GOSUB XuiScrollBarCallback
  434.         CASE "OneLess"        : GOSUB XuiScrollBarCallback
  435.         CASE "Change"            : GOSUB XuiScrollBarCallback
  436.         CASE "OneMore"        : GOSUB XuiScrollBarCallback
  437.         CASE "SomeMore"        : GOSUB XuiScrollBarCallback
  438.         CASE "MuchMore"        : GOSUB XuiScrollBarCallback
  439.         CASE "Help"                : GOSUB Help
  440.     END SELECT
  441. END SUB
  442. '
  443. '
  444. ' *****  XuiScrollBarV  *****
  445. '
  446. SUB XuiScrollBarV
  447.     SELECT CASE message$
  448.         CASE "MuchLess"        : GOSUB XuiScrollBarCallback
  449.         CASE "SomeLess"        : GOSUB XuiScrollBarCallback
  450.         CASE "OneLess"        : GOSUB XuiScrollBarCallback
  451.         CASE "Change"            : GOSUB XuiScrollBarCallback
  452.         CASE "OneMore"        : GOSUB XuiScrollBarCallback
  453.         CASE "SomeMore"        : GOSUB XuiScrollBarCallback
  454.         CASE "MuchMore"        : GOSUB XuiScrollBarCallback
  455.         CASE "Help"                : GOSUB Help
  456.     END SELECT
  457. END SUB
  458. '
  459. '
  460. ' *****  XuiScrollBarCallback  *****
  461. '
  462. SUB XuiScrollBarCallback
  463.     v0$ = " min position"
  464.     v1$ = " low position"
  465.     v2$ = "high position"
  466.     v3$ = " max position"
  467. END SUB
  468. '
  469. '
  470. ' *****  XuiTextLine  *****
  471. '
  472. SUB XuiTextLine
  473.     SELECT CASE message$
  474.         CASE "Selection"    : GOSUB XuiTextLineSelection
  475.         CASE "TextEvent"    : GOSUB TextEvent
  476.         CASE "Help"                : GOSUB Help
  477.     END SELECT
  478. END SUB
  479. '
  480. '
  481. ' *****  XuiTextLineSelection  *****
  482. '
  483. SUB XuiTextLineSelection
  484.     v0$ = "state"
  485.     XuiSendStringMessage (grid, @"GetTextString", 0, 0, 0, 0, 0, @text$)
  486.     xx$ = "\n"
  487.     xx$ = xx$ + "\n Text line : " + text$
  488. END SUB
  489. '
  490. '
  491. '
  492. ' *****  XuiTextArea  *****
  493. '
  494. SUB XuiTextArea
  495.     SELECT CASE message$
  496.         CASE "TextEvent"    : GOSUB TextEvent
  497.         CASE "Help"                : GOSUB Help
  498.     END SELECT
  499. END SUB
  500. '
  501. '
  502. ' *****  XuiMenu  *****
  503. '
  504. SUB XuiMenu
  505.     SELECT CASE message$
  506.         CASE "Selection"    : GOSUB XuiMenuSelection
  507.         CASE "Help"                : GOSUB Help
  508.     END SELECT
  509. END SUB
  510. '
  511. '
  512. ' *****  XuiMenuSelection  *****
  513. '
  514. SUB XuiMenuSelection
  515.     v0$ = "MenuBar entry : 1+"
  516.     v1$ = "PullDown item : 0+"
  517.     XuiSendStringMessage (grid, @"GetTextArray", 0, 0, 0, 0, 0, @text$[])
  518.     IFZ text$[] THEN EXIT SUB
  519.     u = UBOUND (text$[])
  520.     menubar = 0
  521.     FOR i = 0 TO u
  522.         text$ = text$[i]
  523.         IF text$ THEN
  524.             char = text${0}
  525.             IF ((char != ' ') AND (char != '    ')) THEN        ' not tab or space
  526.                 INC menubar
  527.                 IF (menubar = v0) THEN
  528.                     header = i
  529.                     EXIT FOR
  530.                 END IF
  531.             END IF
  532.         END IF
  533.     NEXT i
  534.     IF (v0 = menubar) THEN
  535.         menu$ = text$[header]
  536.         list = header + v1 + 1
  537.         IF (list <= u) THEN list$ = text$[list]
  538.         xx$ = "\n"
  539.         xx$ = xx$ + "\n Menu entry : " + menu$
  540.         xx$ = xx$ + "\n List entry : " + list$
  541.     END IF
  542. END SUB
  543. '
  544. '
  545. ' *****  XuiMenuBar  *****
  546. '
  547. SUB XuiMenuBar
  548.     SELECT CASE message$
  549.         CASE "Selection"    : GOSUB XuiMenuBarSelection
  550.         CASE "Help"                : GOSUB Help
  551.     END SELECT
  552. END SUB
  553. '
  554. '
  555. ' *****  XuiMenuBarSelection  *****
  556. '
  557. SUB XuiMenuBarSelection
  558.     v0$ = "MenuBar entry : 1+"
  559.     XuiSendStringMessage (grid, @"GetTextString", 0, 0, 0, 0, 0, @text$)
  560.     IFZ text$ THEN EXIT SUB
  561.     item = $$FALSE
  562.     done = $$FALSE
  563.     pos = $$FALSE
  564.     DO UNTIL (item >= v0)
  565.         INC item
  566.         item$ = XstNextField$ (@text$, @pos, @done)
  567.     LOOP UNTIL done
  568.     IF item$ THEN
  569.         IF (v0 = item) THEN
  570.             xx$ = "\n"
  571.             xx$ = xx$ + "\n MenuBar item : " + item$
  572.         END IF
  573.     END IF
  574. END SUB
  575. '
  576. '
  577. ' *****  XuiPullDown  *****
  578. '
  579. SUB XuiPullDown
  580.     SELECT CASE message$
  581.         CASE "Selection"    : GOSUB XuiPullDownSelection
  582.         CASE "Help"                : GOSUB Help
  583.     END SELECT
  584. END SUB
  585. '
  586. '
  587. ' *****  XuiPullDownSelection  *****
  588. '
  589. SUB XuiPullDownSelection
  590.     v0$ = "PullDown item = 0+"
  591.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @text$)
  592.     IF text$ THEN
  593.         xx$ = "\n"
  594.         xx$ = xx$ + "\n PullDown item : " + text$
  595.     END IF
  596. END SUB
  597. '
  598. '
  599. ' *****  XuiList  *****
  600. '
  601. SUB XuiList
  602.     SELECT CASE message$
  603.         CASE "Selection"    : GOSUB XuiListSelection
  604.         CASE "Help"                : GOSUB Help
  605.     END SELECT
  606. END SUB
  607. '
  608. '
  609. ' *****  XuiListSelection  *****
  610. '
  611. SUB XuiListSelection
  612.     v0$ = "List item : 0+"
  613.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @list$)
  614.     IF (v0 >= 0) THEN
  615.         xx$ = "\n"
  616.         xx$ = xx$ + "\n List item = " + list$
  617.     END IF
  618. END SUB
  619. '
  620. '
  621. ' *****  XuiMessage1B  *****
  622. '
  623. SUB XuiMessage1B
  624.     SELECT CASE message$
  625.         CASE "Selection"    : GOSUB TextStringSelection
  626.         CASE "Help"                : GOSUB Help
  627.     END SELECT
  628. END SUB
  629. '
  630. '
  631. ' *****  XuiMessage2B  *****
  632. '
  633. SUB XuiMessage2B
  634.     SELECT CASE message$
  635.         CASE "Selection"    : GOSUB TextStringSelection
  636.         CASE "Help"                : GOSUB Help
  637.     END SELECT
  638. END SUB
  639. '
  640. '
  641. ' *****  XuiMessage3B  *****
  642. '
  643. SUB XuiMessage3B
  644.     SELECT CASE message$
  645.         CASE "Selection"    : GOSUB TextStringSelection
  646.         CASE "Help"                : GOSUB Help
  647.     END SELECT
  648. END SUB
  649. '
  650. '
  651. ' *****  XuiMessage4B  *****
  652. '
  653. SUB XuiMessage4B
  654.     SELECT CASE message$
  655.         CASE "Selection"    : GOSUB TextStringSelection
  656.         CASE "Help"                : GOSUB Help
  657.     END SELECT
  658. END SUB
  659. '
  660. '
  661. ' *****  XuiProgress  *****
  662. '
  663. SUB XuiProgress
  664.     SELECT CASE message$
  665.         CASE "Selection"    : GOSUB Selection
  666.         CASE "Help"                : GOSUB Help
  667.     END SELECT
  668. END SUB
  669. '
  670. '
  671. ' *****  XuiDialog2B  *****
  672. '
  673. SUB XuiDialog2B
  674.     SELECT CASE message$
  675.         CASE "Selection"    : GOSUB TextStringSelection
  676.         CASE "Help"                : GOSUB Help
  677.     END SELECT
  678. END SUB
  679. '
  680. '
  681. ' *****  XuiDialog3B  *****
  682. '
  683. SUB XuiDialog3B
  684.     SELECT CASE message$
  685.         CASE "Selection"    : GOSUB TextStringSelection
  686.         CASE "Help"                : GOSUB Help
  687.     END SELECT
  688. END SUB
  689. '
  690. '
  691. ' *****  XuiDialog4B  *****
  692. '
  693. SUB XuiDialog4B
  694.     SELECT CASE message$
  695.         CASE "Selection"    : GOSUB TextStringSelection
  696.         CASE "Help"                : GOSUB Help
  697.     END SELECT
  698. END SUB
  699. '
  700. '
  701. ' *****  XuiDropButton  *****
  702. '
  703. SUB XuiDropButton
  704.     SELECT CASE message$
  705.         CASE "Selection"    : GOSUB XuiDropButtonSelection
  706.         CASE "Help"                : GOSUB Help
  707.     END SELECT
  708. END SUB
  709. '
  710. '
  711. ' *****  XuiDropButtonSelection  *****
  712. '
  713. SUB XuiDropButtonSelection
  714.     v0$ = "PullDown item : 0+"
  715.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @text$)
  716.     xx$ = "\n"
  717.     xx$ = xx$ + "\n List item : " + text$
  718. END SUB
  719. '
  720. '
  721. ' *****  XuiDropBox  *****
  722. '
  723. SUB XuiDropBox
  724.     SELECT CASE message$
  725.         CASE "Selection"    : GOSUB XuiDropBoxSelection
  726.         CASE "Help"                : GOSUB Help
  727.     END SELECT
  728. END SUB
  729. '
  730. '
  731. ' *****  XuiDropBoxSelection  *****
  732. '
  733. SUB XuiDropBoxSelection
  734.     v0$ = "PullDown item : 0+"
  735.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @list$)
  736.     XuiSendStringMessage (grid, @"GetTextString", v0, 0, 0, 0, 0, @text$)
  737.     xx$ = "\n"
  738.     xx$ = xx$ + "\n List item : " + list$
  739.     xx$ = xx$ + "\n Text item : " + text$
  740. END SUB
  741. '
  742. '
  743. ' *****  XuiListButton  *****
  744. '
  745. SUB XuiListButton
  746.     SELECT CASE message$
  747.         CASE "Selection"    : GOSUB XuiListButtonSelection
  748.         CASE "Help"                : GOSUB Help
  749.     END SELECT
  750. END SUB
  751. '
  752. '
  753. ' *****  XuiListButtonSelection  *****
  754. '
  755. SUB XuiListButtonSelection
  756.     v0$ = "List item : 0+"
  757.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @text$)
  758.     xx$ = "\n"
  759.     xx$ = xx$ + "\n List item : " + text$
  760. END SUB
  761. '
  762. '
  763. ' *****  XuiListBox  *****
  764. '
  765. SUB XuiListBox
  766.     SELECT CASE message$
  767.         CASE "Selection"    : GOSUB XuiListBoxSelection
  768.         CASE "Help"                : GOSUB Help
  769.     END SELECT
  770. END SUB
  771. '
  772. '
  773. ' *****  XuiListBoxSelection  *****
  774. '
  775. SUB XuiListBoxSelection
  776.     v0$ = "List item : 0+"
  777.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 0, @list$)
  778.     XuiSendStringMessage (grid, @"GetTextString", 0, 0, 0, 0, 0, @text$)
  779.     xx$ = "\n"
  780.     xx$ = xx$ + "\n List item : " + list$
  781.     xx$ = xx$ + "\n Text item : " + text$
  782. END SUB
  783. '
  784. '
  785. ' *****  XuiRange  *****
  786. '
  787. SUB XuiRange
  788.     v0$ = "value"
  789.     v1$ = "delta : +/-1"
  790.     v2$ = "minimum"
  791.     v3$ = "maximum"
  792. END SUB
  793. '
  794. '
  795. ' *****  XuiFile  *****
  796. '
  797. SUB XuiFile
  798.     IF (v0 < 0) THEN
  799.         v0$ = "cancel"
  800.     ELSE
  801.         XuiSendStringMessage (grid, @"GetTextString", 0, 0, 0, 0, 2, @file$)
  802.         IF file$ THEN xx$ = "\n\n selected file : " + file$ + "\n"
  803.         XstGetFileAttributes (@file$, @attributes)
  804.         IFZ attributes THEN
  805.             xx$ = xx$ + "\n $$FileNonexistent"
  806.         ELSE
  807.             SELECT CASE ALL TRUE
  808.                 CASE (attributes AND $$FileReadOnly)        : xx$ = xx$ + "\n $$FileReadOnly"
  809.                 CASE (attributes AND $$FileHidden)            : xx$ = xx$ + "\n $$FileHidden"
  810.                 CASE (attributes AND $$FileSystem)            : xx$ = xx$ + "\n $$FileSystem"
  811.                 CASE (attributes AND $$FileDirectory)        : xx$ = xx$ + "\n $$FileDirectory"
  812.                 CASE (attributes AND $$FileArchive)            : xx$ = xx$ + "\n $$FileArchive"
  813.                 CASE (attributes AND $$FileNormal)            : xx$ = xx$ + "\n $$FileNormal"
  814.                 CASE (attributes AND $$FileTemporary)        : xx$ = xx$ + "\n $$FileTemporary"
  815.                 CASE (attributes AND $$FileAtomicWrite)    : xx$ = xx$ + "\n $$FileAtomicWrite"
  816.                 CASE (attributes AND $$FileExecutable)    : xx$ = xx$ + "\n $$FileExecutable"
  817.             END SELECT
  818.         END IF
  819.     END IF
  820. END SUB
  821. '
  822. '
  823. ' *****  XuiFont  *****
  824. '
  825. SUB XuiFont
  826.     font = v0
  827.     IF (font < 0) THEN
  828.         v0$ = "cancel"
  829.     ELSE
  830.         XgrGetFontInfo (font, @font$, @size, @weight, @italic, @angle)
  831.         v0$ = "font #"
  832.         IF font$ THEN
  833.             xx$ = "\n"
  834.             xx$ = xx$ + "\n font information from XgrGetFontInfo() ***\n"
  835.             xx$ = xx$ + "\n    name : " + font$
  836.             xx$ = xx$ + "\n    size : " + RJUST$(STRING$(size),4)
  837.             xx$ = xx$ + "\n  weight : " + RJUST$(STRING$(weight),4)
  838.             xx$ = xx$ + "\n  italic : " + RJUST$(STRING$(italic),4)
  839.             xx$ = xx$ + "\n   angle : " + RJUST$(STRING$(angle),4)
  840.             xx$ = xx$ + "\n"
  841.             xx$ = xx$ + "\n    name : typeface name"
  842.             xx$ = xx$ + "\n    size : 20 * size in points"
  843.             xx$ = xx$ + "\n  weight : 0 to 1000 : 400 normal : 700 bold"
  844.             xx$ = xx$ + "\n  italic : 0 to 1000 :   0 normal else italic"
  845.             xx$ = xx$ + "\n   angle : 0 to 3600 :  .1 degree units"
  846.         END IF
  847.     END IF
  848. END SUB
  849. '
  850. '
  851. ' *****  XuiListDialog2B  *****
  852. '
  853. SUB XuiListDialog2B
  854.     SELECT CASE message$
  855.         CASE "Selection"    : GOSUB XuiListDialog2BSelection
  856.         CASE "TextEvent"    : GOSUB TextEvent
  857.         CASE "Help"                : GOSUB Help
  858.     END SELECT
  859. END SUB
  860. '
  861. '
  862. ' *****  XuiListDialog2BSelection  *****
  863. '
  864. SUB XuiListDialog2BSelection
  865.     SELECT CASE kid
  866.         CASE 2                        : GOSUB XuiListDialog2BList
  867.         CASE 3                        : GOSUB XuiListDialog2BTextLine
  868.         CASE 4                        : GOSUB XuiListDialog2BEnterButton
  869.         CASE 5                        : GOSUB XuiListDialog2BCancelButton
  870.     END SELECT
  871. END SUB
  872. '
  873. '
  874. ' *****  XuiListDialog2BList  *****
  875. '
  876. SUB XuiListDialog2BList
  877.     v0$ = "List item : 0+"
  878.     XuiSendStringMessage (grid, @"GetTextArrayLine", v0, 0, 0, 0, 2, @list$)
  879.     IF list$ THEN
  880.         xx$ = "\n"
  881.         xx$ = xx$ + "\n List item = " + list$
  882.     END IF
  883. END SUB
  884. '
  885. '
  886. ' *****  XuiListDialog2BTextLine  *****
  887. '
  888. SUB XuiListDialog2BTextLine
  889.     XuiSendStringMessage (grid, @"GetTextString", v0, 0, 0, 0, 3, @text$)
  890.     IF text$ THEN
  891.         xx$ = "\n"
  892.         xx$ = xx$ + "\n Text line = " + text$
  893.     END IF
  894. END SUB
  895. '
  896. '
  897. ' *****  XuiListDialog2BEnterButton  *****
  898. '
  899. SUB XuiListDialog2BEnterButton
  900.     XuiSendStringMessage (grid, @"GetTextCursor", @pos, @line, 0, 0, 2, 0)
  901.     XuiSendStringMessage (grid, @"GetTextArrayLine", line, 0, 0, 0, 2, @list$)
  902.     XuiSendStringMessage (grid, @"GetTextString", v0, 0, 0, 0, 3, @text$)
  903.     xx$ = "\n"
  904.     xx$ = xx$ + "\n Enter Button"
  905.     xx$ = xx$ + "\n  List item = " + list$
  906.     xx$ = xx$ + "\n  Text line = " + text$
  907. END SUB
  908. '
  909. '
  910. ' *****  XuiListDialog2BCancelButton  *****
  911. '
  912. SUB XuiListDialog2BCancelButton
  913.     xx$ = "\n"
  914.     xx$ = xx$ + "\n Cancel Button"
  915. END SUB
  916. '
  917. '
  918. ' *****  Initialize  *****
  919. '
  920. SUB Initialize
  921.     DIM sub[31]
  922.     DIM grid[31]
  923.     DIM grid$[31]
  924.     DIM image$[31]
  925.     DIM text$[11]
  926.     DIM short$[7]
  927. '
  928.     sub[ 0] = SUBADDRESS (XuiColor)
  929.     sub[ 1] = SUBADDRESS (XuiLabel)
  930.     sub[ 2] = SUBADDRESS (XuiCheckBox)
  931.     sub[ 3] = SUBADDRESS (XuiRadioBox)
  932.     sub[ 4] = SUBADDRESS (XuiPressButton)
  933.     sub[ 5] = SUBADDRESS (XuiPushButton)
  934.     sub[ 6] = SUBADDRESS (XuiToggleButton)
  935.     sub[ 7] = SUBADDRESS (XuiRadioButton)
  936.     sub[ 8] = SUBADDRESS (XuiScrollBarH)
  937.     sub[ 9] = SUBADDRESS (XuiScrollBarV)
  938.     sub[10] = SUBADDRESS (XuiTextLine)
  939.     sub[11] = SUBADDRESS (XuiTextArea)
  940.     sub[12] = SUBADDRESS (XuiMenu)
  941.     sub[13] = SUBADDRESS (XuiMenuBar)
  942.     sub[14] = SUBADDRESS (XuiPullDown)
  943.     sub[15] = SUBADDRESS (XuiList)
  944.     sub[16] = SUBADDRESS (XuiMessage1B)
  945.     sub[17] = SUBADDRESS (XuiMessage2B)
  946.     sub[18] = SUBADDRESS (XuiMessage3B)
  947.     sub[19] = SUBADDRESS (XuiMessage4B)
  948.     sub[20] = SUBADDRESS (XuiProgress)
  949.     sub[21] = SUBADDRESS (XuiDialog2B)
  950.     sub[22] = SUBADDRESS (XuiDialog3B)
  951.     sub[23] = SUBADDRESS (XuiDialog4B)
  952.     sub[24] = SUBADDRESS (XuiDropButton)
  953.     sub[25] = SUBADDRESS (XuiDropBox)
  954.     sub[26] = SUBADDRESS (XuiListButton)
  955.     sub[27] = SUBADDRESS (XuiListBox)
  956.     sub[28] = SUBADDRESS (XuiRange)
  957.     sub[29] = SUBADDRESS (XuiFile)
  958.     sub[30] = SUBADDRESS (XuiFont)
  959.     sub[31] = SUBADDRESS (XuiListDialog2B)
  960. '
  961.     grid$[ 0] = "XuiColor"
  962.     grid$[ 1] = "XuiLabel"
  963.     grid$[ 2] = "XuiCheckBox"
  964.     grid$[ 3] = "XuiRadioBox"
  965.     grid$[ 4] = "XuiPressButton"
  966.     grid$[ 5] = "XuiPushButton"
  967.     grid$[ 6] = "XuiToggleButton"
  968.     grid$[ 7] = "XuiRadioButton"
  969.     grid$[ 8] = "XuiScrollBarH"
  970.     grid$[ 9] = "XuiScrollBarV"
  971.     grid$[10] = "XuiTextLine"
  972.     grid$[11] = "XuiTextArea"
  973.     grid$[12] = "XuiMenu"
  974.     grid$[13] = "XuiMenuBar"
  975.     grid$[14] = "XuiPullDown"
  976.     grid$[15] = "XuiList"
  977.     grid$[16] = "XuiMessage1B"
  978.     grid$[17] = "XuiMessage2B"
  979.     grid$[18] = "XuiMessage3B"
  980.     grid$[19] = "XuiMessage4B"
  981.     grid$[20] = "XuiProgress"
  982.     grid$[21] = "XuiDialog2B"
  983.     grid$[22] = "XuiDialog3B"
  984.     grid$[23] = "XuiDialog4B"
  985.     grid$[24] = "XuiDropButton"
  986.     grid$[25] = "XuiDropBox"
  987.     grid$[26] = "XuiListButton"
  988.     grid$[27] = "XuiListBox"
  989.     grid$[28] = "XuiRange"
  990.     grid$[29] = "XuiFile"
  991.     grid$[30] = "XuiFont"
  992.     grid$[31] = "XuiListDialog2B"
  993. '
  994.     image$[ 0] = "$XBDIR\\xxx\\xcolor.bmp"
  995.     image$[ 1] = "$XBDIR\\xxx\\xlabel.bmp"
  996.     image$[ 2] = "$XBDIR\\xxx\\xcheckbx.bmp"
  997.     image$[ 3] = "$XBDIR\\xxx\\xradiobx.bmp"
  998.     image$[ 4] = "$XBDIR\\xxx\\xpress.bmp"
  999.     image$[ 5] = "$XBDIR\\xxx\\xpush.bmp"
  1000.     image$[ 6] = "$XBDIR\\xxx\\xtoggle.bmp"
  1001.     image$[ 7] = "$XBDIR\\xxx\\xradio.bmp"
  1002.     image$[ 8] = "$XBDIR\\xxx\\xscrollh.bmp"
  1003.     image$[ 9] = "$XBDIR\\xxx\\xscrollv.bmp"
  1004.     image$[10] = "$XBDIR\\xxx\\xtxtline.bmp"
  1005.     image$[11] = "$XBDIR\\xxx\\xtxtarea.bmp"
  1006.     image$[12] = "$XBDIR\\xxx\\xmenu.bmp"
  1007.     image$[13] = "$XBDIR\\xxx\\xmenubar.bmp"
  1008.     image$[14] = "$XBDIR\\xxx\\xpullist.bmp"
  1009.     image$[15] = "$XBDIR\\xxx\\xsclist.bmp"
  1010.     image$[16] = "$XBDIR\\xxx\\xmess1.bmp"
  1011.     image$[17] = "$XBDIR\\xxx\\xmess2.bmp"
  1012.     image$[18] = "$XBDIR\\xxx\\xmess3.bmp"
  1013.     image$[19] = "$XBDIR\\xxx\\xmess4.bmp"
  1014.     image$[20] = "$XBDIR\\xxx\\xprogres.bmp"
  1015.     image$[21] = "$XBDIR\\xxx\\xdialog2.bmp"
  1016.     image$[22] = "$XBDIR\\xxx\\xdialog3.bmp"
  1017.     image$[23] = "$XBDIR\\xxx\\xdialog4.bmp"
  1018.     image$[24] = "$XBDIR\\xxx\\xdropbut.bmp"
  1019.     image$[25] = "$XBDIR\\xxx\\xdropbox.bmp"
  1020.     image$[26] = "$XBDIR\\xxx\\xlistbut.bmp"
  1021.     image$[27] = "$XBDIR\\xxx\\xlistbox.bmp"
  1022.     image$[28] = "$XBDIR\\xxx\\xrange.bmp"
  1023.     image$[29] = "$XBDIR\\xxx\\xfile.bmp"
  1024.     image$[30] = "$XBDIR\\xxx\\xfont.bmp"
  1025.     image$[31] = "$XBDIR\\xxx\\xlist2b.bmp"
  1026. END SUB
  1027. END FUNCTION
  1028. '
  1029. '
  1030. ' ##################################
  1031. ' #####  CreateDisplayGrid ()  #####
  1032. ' ##################################
  1033. '
  1034. FUNCTION  CreateDisplayGrid ( label, x, y, w, h )
  1035.   STATIC  grid
  1036. '
  1037.   IFZ grid THEN
  1038.         XuiCreateWindow      (@grid, @"XuiLabel", x, y, w, h, 0, "")
  1039.         XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$CallbackWindow, -1)
  1040.         XuiSendStringMessage ( grid, @"SetWindowTitle", 0, 0, 0, 0, 0, @" Callback Arguments")
  1041.         XuiSendStringMessage ( grid, @"SetAlign", $$AlignUpperLeft, -1, -1, -1, 0, 0)
  1042.         XuiSendStringMessage ( grid, @"SetColor", $$Blue, $$LightGreen, -1, -1, 0, 0)
  1043.         XuiSendStringMessage ( grid, @"SetJustify", $$JustifyLeft, -1, -1, -1, 0, 0)
  1044.         XuiSendStringMessage ( grid, @"SetTexture", 0, 0, 0, 0, 0, 0)
  1045.         XuiSendStringMessage ( grid, @"DisplayWindow", 0, 0, 0, 0, 0, 0)
  1046.   END IF
  1047. '
  1048.   label = grid
  1049. END FUNCTION
  1050. '
  1051. '
  1052. ' ############################
  1053. ' #####  CreateGrids ()  #####
  1054. ' ############################
  1055. '
  1056. FUNCTION  CreateGrids (x, y, w, h, grid[])
  1057.     STATIC  short$[]
  1058.     STATIC  text$[]
  1059. '
  1060.     IFZ text$[] THEN GOSUB Initialize
  1061. '
  1062. '
  1063. ' create and configure the XuiColor window
  1064. '
  1065.     XuiCreateWindow      (@grid, @"XuiColor", x, y, w, h, 0, "")
  1066.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiColor, -1)
  1067.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1068.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1069.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1070.     grid[$$XuiColor] = grid
  1071. '
  1072.     XuiCreateWindow      (@grid, @"XuiLabel", x, y, w, h, 0, "")
  1073.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiLabel, -1)
  1074.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1075.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1076.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1077.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1078.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureRaise1, $$TextureRaise1, $$TextureRaise1, -1, 0, 0)
  1079.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1080.     grid[$$XuiLabel] = grid
  1081. '
  1082.     XuiCreateWindow      (@grid, @"XuiCheckBox", x, y, w, h, 0, "")
  1083.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiCheckBox, -1)
  1084.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1085.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1086.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1087.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1088.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1089.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1090.     grid[$$XuiCheckBox] = grid
  1091. '
  1092.     XuiCreateWindow      (@grid, @"XuiRadioBox", x, y, w, h, 0, "")
  1093.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiRadioBox, -1)
  1094.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1095.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1096.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1097.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1098.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1099.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1100.     grid[$$XuiRadioBox] = grid
  1101. '
  1102.     XuiCreateWindow      (@grid, @"XuiPressButton", x, y, w, h, 0, "")
  1103.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiPressButton, -1)
  1104.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1105.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1106.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1107.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1108.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1109.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1110.     grid[$$XuiPressButton] = grid
  1111. '
  1112.     XuiCreateWindow      (@grid, @"XuiPushButton", x, y, w, h, 0, "")
  1113.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiPushButton, -1)
  1114.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1115.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1116.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1117.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1118.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1119.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1120. '    XuiSendStringMessage ( grid, @"DisplayWindow", 0, 0, 0, 0, 0, 0)
  1121.     grid[$$XuiPushButton] = grid
  1122. '
  1123.     XuiCreateWindow      (@grid, @"XuiToggleButton", x, y, w, h, 0, "")
  1124.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiToggleButton, -1)
  1125.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1126.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1127.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1128.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1129.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1130.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1131.     grid[$$XuiToggleButton] = grid
  1132. '
  1133.     XuiCreateWindow      (@grid, @"XuiRadioButton", x, y, w, h, 0, "")
  1134.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiRadioButton, -1)
  1135.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1136.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1137.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1138.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 0, 0)
  1139.     XuiSendStringMessage ( grid, @"SetTexture", $$TextureLower1, $$TextureLower1, $$TextureLower1, -1, 0, 0)
  1140.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1141.     grid[$$XuiRadioButton] = grid
  1142. '
  1143.     XuiCreateWindow      (@grid, @"XuiScrollBarH", x, y, w, h, 0, "")
  1144.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiScrollBarH, -1)
  1145.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1146.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1147.     XuiSendStringMessage ( grid, @"SetPosition", 0, 25, 85, 100, 0, 0)
  1148.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1149.     grid[$$XuiScrollBarH] = grid
  1150. '
  1151.     XuiCreateWindow      (@grid, @"XuiScrollBarV", x, y, w, h, 0, "")
  1152.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiScrollBarV, -1)
  1153.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1154.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1155.     XuiSendStringMessage ( grid, @"SetPosition", 0, 25, 85, 100, 0, 0)
  1156.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1157.     grid[$$XuiScrollBarV] = grid
  1158. '
  1159.     XuiCreateWindow      (@grid, @"XuiTextLine", x, y, w, h, 0, "")
  1160.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiTextLine, -1)
  1161.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1162.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1163.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, " " + gridType$ + " ")
  1164.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1165.     grid[$$XuiTextLine] = grid
  1166. '
  1167.     XuiCreateWindow      (@grid, @"XuiTextArea", x, y, w, h, 0, "")
  1168.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiTextArea, -1)
  1169.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1170.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1171.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @grid$[])
  1172.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1173.     grid[$$XuiTextArea] = grid
  1174. '
  1175.     XuiCreateWindow      (@grid, @"XuiMenu", x, y, w, h, 0, "")
  1176.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMenu, -1)
  1177.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1178.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1179.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @text$[])
  1180.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1181.     grid[$$XuiMenu] = grid
  1182. '
  1183.     XuiCreateWindow      (@grid, @"XuiMenuBar", x, y, w, h, 0, "")
  1184.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMenuBar, -1)
  1185.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1186.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1187.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @"_File  _Edit  _Help")
  1188.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1189.     grid[$$XuiMenuBar] = grid
  1190. '
  1191.     XuiCreateWindow      (@grid, @"XuiPullDown", x, y, w, h, 0, "")
  1192.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiPullDown, -1)
  1193.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1194.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1195.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @pull$[])
  1196.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1197.     grid[$$XuiPullDown] = grid
  1198. '
  1199.     XuiCreateWindow      (@grid, @"XuiList", x, y, w, h, 0, "")
  1200.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiList, -1)
  1201.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1202.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1203.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1204.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1205.     grid[$$XuiList] = grid
  1206. '
  1207.     XuiCreateWindow      (@grid, @"XuiMessage1B", x, y, w, h, 0, "")
  1208.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMessage1B, -1)
  1209.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1210.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1211.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1212.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1213.     grid[$$XuiMessage1B] = grid
  1214. '
  1215.     XuiCreateWindow      (@grid, @"XuiMessage2B", x, y, w, h, 0, "")
  1216.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMessage2B, -1)
  1217.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1218.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1219.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1220.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1221.     grid[$$XuiMessage2B] = grid
  1222. '
  1223.     XuiCreateWindow      (@grid, @"XuiMessage3B", x, y, w, h, 0, "")
  1224.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMessage3B, -1)
  1225.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1226.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1227.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1228.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1229.     grid[$$XuiMessage3B] = grid
  1230. '
  1231.     XuiCreateWindow      (@grid, @"XuiMessage4B", x, y, w, h, 0, "")
  1232.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiMessage4B, -1)
  1233.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1234.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1235.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1236.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1237.     grid[$$XuiMessage4B] = grid
  1238. '
  1239.     XuiCreateWindow      (@grid, @"XuiProgress", x, y, w, h, 0, "")
  1240.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiProgress, -1)
  1241.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1242.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1243.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1244.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1245.     XuiSendStringMessage ( grid, @"SetValues", 10, 25, 75, 100, 0, 0)
  1246.     grid[$$XuiProgress] = grid
  1247. '
  1248.     XuiCreateWindow      (@grid, @"XuiDialog2B", x, y, w, h, 0, "")
  1249.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiDialog2B, -1)
  1250.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1251.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1252.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1253.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1254.     grid[$$XuiDialog2B] = grid
  1255. '
  1256.     XuiCreateWindow      (@grid, @"XuiDialog3B", x, y, w, h, 0, "")
  1257.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiDialog3B, -1)
  1258.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1259.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1260.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1261.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1262.     grid[$$XuiDialog3B] = grid
  1263. '
  1264.     XuiCreateWindow      (@grid, @"XuiDialog4B", x, y, w, h, 0, "")
  1265.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiDialog4B, -1)
  1266.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1267.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1268.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1269.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1270.     grid[$$XuiDialog4B] = grid
  1271. '
  1272.     XuiCreateWindow      (@grid, @"XuiDropButton", x, y, w, h, 0, "")
  1273.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiDropButton, -1)
  1274.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1275.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1276.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1277.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1278.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1279.     grid[$$XuiDropButton] = grid
  1280. '
  1281.     XuiCreateWindow      (@grid, @"XuiDropBox", x, y, w, h, 0, "")
  1282.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiDropBox, -1)
  1283.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1284.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1285.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1286.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1287.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 2, 0)
  1288.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1289.     grid[$$XuiDropBox] = grid
  1290. '
  1291.     XuiCreateWindow      (@grid, @"XuiListButton", x, y, w, h, 0, "")
  1292.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiListButton, -1)
  1293.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1294.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1295.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0, @gridType$)
  1296.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1297.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1298.     grid[$$XuiListButton] = grid
  1299. '
  1300.     XuiCreateWindow      (@grid, @"XuiListBox", x, y, w, h, 0, "")
  1301.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiListBox, -1)
  1302.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1303.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1304.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1305.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1306.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 2, 0)
  1307.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1308.     grid[$$XuiListBox] = grid
  1309. '
  1310.     XuiCreateWindow      (@grid, @"XuiRange", x, y, w, h, 0, "")
  1311.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiRange, -1)
  1312.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1313.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1314.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1315.     XuiSendStringMessage ( grid, @"SetColor", $$BrightGreen, -1, -1, -1, 2, 0)
  1316.     XuiSendStringMessage ( grid, @"SetColor", $$BrightCyan, -1, -1, -1, 3, 0)
  1317.     XuiSendStringMessage ( grid, @"SetValues", 10, 20, 0, 1000, 0, 0)
  1318.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1319.     grid[$$XuiRange] = grid
  1320. '
  1321.     XuiCreateWindow      (@grid, @"XuiFile", x, y, w, h, 0, "")
  1322.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiFile, -1)
  1323.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1324.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1325.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1326.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @short$[])
  1327.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1328.     grid[$$XuiFile] = grid
  1329. '
  1330.     XuiCreateWindow      (@grid, @"XuiFont", x, y, w, h, 0, "")
  1331.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiFont, -1)
  1332.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1333.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1334.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1335.     grid[$$XuiFont] = grid
  1336. '
  1337.     XuiCreateWindow      (@grid, @"XuiListDialog2B", x, y, w, h, 0, "")
  1338.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$XuiListDialog2B, -1)
  1339.     XuiSendStringMessage ( grid, @"GetGridTypeName", 0, 0, 0, 0, 0, @gridType$)
  1340.     XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0, @gridType$)
  1341.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 1, @gridType$)
  1342.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 2, @short$[])
  1343.     XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 3, @gridType$)
  1344.     XuiSendStringMessage ( grid, @"Resize", 0, 0, w, h, 0, 0)
  1345.     grid[$$XuiListDialog2B] = grid
  1346. '
  1347.     RETURN ($$FALSE)
  1348. '
  1349. '
  1350. ' *****  Initialize  *****
  1351. '
  1352. SUB Initialize
  1353.     DIM grid[31]
  1354.     DIM text$[11]
  1355.     DIM short$[7]
  1356.     DIM pull$[7]
  1357. '
  1358.     text$[ 0] = "_File"
  1359.     text$[ 1] = " _Load"
  1360.     text$[ 2] = " _Save"
  1361.     text$[ 3] = " _Quit"
  1362.     text$[ 4] = "_Edit"
  1363.     text$[ 5] = " _Cut"
  1364.     text$[ 6] = " _Grab"
  1365.     text$[ 7] = " _Paste"
  1366.     text$[ 8] = "_Help"
  1367.     text$[ 9] = " _Contents"
  1368.     text$[10] = " _Index"
  1369.     text$[11] = " _None"
  1370. '
  1371.     short$[0] = "Zero"
  1372.     short$[1] = "One"
  1373.     short$[2] = "Two"
  1374.     short$[3] = "Three"
  1375.     short$[4] = "Four"
  1376.     short$[5] = "Five"
  1377.     short$[6] = "Six"
  1378.     short$[7] = "Seven"
  1379. '
  1380.     pull$[0] = "_Zero"
  1381.     pull$[1] = "_One"
  1382.     pull$[2] = "_Two"
  1383.     pull$[3] = "Th_ree"
  1384.     pull$[4] = "_Four"
  1385.     pull$[5] = "F_ive"
  1386.     pull$[6] = "_Six"
  1387.     pull$[7] = "Se_ven"
  1388. END SUB
  1389. END FUNCTION
  1390. '
  1391. '
  1392. ' ################################
  1393. ' #####  DisplayCallback ()  #####
  1394. ' ################################
  1395. '
  1396. FUNCTION  DisplayCallback ( label, grid, message$, v0, v1, v2, v3, kid, r1$ )
  1397. '
  1398.   text$ = ""
  1399.   text$ = text$ + "   grid = " + STRING$ (grid) + "\n"
  1400.   text$ = text$ + "message = " + message$ + "\n"
  1401.   text$ = text$ + "     v0 = " + STRING$ (v0) + "\n"
  1402.   text$ = text$ + "     v1 = " + STRING$ (v1) + "\n"
  1403.   text$ = text$ + "     v2 = " + STRING$ (v2) + "\n"
  1404.   text$ = text$ + "     v3 = " + STRING$ (v3) + "\n"
  1405.   text$ = text$ + "    kid = " + STRING$ (kid) + "\n"
  1406.   text$ = text$ + "    r1$ = " + r1$
  1407. '
  1408.   XuiSendStringMessage (label, @"SetTextString", 0, 0, 0, 0, 0, @text$)
  1409.   XuiSendStringMessage (label, @"Redraw", 0, 0, 0, 0, 0, 0)
  1410. END FUNCTION
  1411. '
  1412. '
  1413. ' #################################
  1414. ' #####  CreateListWindow ()  #####
  1415. ' #################################
  1416. '
  1417. FUNCTION  CreateListWindow (grid, xx, yy, ww, hh, grid$[])
  1418. '
  1419.     XuiCreateWindow      (@grid, @"XuiList", xx, yy, ww, hh, 0, "")
  1420.     XuiSendStringMessage ( grid, @"SetCallback", grid, &XuiQueueCallbacks(), -1, -1, $$SwitchWindow, -1)
  1421.     XuiSendStringMessage ( grid, @"SetTextArray", 0, 0, 0, 0, 0, @grid$[])
  1422.     XuiSendStringMessage ( grid, @"DisplayWindow", 0, 0, 0, 0, 0, 0)
  1423. END FUNCTION
  1424. END PROGRAM
  1425.