home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 11 / CDACTUAL11.iso / cdactual / demobin / share / os2 / VPREVAL / ATTPROC._ / PRESSED < prev   
Encoding:
Text File  |  1995-08-16  |  1.6 KB  |  61 lines

  1. arg window, key, position, state
  2.  
  3. /* Get indexes of all selected items 1001 List Box */
  4. CALL VpGetIndex window,1001,'ALLSELECTED','INDEXES.'
  5.  
  6. if indexes.0==0 then
  7.    /* 1000 Hz for 200 millisec */
  8.    CALL VpBeep 1000,200
  9. else
  10.   do
  11.     /* Painting disable 1001 List Box */
  12.     CALL VpItem window,1001,'DISABLEPAINT'
  13.     
  14.     /* turn on the hourglass */
  15.     /* valid index 1 - 22 */
  16.     value = VpLoadPicture('SYSICON',3)
  17.     CALL VpWindow window,'SETPOINTER',value
  18.     
  19.     /* for each selected file, set the attribute */
  20.     do x=1 to indexes.0
  21.  
  22.       /* Get item value at index 1001 List Box */
  23.       value=VpGetItemValue(window,1001,indexes.x)
  24.       /* extract current state of attribute specified by KEY */
  25.       currentattrib=SUBSTR(value, position,1)
  26.       /* extract file name */ 
  27.       filename=RIGHT(value, length(value)-posoffilename+1)
  28.        
  29.       if state=='TOGGLE' then
  30.         if currentattrib==' ' then
  31.            state='ON'
  32.               
  33.       if state=='ON' then
  34.         do
  35.           'attrib +'key' 'filename' 1>nul'
  36.         end
  37.       else
  38.         do
  39.           'attrib -'key' 'filename' 1>nul'
  40.           key=' '
  41.         end
  42.       
  43.       /* display the new attribute value */
  44.       value=overlay(key,value,position)
  45.  
  46.       /* Set item value at index 1001 List Box */
  47.       CALL VpSetItemValue window, 1001, value, indexes.x          
  48.     end
  49.  
  50.    /* turn on the arrow */
  51.    /* valid index 1 - 22 */
  52.    value = VpLoadPicture('SYSICON',1)
  53.    CALL VpWindow window,'SETPOINTER',value
  54.  
  55.    /* Painting enable 1001 List Box */
  56.    CALL VpItem window,1001,'ENABLEPAINT'
  57.  
  58.    call click window
  59. end   
  60.        
  61.