home *** CD-ROM | disk | FTP | other *** search
-
- Listing 2:
-
-
- * Get the handle of the parent process
- WinMain = WIN_Me()
- KeyMain = KEY_Me()
-
- * Assign mouse handle to memvar
- PtrMain = PTR_New()
- * Attach mouse object to main process window
- PTR_Open(PtrMain, WinMain )
-
- * Assign a window to a subtask (5 rows deep and 20 columns wide)
- WinSub = WIN_New("Subtask Window Title", 5, 20)
- * Associate a keyboard object with the subtask window:
- * First get the keyboard object's handle
- KeySub = KEY_New()
- * Now attach it to the subtask:
- KEY_Open( KeySub, WinSub )
- * Maybe you'll want to receive mail? Open a mailbox:
- MalSub = MAL_New()
-
- * Locate the window at a specified row, column
- WIN_Move( WinSub, 19, 40)
- * Use this Clipper API extension instead of several numeric attributes
- WIN_SetColor(WinSub, "BG+/B,R+/W,,,n/W")
- WIN_AtSay( WinHan, 0,0, "Check out the subtask window")
- WIN_AtSay( WinSub, 2, 15, "This is the subtask window")
- WIN_AtSay( WinSub, 3, 15, "Press a key to continue. . . .")
- * Be sure that this window appears on top of any others
- WIN_Top( WinSub )
- *Force DV to display the window with all above characteristics
- WIN_Redraw( WinSub )
-
- * Not INKEY() but an incredible well-behaved imitation:
- KeyPress = KEY_Inkey( KeySub, 30 )
-
- WIN_Bottom(WIN_Sub)
- WIN_Redraw(WIN_Sub)
-
- * Event Loop
- DO WHILE .NOT. EOF()
-
- * Is anything in any of the objects' queues?
- IF OBQ_SizeOf() > 0
- * What's the handle of the object?
- ObjHan = OBQ_Read()
- DO CASE
- CASE ObjHan = KeySub
- *Move subtask window to the top; show key
- pressed
- CASE ObjHan = MalSub
- *Move subtask window to the top;
- *Display the mail message in window
-
- * Timer has signaled its time has come
- CASE ObjHan = timerobj
- * start mainframe download
-
- *User clicked mouse at subtask
- CASE ObjHan = ptrsub
-
- *User pressed key at main process window
- CASE ObjHan = KeyMain
-
- *User clicked mouse at subtask window
- CASE ObjHan = PtrMain
- ENDCASE
- ENDIF
-
- * Relinquish time slice to other processes
- API_Pause()
- ENDDO
-
-
-
-
-