home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1996 May / PCDMAY.ISO / software / clarion / 3rdparty / tools / library / tooltip2.exe / TIP001.CLW < prev    next >
Encoding:
Text File  |  1995-06-02  |  6.9 KB  |  222 lines

  1.                      MEMBER('TIP.clw')            ! This is a MEMBER module
  2. Main PROCEDURE
  3.  
  4. LocalRequest         LONG,AUTO
  5. OriginalRequest      LONG,AUTO
  6. LocalResponse        LONG,AUTO
  7. WindowOpened         LONG
  8. WindowInitialized    LONG
  9. ForceRefresh         LONG,AUTO
  10. CurrentSelected  LONG,AUTO
  11. AppFrame             APPLICATION('Application'),AT(0,0,256,164),STATUS(-1,80,120,45),SYSTEM,MAX,RESIZE,IMM
  12.                        MENUBAR
  13.                          MENU('&File'),USE(?FileMenu)
  14.                            ITEM('P&rint Setup...'),USE(?PrintSetup),MSG('Setup Printer'),STD(STD:PrintSetup)
  15.                            ITEM,SEPARATOR
  16.                            ITEM('E&xit'),USE(?Exit),MSG('Exit this application'),STD(STD:Close)
  17.                          END
  18.                          MENU('&Edit'),USE(?EditMenu)
  19.                            ITEM('Cu&t'),USE(?Cut),MSG('Remove item to Windows Clipboard'),STD(STD:Cut)
  20.                            ITEM('&Copy'),USE(?Copy),MSG('Copy item to Windows Clipboard'),STD(STD:Copy)
  21.                            ITEM('&Paste'),USE(?Paste),MSG('Paste contents of Windows Clipboard'),STD(STD:Paste)
  22.                          END
  23.                          MENU('&Window'),MSG('Create and Arrange windows')
  24.                            ITEM('T&ile'),USE(?Tile),MSG('Make all open windows visible'),STD(STD:TileWindow)
  25.                            ITEM('&Cascade'),USE(?Cascade),MSG('Stack all open windows'),STD(STD:CascadeWindow)
  26.                            ITEM('&Arrange Icons'),USE(?Arrange),MSG('Align all window icons'),STD(STD:ArrangeIcons)
  27.                          END
  28.                          MENU('&Help'),MSG('Windows Help')
  29.                            ITEM('&Contents'),USE(?Helpindex),MSG('View the contents of the help file'),STD(STD:HelpIndex)
  30.                            ITEM('&Search for Help On...'),USE(?HelpSearch),MSG('Search for help on a subject'),STD(STD:HelpSearch)
  31.                            ITEM('&How to Use Help'),USE(?HelpOnHelp),MSG('How to use Windows Help'),STD(STD:HelpOnHelp)
  32.                          END
  33.                        END
  34.                        TOOLBAR,AT(0,0,256,12)
  35.                          REGION,AT(8,0,16,10),USE(?Region1),IMM
  36.                          REGION,AT(28,0,16,10),USE(?Region2),IMM
  37.                          REGION,AT(48,0,16,10),USE(?Region3),IMM
  38.                          REGION,AT(68,0,16,10),USE(?Region4),IMM
  39.                          BUTTON('1'),AT(8,0,16,10),USE(?Button1)
  40.                          BUTTON('2'),AT(28,0,16,10),USE(?Button2)
  41.                          BUTTON('3'),AT(48,0,16,10),USE(?Button3)
  42.                          BUTTON('4'),AT(68,0,16,10),USE(?Button4)
  43.                        END
  44.                      END
  45.   CODE
  46.   LocalRequest = GlobalRequest
  47.   OriginalRequest = GlobalRequest
  48.   LocalResponse = RequestCancelled
  49.   ForceRefresh = False
  50.   CLEAR(GlobalRequest)
  51.   CLEAR(GlobalResponse)
  52.   OPEN(AppFrame)
  53.   WindowOpened=True
  54.   ACCEPT
  55.     CASE EVENT()
  56.     OF EVENT:OpenWindow
  57.       IF NOT WindowInitialized
  58.         DO InitializeWindow
  59.         WindowInitialized = True
  60.       END
  61.     OF EVENT:GainFocus
  62.       IF NOT WindowInitialized
  63.         WindowInitialized = True
  64.         DO InitializeWindow
  65.       ELSE
  66.         ForceRefresh = True
  67.         DO RefreshWindow
  68.       END
  69.     END
  70.     CASE FIELD()
  71.     OF ?PrintSetup
  72.       CASE EVENT()
  73.       OF EVENT:Accepted
  74.         DO SyncWindow
  75.       END
  76.     OF ?Exit
  77.       CASE EVENT()
  78.       OF EVENT:Accepted
  79.         DO SyncWindow
  80.       END
  81.     OF ?Cut
  82.       CASE EVENT()
  83.       OF EVENT:Accepted
  84.         DO SyncWindow
  85.       END
  86.     OF ?Copy
  87.       CASE EVENT()
  88.       OF EVENT:Accepted
  89.         DO SyncWindow
  90.       END
  91.     OF ?Paste
  92.       CASE EVENT()
  93.       OF EVENT:Accepted
  94.         DO SyncWindow
  95.       END
  96.     OF ?Tile
  97.       CASE EVENT()
  98.       OF EVENT:Accepted
  99.         DO SyncWindow
  100.       END
  101.     OF ?Cascade
  102.       CASE EVENT()
  103.       OF EVENT:Accepted
  104.         DO SyncWindow
  105.       END
  106.     OF ?Arrange
  107.       CASE EVENT()
  108.       OF EVENT:Accepted
  109.         DO SyncWindow
  110.       END
  111.     OF ?Helpindex
  112.       CASE EVENT()
  113.       OF EVENT:Accepted
  114.         DO SyncWindow
  115.       END
  116.     OF ?HelpSearch
  117.       CASE EVENT()
  118.       OF EVENT:Accepted
  119.         DO SyncWindow
  120.       END
  121.     OF ?HelpOnHelp
  122.       CASE EVENT()
  123.       OF EVENT:Accepted
  124.         DO SyncWindow
  125.       END
  126.     OF ?Region1
  127.       CASE EVENT()
  128.       OF EVENT:Accepted
  129.         post(event:closewindow,,y)
  130.       OF EVENT:MouseIn
  131.         gxpos=mousex()
  132.         gypos=mousey()+10
  133.         tipmsg='This is Button 1.' ! and he does thus and such'
  134.         x=start(tippee,20000)
  135.       OF EVENT:MouseOut
  136.         post(event:closewindow,,y)
  137.       END
  138.     OF ?Region2
  139.       CASE EVENT()
  140.       OF EVENT:Accepted
  141.         post(event:closewindow,,y)
  142.       OF EVENT:MouseIn
  143.         gxpos=mousex()
  144.         gypos=mousey()+10
  145.         tipmsg='This is Button 2. Like Button 1, it uses a text control. Buttons 3 & 4 use a box control & a string control with variables. The box control has the yellow color used in MS Office.'
  146.         x=start(tippee,20000)
  147.       OF EVENT:MouseOut
  148.         post(event:closewindow,,y)
  149.       END
  150.     OF ?Region3
  151.       CASE EVENT()
  152.       OF EVENT:Accepted
  153.         post(event:closewindow,,y)
  154.       OF EVENT:MouseIn
  155.         gxpos=mousex()
  156.         gypos=mousey()+10
  157.         yellowmsg='Yellow Button 3'
  158.         x=start(yellowtip,20000)
  159.       OF EVENT:MouseOut
  160.         post(event:closewindow,,y)
  161.       END
  162.     OF ?Region4
  163.       CASE EVENT()
  164.       OF EVENT:Accepted
  165.         post(event:closewindow,,y)
  166.       OF EVENT:MouseIn
  167.         gxpos=mousex()
  168.         gypos=mousey()+10
  169.         yellowmsg='Yellow Button 4'
  170.         x=start(yellowtip,20000)
  171.       OF EVENT:MouseOut
  172.         post(event:closewindow,,y)
  173.       END
  174.     OF ?Button1
  175.       CASE EVENT()
  176.       OF EVENT:Accepted
  177.         DO SyncWindow
  178.       END
  179.     OF ?Button2
  180.       CASE EVENT()
  181.       OF EVENT:Accepted
  182.         DO SyncWindow
  183.       END
  184.     OF ?Button3
  185.       CASE EVENT()
  186.       OF EVENT:Accepted
  187.         DO SyncWindow
  188.       END
  189.     OF ?Button4
  190.       CASE EVENT()
  191.       OF EVENT:Accepted
  192.         DO SyncWindow
  193.       END
  194.     END
  195.   END
  196.   DO ProcedureReturn
  197. !---------------------------------------------------------------------------
  198. ProcedureReturn ROUTINE
  199.   IF WindowOpened
  200.     CLOSE(AppFrame)
  201.   END
  202.   IF LocalResponse
  203.     GlobalResponse = LocalResponse
  204.   ELSE
  205.     GlobalResponse = RequestCancelled
  206.   END
  207.   RETURN
  208. !---------------------------------------------------------------------------
  209. InitializeWindow ROUTINE
  210.   DO RefreshWindow
  211. !---------------------------------------------------------------------------
  212. RefreshWindow ROUTINE
  213.   CurrentSelected = SELECTED()
  214.   DISPLAY()
  215.   ForceRefresh = False
  216.   IF SELECTED() <> CurrentSelected
  217.     SELECT(CurrentSelected)
  218.   END
  219. !---------------------------------------------------------------------------
  220. SyncWindow ROUTINE
  221. !---------------------------------------------------------------------------
  222.