home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / slfinsta.zip / scripts / page2.cmd < prev    next >
OS/2 REXX Batch file  |  2000-03-26  |  6KB  |  192 lines

  1. /* $Id: page2.cmd,v 1.1 2000/03/27 04:53:12 ktk Exp $ */
  2.  
  3. /* REXX script to create second installer dialog page. */
  4.  
  5. /* Some System Defines */
  6. BOXHORZ = 0
  7. BOXVERT = 1
  8. HWND_DESKTOP = 1
  9. HWND_OBJECT = 2
  10. FCF_TITLEBAR =     x2d("1")
  11. FCF_SYSMENU = x2d("2")
  12. FCF_MENU = x2d("4")
  13. FCF_SIZEBORDER = x2d("8")
  14. FCF_MINBUTTON = x2d("10")
  15. FCF_MAXBUTTON = x2d("20")
  16. /*FCF_MINMAX = FCF_MINBUTTON | FCF_MAXBUTTON*/
  17. FCF_VERTSCROLL = x2d("40")
  18. FCF_HORZSCROLL = x2d("80")
  19. FCF_DLGBORDER = x2d("100")
  20. FCF_BORDER = x2d("200")
  21. FCF_SHELLPOSITION = x2d("400")
  22. FCF_TASKLIST = x2d("800")
  23. FCF_NOBYTEALIGN = x2d("1000")
  24. FCF_NOMOVEWITHOWNER = x2d("2000")
  25. FCF_ICON = x2d("4000")
  26. FCF_ACCELTABLE = x2d("8000")
  27. FCF_SYSMODAL = x2d("10000")
  28. FCF_SCREENALIGN = x2d("20000")
  29. FCF_MOUSEALIGN = x2d("40000")
  30. FCF_PALETTE_NORMAL = x2d("80000")
  31. FCF_PALETTE_HELP = x2d("100000")
  32. FCF_PALETTE_POPUPODD = x2d("200000")
  33. FCF_PALETTE_POPUPEVEN = x2d("400000")
  34. FCF_HIDEBUTTON = x2d("1000000")
  35. FCF_HIDEMAX = x2d("1000020")
  36. /*FCF_AUTOICON = x2d("40000000")*/
  37. FCF_STANDARD = x2d("cc3f")
  38. DT_LEFT = x2d("00000000")
  39. DT_QUERYEXTENT = x2d("00000002")
  40. DT_UNDERSCORE = x2d("00000010")
  41. DT_STRIKEOUT = x2d("00000020")
  42. DT_TEXTATTRS = x2d("00000040")
  43. DT_EXTERNALLEADING = x2d("00000080")
  44. DT_CENTER = x2d("00000100")
  45. DT_RIGHT = x2d("00000200")
  46. DT_TOP = x2d("00000000")
  47. DT_VCENTER = x2d("00000400")
  48. DT_BOTTOM = x2d("00000800")
  49. DT_HALFTONE = x2d("00001000")
  50. DT_MNEMONIC = x2d("00002000")
  51. DT_WORDBREAK = x2d("00004000")
  52. DT_ERASERECT = x2d("00008000")
  53. CLR_ERROR = -255
  54. CLR_NOINDEX = -254
  55. CLR_FALSE = -5
  56. CLR_TRUE = -4
  57. CLR_DEFAULT = -3
  58. CLR_WHITE = -2
  59. CLR_BLACK = -1
  60. CLR_BACKGROUND = 0
  61. CLR_BLUE = 1
  62. CLR_RED    = 2
  63. CLR_PINK = 3
  64. CLR_GREEN =4
  65. CLR_CYAN = 5
  66. CLR_YELLOW = 6
  67. CLR_NEUTRAL = 7
  68. CLR_DARKGRAY = 8
  69. CLR_DARKBLUE = 9
  70. CLR_DARKRED = 10
  71. CLR_DARKPINK = 11
  72. CLR_DARKGREEN = 12
  73. CLR_DARKCYAN = 13
  74. CLR_BROWN = 14
  75. CLR_PALEGRAY = 15
  76. TRUE = 1
  77. FALSE = 0
  78.  
  79. /*flStyle = FCF_SYSMENU | FCF_TITLEBAR | FCF_SHELLPOSITION | FCF_TASKLIST | FCF_DLGBORDER*/
  80.         
  81. /* Read the checkbox variable we saved from the first script */
  82. checkbox = inst_findvar("checkbox")
  83.  
  84. if inst_querycheck(checkbox) = 0 then do
  85.         call inst_mesg "Please accept the terms of the agreement or exit."
  86.         /* Reinstall the button handlers since they get removed after each script ends */
  87.         call inst_setbutton 1001, "page2.cmd"
  88.         call inst_setbutton 1003, "exit"
  89.         exit 0
  90. end /* do */
  91.  
  92. if arg(1) > 0 then
  93.         call dw_window_destroy arg(1)
  94.  
  95. mainwindow = dw_window_new(HWND_DESKTOP, "Installing PMBitchX 1.0c16", 3331)
  96.  
  97. /* This number must corespond to a resource ID in the bound resources */
  98. call dw_window_set_icon mainwindow, 2000
  99.  
  100. bigbox = dw_box_new(BOXVERT, 10)
  101.  
  102. call dw_box_pack_start mainwindow, bigbox, 0, 0, TRUE, 0
  103.  
  104. mainbox = dw_box_new(BOXHORZ, 10)
  105.  
  106. call dw_box_pack_start bigbox, mainbox, 0, 0, TRUE, 0
  107.  
  108. logo = dw_bitmap_new(1001)
  109.  
  110. /* This number must corespond to a resource ID in the bound resources */
  111. call dw_window_set_bitmap logo, 2001
  112.  
  113. call dw_box_pack_start mainbox, logo, 100, 275, FALSE, 5
  114.  
  115. custombox = dw_box_new(BOXVERT, 10)
  116.  
  117. call dw_box_pack_start mainbox, custombox, 0, 0, TRUE, 5
  118.  
  119. /*stext = dw_text_new("Choose installation directory", 0)
  120.  
  121. call dw_window_set_style stext, DT_VCENTER, DT_VCENTER
  122.  
  123. call dw_box_pack_start custombox, stext, 300, 15, TRUE, 10*/
  124.  
  125. entryfield = dw_entryfield_new("c:\PMBitchX", 104)
  126.  
  127. call dw_box_pack_start custombox, entryfield, 300, 15, TRUE, 10
  128.  
  129. container = dw_container_new(106)
  130.  
  131. call dw_box_pack_start custombox, container, 300, 200, TRUE, 10
  132.  
  133. /*combobox = dw_combobox_new("", 105)
  134.  
  135. call dw_box_pack_start custombox, combobox, 300, 30, TRUE, 10*/
  136.  
  137. buttonbox = dw_box_new(BOXHORZ, 5)
  138.  
  139. call dw_box_pack_start bigbox, buttonbox, 0, 0, TRUE, 0
  140.  
  141. exitbutton = dw_button_new("Exit Installer", 1003)
  142.  
  143. call inst_setbutton 1003, "exit"
  144.  
  145. call dw_box_pack_start buttonbox, exitbutton, 100, 30, TRUE, 0
  146.  
  147. blanktext = dw_text_new("", 0)
  148.  
  149. call dw_box_pack_start buttonbox, blanktext, 150, 30, TRUE, 0
  150.  
  151. backbutton = dw_button_new("<< Back", 1002)
  152.  
  153. call inst_setbutton 1002, "page1.cmd"
  154.  
  155. call dw_box_pack_start buttonbox, backbutton, 60, 30, TRUE, 0
  156.  
  157. nextbutton = dw_button_new("Next >>", 1001)
  158.  
  159. call inst_setbutton 1001, "page3.cmd"
  160.  
  161. call dw_box_pack_start buttonbox, nextbutton, 60, 30, TRUE, 0
  162.  
  163. /* Set some nice fonts and colors */
  164. call dw_window_set_color bigbox, CLR_PALEGRAY, CLR_PALEGRAY
  165. call dw_window_set_color mainbox, CLR_PALEGRAY, CLR_PALEGRAY
  166. call dw_window_set_color custombox, CLR_PALEGRAY, CLR_PALEGRAY
  167. call dw_window_set_color lbbox, CLR_PALEGRAY, CLR_PALEGRAY
  168. call dw_window_set_color buttonbox, CLR_PALEGRAY, CLR_PALEGRAY
  169. call dw_window_set_color directionbox, CLR_PALEGRAY, CLR_PALEGRAY
  170. call dw_window_set_font stext, "9.WarpSans"
  171. call dw_window_set_font mle, "9.WarpSans"
  172. call dw_window_set_color stext, CLR_BLACK, CLR_PALEGRAY
  173. call dw_window_set_color blanktext, CLR_BLACK, CLR_PALEGRAY
  174. call dw_window_set_font listbox, "9.WarpSans"
  175. call dw_window_set_font nextbutton, "9.WarpSans"
  176. call dw_window_set_font backbutton, "9.WarpSans"
  177. call dw_window_set_font exitbutton, "9.WarpSans"
  178. call dw_window_set_font container, "9.WarpSans"
  179. call dw_window_set_font entryfield, "9.WarpSans"
  180. call dw_window_set_font combobox, "9.WarpSans"
  181.  
  182. newx = (dw_screen_width()-500)/2
  183. newy = (dw_screen_height()-400)/2
  184.  
  185. call dw_window_set_pos_size mainwindow, newx, newy, 500, 400
  186.  
  187. call dw_window_show mainwindow
  188.  
  189. call inst_setwindow mainwindow
  190.  
  191. call inst_setdircontainer container, entryfield, combobox
  192.