home *** CD-ROM | disk | FTP | other *** search
/ synchro.net / synchro.net.tar / synchro.net / modem.madness / SMMPROG / PBGUI200.ZIP / REGISTER.BAS < prev    next >
Encoding:
BASIC Source File  |  1993-07-17  |  8.7 KB  |  413 lines

  1.  
  2. $COMPILE EXE
  3. $ALIAS DATA AS "_DATA"
  4. $DYNAMIC
  5. DEFINT A-Z
  6. $INCLUDE "PBGUI200.BI"
  7. $LINK "PBGUI200.PBL"
  8.  
  9. DIM AllBlack (0:15) AS SHARED INTEGER,_
  10.     AllColor (0:15) AS SHARED INTEGER
  11. REDIM TestState(10) AS SHARED BYTE
  12. '***** Fill the Arrays
  13.  
  14.   FOR X = 0 TO 15
  15.     AllBlack(X) = 0
  16.     AllColor(X) = X
  17.   NEXT X
  18. '***** Set the graphics mode
  19.  
  20.   SCREEN 12
  21.  
  22.   WindowInit
  23.   ColorInit
  24.   MouseInit
  25.  
  26.  
  27.   MouseHide
  28. PALETTE USING AllBlack(0)
  29.    Shadow = %FALSE
  30.    ShadowColor = 3
  31.    Raised = %TRUE
  32.    RaisedColor = 1
  33. LoadWindow "register.000"
  34.  
  35.  
  36. '***** The following lines were used to create the window then commented
  37. '***** out and subsituted with LoadWindow.
  38.  
  39.  
  40. $IF 0
  41.     NextWin = WindowNext
  42.     CharSpace=3
  43.     Bold=%FALSE
  44.     Shadow = %TRUE
  45.     FontLoaded=LoadFont("mark18")
  46.     IF FontLoaded = 0 THEN
  47.       screen 0
  48.     BEEP:BEEP:BEEP
  49.     Print "NO FONT FIND"
  50.     END IF
  51.  
  52.  
  53.  
  54.  
  55.  
  56.    WOT.handle = NextWin
  57.    WOT.row1 = 8
  58.    WOT.col1 = 8
  59.    WOT.row2 = 369
  60.    WOT.col2 = 629
  61.    WOT.LightColor = 1
  62.    WOT.BackColor = 2
  63.    WOT.DarkColor = 3
  64.    WOT.TextColor = 5
  65.    WOT.BorderColor = 3
  66.    WOT.Title = "PBGUI TOOLKIT REGISTRATION" + CHR$(0)
  67.    WOT.Savebkgd = %FALSE
  68.    GUILib %MakeWindow
  69.    CharSpace = 2
  70.    ThreeDBox %UP,20,10,240,360
  71.    ThreeDBox %UP,20,380,140,600
  72.    ThreeDLine %UP,%HORZ,45,380,220
  73.    ThreeDLine %UP,%VERT,47,490,92
  74.    THreeDLine %UP,%HORZ,75,380,109
  75.    THreeDLine %UP,%HORZ,75,491,108
  76.  
  77.    Panel %UP,150,380,205,600,1
  78.    ThreeDBox %DOWN,270,110,290,470
  79.    'Panel %UP,270,130,290,490,1
  80.    ShadowColor = 1
  81.    Shadow = %FALSE
  82.  
  83.    Raised = %FALSE
  84.    Shadow = %TRUE
  85.    ShadowColor = 1
  86.    BOT.handle = 1
  87.    BOT.ButtonType = 1
  88.    BOT.state = %Active
  89.    BOT.row1 = 215
  90.    BOT.row2 = 240
  91.    BOT.TextColor = 6
  92.    BOT.BackColor = 2
  93.    BOT.LightColor = 1
  94.    BOT.DarkColor = 3
  95.    BOT.col1 = 500
  96.    BOT.col2 = 600
  97.    BOT.FontID.Filename="dub10b"
  98.    BOT.Text = "QUIT"+CHR$(0)
  99.    GUILib %MakeButton
  100.  
  101.    BOT.handle = 2
  102.    BOT.ButtonType = 1
  103.    BOT.state = %Active
  104.    BOT.row1 = 215
  105.    BOT.row2 = 240
  106.    BOT.TextColor = 9
  107.    BOT.BackColor = 2
  108.    BOT.LightColor = 1
  109.    BOT.DarkColor = 3
  110.    BOT.col1 = 380
  111.    BOT.col2 = 480
  112.    BOT.FontID.Filename="dub10b"
  113.    BOT.Text = "PRINT"+CHR$(0)
  114.    GUILib %MakeButton
  115.  
  116.  
  117.  
  118.    FontLoaded = LoadFont("dub10b")
  119.  
  120.    Shadow = %FALSE
  121.    ShadowColor = 3
  122.    Raised = %TRUE
  123.    RaisedColor = 1
  124.    labelColor = 9
  125.  
  126.   BOT.handle = 3
  127.    BOT.ButtonType = %RadioButton
  128.    BOT.state = %NotActive
  129.    BOT.row1 = 90
  130.    BOT.col1 = 410
  131.    BOT.TextColor = 6
  132.    BOT.Text = "360K"+CHR$(0)
  133.    GUILib %MakeButton
  134.  
  135.  
  136.    BOT.handle = 4
  137.    BOT.state = %NotActive
  138.    BOT.col1 = 520
  139.    BOT.Text = "720K"+CHR$(0)
  140.    GUILib %MakeButton
  141.  
  142.  
  143.    BOT.handle = 5
  144.    BOT.state = %NotActive
  145.    BOT.row1 = 110
  146.    BOT.col1 = 410
  147.    BOT.Text ="1.2M"+CHR$(0)
  148.    GUILib %MakeButton
  149.  
  150.  
  151.    BOT.handle = 6
  152.    BOT.state = %Active
  153.    BOT.Text = "1.4M"+CHR$(0)
  154.    BOT.col1 = 520
  155.    GUILib %MakeButton
  156.    INCR BOT.row1,30
  157.  
  158.  
  159.  
  160.  
  161.    WindowPrint 24,20,"Name"+CHR$(0),LabelColor,0
  162. '***** Create an EditField
  163.    EFOT.handle = 1
  164.    EFOT.state = %Active
  165.    EFOT.Length = 40
  166.  
  167.  
  168.    EFOT.text = SPACE$(EFOT.Length)+CHR$(0)
  169.    EFOT.row =40
  170.    EFOT.col = 17
  171.    EFOT.ForeColor = 15
  172.    EFOT.BackColor = 8
  173.    GUILib %MakeEditField
  174.  
  175.  
  176.    INCR EFOT.row,24
  177.    WindowPrint EFOT.row,20,"Address 1"+CHR$(0),LabelColor,0
  178.  
  179.    INCR EFOT.row, 16
  180.  
  181.    EFOT.handle = 2
  182.    GUILib %MakeEditField
  183.  
  184.    INCR EFOT.row, 24
  185.    WindowPrint EFOT.row,20,"Address 2"+CHR$(0),LabelColor,0
  186.  
  187.    INCR EFOT.row,16
  188.  
  189.    EFOT.handle = 3
  190.    GUILib %MakeEditField
  191.    INCR EFOT.row,24
  192.    WindowPrint EFOT.row,20,"Address 3"+CHR$(0),LabelColor,0
  193.  
  194.    INCR EFOT.row,16
  195.  
  196.    EFOT.handle = 4
  197.    EFOT.Length = 40
  198.    EFOT.text = SPACE$(EFOT.Length)+CHR$(0)
  199.    GUILib %MakeEditField
  200.    INCR EFOT.row ,24
  201.    WindowPrint EFOT.row,20,"Address 4"+CHR$(0),LabelColor,0
  202.  
  203.    INCR EFOT.row ,16
  204.  
  205.    EFOT.handle = 5
  206.    EFOT.Length = 40
  207.    EFOT.text = SPACE$(EFOT.Length)+CHR$(0)
  208.    GUILib %MakeEditField
  209.    INCR EFOT.col,EFOT.Length * 8 + 32
  210.  
  211.    FontLoaded = LoadFont("DUB12B")
  212.    WindowPrint 25,450,"Disk Size"+CHR$(0),6,0
  213.  
  214.    WindowPrint 55,400,"  5 1/4           3 1/2"+CHR$(0),6,0
  215.    Raised = %FALSE
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.    FontLoaded = LoadFont("dub8")
  223.    Raised = %FALSE
  224.    Shadow = %FALSE
  225.    WindowPrint 160,385,"    Registration Fee          $40.00"+CHR$(0),0,0
  226.    WindowPrint 180,385,"    Outside USA add           $5.00"+CHR$(0),0,0
  227.    FontLoaded = LoadFont("dub10")
  228.    WindowPrint 274,120, "PBGUI TOOLKIT 2.00 copyright  1993 James C. Fuller"+CHR$(0),0,0
  229.  
  230.  
  231.    Raised = %TRUE
  232. $ENDIF
  233.  
  234.  
  235.  
  236.    MousePosition 430,420
  237.    NumberOfEditFields = 5
  238.    ExitFlag = 0
  239.    EditField = 1
  240.    Button2State = 0
  241.    DiskState = 6
  242.    Palette Using AllColor(0)
  243.    MouseShow
  244.    WHILE NOT ExitFlag
  245.         GetEvent EditField
  246.        SELECT CASE Event(0)
  247.      CASE -63
  248.        MouseHide
  249.        SaveWindow "REGISTER.000"
  250.        MouseShow
  251.        screen 1
  252.        end
  253.  
  254.      CASE 1                 'Button Event
  255.        SELECT CASE Event(1)
  256.          CASE 1
  257.            ExitFlag = %TRUE
  258.  
  259.          CASE 2
  260.            PrintForm DiskState
  261.          CASE 3 TO 6
  262.          ButtonSetState DiskState,%NotActive
  263.          DiskState = Event(1)
  264.          ButtonSetState DiskState,%Active
  265.  
  266.        END SELECT
  267.  
  268.     CASE 2                    '***** Edit Event ******
  269.       IF EditFieldGetState(Event(2)) = %Active THEN EditField = Event(2)
  270.     CASE 3 TO 4                '***** Enter, or TAB ********
  271.        DO
  272.          INCR EditField
  273.          IF EditField > NumberOfEditFields THEN EditField = 1
  274.          IF EditFieldGetState(EditField) = %Active THEN EXIT DO
  275.        LOOP
  276.       END SELECT
  277.    WEND
  278.  
  279.    CloseWindow
  280.  
  281.  
  282. SUB PrintForm(DiskSize)
  283. Ok=CheckPrinter
  284. If Ok= 0 then
  285.   CharSpace = 2
  286.   Raised = %FALSE
  287.   Shadow = %TRUE
  288.   ShadowColor = 0
  289.   MBDT.BoxLightColor = 1
  290.   MBDT.BoxBackColor = 2
  291.   MBDT.BoxDarkColor = 3
  292.   MBDT.BoxTextColor = 6
  293.   MBDT.BoxBorderColor = 3
  294.   MBDT.ButBackColor = 2
  295.   MBDT.ButLightColor = 1
  296.   MBDT.ButDarkColor = 3
  297.   MBDT.ButTextColor = 13
  298.   MBDT.FontID.FileName = "DUB14B"
  299.   MBDT.ButOneText = "RETRY" +CHR$(0)
  300.   MBDT.ButTwoText = "QUIT" +CHR$(0)
  301.  
  302.   REDIM message(1 TO 1) as string
  303.   Message(1) = "Printer Has Failed"
  304.  
  305.   DO
  306.   BEEP:BEEP
  307.   WhatToDo = MessageBox(Message())
  308.   IF WhatToDo = 1 THEN
  309.     Ok = CheckPrinter
  310.     IF ISTRUE Ok THEN EXIT DO
  311.   ELSE
  312.     END
  313.   END IF
  314.  
  315.   LOOP
  316.  Shadow = %FALSE
  317.  ShadowColor = 3
  318.  Raised = %TRUE
  319.  
  320.  
  321.  
  322.  
  323. END IF
  324.  
  325. LPRINT
  326. LPRINT
  327. LPRINT
  328. LPRINT"           <<<<    PBGUI TOOLKIT 2.00 REGISTRATION FORM    >>>>"
  329. LPRINT
  330. LPRINT"    ================================================================"
  331. LPRINT
  332. LPRINT"    The PBGUI TOOLKIT is priced at $40.00 payable to: James C. Fuller"
  333. LPRINT"    Outside U.S.A. Please add $5.00."
  334. LPRINT"    All  checks  must  be in U.S. currency drawn on  U.S.  banks.  If"
  335. LPRINT"    outside the U.S. please use an international money order."
  336. LPRINT
  337. LPRINT"    ================================================================"
  338. LPRINT"    Mailing Address:"
  339. LPRINT
  340. FOR x = 1 to 5
  341.   LPRINT TAB(20) GetEditField(x)
  342. NEXT x
  343.  
  344. LPRINT
  345.  
  346. SELECT CASE DiskSize
  347.  
  348.   CASE 3
  349.    LPRINT"    DISK SIZE: 5 1/4"+CHR$(34)+"  360K"
  350.   CASE 4
  351.    LPRINT"    DISK SIZE: 3 1/2"+CHR$(34)+"  720K"
  352.   CASE 5
  353.    LPRINT"    DISK SIZE: 5 1/4"+CHR$(34)+"  1.2M"
  354.   CASE 6
  355.    LPRINT"    DISK SIZE: 3 1/2"+CHR$(34)+"  1.4M"
  356.  
  357. END SELECT
  358. LPRINT"    ================================================================"
  359. LPRINT
  360.  
  361.  
  362.  
  363.  
  364. LPRINT"    Please mail this form to :"
  365. LPRINT
  366. LPRINT TAB(20)"James C. Fuller"
  367. LPRINT TAB(20)"59 White Birch Estates"
  368. LPRINT TAB(20)"Fort Edward, NY 12828-9248
  369. LPRINT
  370. LPRINT"    ================================================================"
  371. LPRINT"    Benefits of Registration:"
  372. LPRINT
  373. LPRINT"        My Copyright message removed"
  374. LPRINT
  375. LPRINT"        50+ More Fonts."
  376. LPRINT
  377. LPRINT"        First to be notified of Font converter when completed"
  378. LPRINT
  379. LPRINT"        Low upgrade price for the deluxe version of the toolkit to be"
  380. LPRINT"        released this fall."
  381. LPRINT
  382. LPRINT
  383. LPRINT
  384. LPRINT"    COMMENTS:
  385. LPRINT
  386. LPRINT"    ________________________________________________________________"
  387. LPRINT
  388. LPRINT"    ________________________________________________________________"
  389. LPRINT
  390. LPRINT"    ________________________________________________________________"
  391. LPRINT
  392. LPRINT"    ________________________________________________________________"
  393. LPRINT
  394. LPRINT"    ________________________________________________________________"
  395. LPRINT
  396. LPRINT"    ________________________________________________________________"
  397. LPRINT
  398. LPRINT"    ________________________________________________________________"
  399.  
  400. LPRINT CHR$(12)
  401. END SUB
  402.  
  403. FUNCTION CheckPrinter%
  404.   !xor    ax,ax
  405.   !mov    ah,2
  406.   !mov    dx,0
  407.   !int    &H17
  408.   !cmp  ah,&H90
  409.   !jnz  NotReady
  410.   CheckPrinter% = -1
  411.   EXIT FUNCTION
  412. NotReady:
  413.   CheckPrinter% = 0
  414. END FUNCTION