home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SAMPLES / TESTLBX.PRG < prev    next >
Text File  |  1994-06-07  |  1KB  |  40 lines

  1. #include "FiveWin.ch"
  2.  
  3. //----------------------------------------------------------------------------//
  4.  
  5. function Main()
  6.  
  7.    local oWnd, oLbx, oSay
  8.    local cItem := "Two"
  9.  
  10.    DEFINE WINDOW oWnd FROM 1, 1 TO 20, 60 ;
  11.       TITLE "Testing a ListBox" ;
  12.       COLOR "W+/B"
  13.  
  14.    @ 2, 2 LISTBOX oLbx VAR cItem ;
  15.       ITEMS { "One", "Two", "Three", "Four", "Five",;
  16.               "Six", "Seven", "Eight", "Nine", "Ten" } ;
  17.       OF oWnd SIZE 200, 150 ;
  18.       COLOR "W+/BG" ;
  19.       ON CHANGE oSay:Refresh() ;
  20.       MESSAGE "Please select an Item"
  21.       // VALID ( MsgInfo( "Just testing valid clause..." ), .t. )
  22.  
  23.    @ 2, 40 SAY oSay VAR cItem SIZE 80, 20 OF oWnd
  24.  
  25.    @ 8, 42 BUTTON "&Add" SIZE 80, 20 OF oWnd ;
  26.       MESSAGE "Add a new item to the listbox" ;
  27.       ACTION oLbx:Add( Time() )
  28.  
  29.    @ 11, 42 BUTTON "&End" SIZE 80, 20 OF oWnd ;
  30.       ACTION oWnd:End() ;
  31.       MESSAGE "Press me to end this test"
  32.  
  33.    SET MESSAGE OF oWnd TO "Testing a ListBox"
  34.  
  35.    ACTIVATE WINDOW oWnd
  36.  
  37. return nil
  38.  
  39. //----------------------------------------------------------------------------//
  40.