home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / amodal.x < prev    next >
Text File  |  1996-01-19  |  2KB  |  54 lines

  1. '
  2. '
  3. ' ####################
  4. ' #####  PROLOG  #####
  5. ' ####################
  6. '
  7. PROGRAM    "amodal"
  8. VERSION    "0.0002"
  9. '
  10. IMPORT    "xgr"
  11. IMPORT    "xui"
  12. '
  13. DECLARE  FUNCTION  ModalDemo ()
  14. '
  15. ' ##########################
  16. ' #####  ModalDemo ()  #####
  17. ' ##########################
  18. '
  19. ' Demonstrate the following modal convenience functions,
  20. '     plus non-modal convenience function XuiGetReply().
  21. '
  22. ' XuiMessage (message$)
  23. ' XuiDialog (message$, default$, @kid, @reply$)
  24. ' XuiGetReply (grid, title$, message$, grids$, @v0, @v1, @kid, @reply$)
  25. ' XuiGetResponse (gridType$, title$, message$, grids$, @v0, @v1, @kid, @reply$)
  26. '
  27. FUNCTION  ModalDemo ()
  28.     default$ = "Default Input String"
  29.     XuiMessage ("To Display A Message\n\nXuiMessage(message$)\n\nPress Cancel\nTo Remove This Window")
  30.     XuiDialog ("To Input Text\n\nXuiDialog(message$,default$,@kid,@reply$)\n\nInput String or click Enter/Cancel", default$, @kid, @reply$)
  31.     XuiMessage ("Your Reply String Was\n\"" + reply$ + "\"\nReply kid # = " + STRING$(kid))
  32.     XuiGetResponse ("XuiMessage4B", "End Convenience Function Demo", "That's all folks", "Bye\nAdios\nOuttaHere\nCancel", 0, 0, @kid, "")
  33.     PRINT "You terminated with kid #"; kid
  34. '
  35. '
  36. ' Create and configure a window with convenience functions.
  37. ' Then call XuiGetReply() to operate it as a modal window.
  38. '
  39.     XuiCreateWindow (@grid, @"XuiDialog3B", 200, 200, 200, 100, 0, "")
  40.     XuiSendStringMessage (grid, @"SetColor", $$LightBlue, $$Yellow, -1, -1, 1, 0)
  41.     XuiSendStringMessage (grid, @"SetColorExtra", -1, -1, $$Black, $$Yellow, 1, 0)
  42.     XuiSendStringMessage (grid, @"SetColor", $$BrightGreen, -1, -1, -1, 3, 0)
  43.     XuiSendStringMessage (grid, @"SetColor", $$BrightCyan, -1, -1, -1, 4, 0)
  44.     XuiSendStringMessage (grid, @"SetColor", $$BrightMagenta, -1, -1, -1, 5, 0)
  45.     XuiSendStringMessage (grid, @"SetFocusColor", $$BrightGreen, -1, -1, -1, 3, 0)
  46.     XuiSendStringMessage (grid, @"SetFocusColor", $$BrightCyan, -1, -1, -1, 4, 0)
  47.     XuiSendStringMessage (grid, @"SetFocusColor", $$BrightMagenta, -1, -1, -1, 5, 0)
  48.     XuiSendStringMessage (grid, @"SetFont", 800, 600, 400, 0, 1, @"Serif")
  49.     XuiSendStringMessage (grid, @"SetTexture", $$TextureShadow, -1, -1, -1, 1, 0)
  50.     XuiGetReply (grid, @"XuiGetReply ( )", @"People Of Earth\n\nYou Must Leave", @"Default String\nOne\nTwo\nThree", @v0, @v1, @kid, @reply$)
  51.     PRINT HEX$(v0,8), HEX$(v1,8), kid, reply$
  52. END FUNCTION
  53. END PROGRAM
  54.