'===========================================================================
' Subject: QDRIVECOMBO COMPONENT              Date: 10-25-99 (13:36)       
'  Author: Erlend Rovik                       Code: RAPIDQ                 
'  Origin: e-rovik@online.no                Packet: RAPIDQ.ABC
'===========================================================================
'QDriveComboBox By Preacher / Bizarre Designz
'--------------------------------------------
$APPTYPE GUI
$TYPECHECK ON

TYPE QDriveComboBox EXTENDS QComboBox
  SUB GetDrives
   dim a(25) as integer
   dim i as integer
   dim a$ as string
   for i=0 to 25
    a$=chr$(65+i)+":\":a(i)=direxists(a$)
    if a(i)=1 then
     QDriveComboBox.AddItems a$
    end if
   next i
   QDriveComboBox.ItemIndex = 0
  END SUB
  SUB AddItems
  END SUB
  SUB DelItems
  END SUB
  SUB Clear
  END SUB
  '-- Default values
  CONSTRUCTOR
  END CONSTRUCTOR
END TYPE

'Test Source
DECLARE SUB ItemChanged
DIM Form AS QForm
DIM DrvCombo AS QDriveComboBox
SUB ItemChanged
  ShowMessage(DrvCombo.Item(DrvCombo.ItemIndex))
END SUB
DrvCombo.Parent = Form
DrvCombo.GetDrives
DrvCombo.OnChange = ItemChanged
Form.ShowModal
END

