Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacOSX Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Mac USB Device
This example is the version from Sun, 17th Mar 2012.
Project "Mac USB Device.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control DevicesList Inherits Listbox
ControlInstance DevicesList Inherits Listbox
EventHandler Sub Change()
List.DeleteAllRows
if me.ListIndex>=0 then
dim r as MacUSBDeviceMBS = me.RowTag(me.ListIndex)
Show r
end if
End EventHandler
EventHandler Sub DoubleClick()
dim m as MacUSBDeviceMBS = DevicesList.RowTag(DevicesList.ListIndex)
dim d as Dictionary = m.Properties
break
// now you can check details in debugger
End EventHandler
EventHandler Sub ExpandRow(row As Integer)
dim r as MacUSBDeviceMBS = me.RowTag(row)
for each c as MacUSBDeviceMBS in r.children
add c
next
End EventHandler
End Control
EventHandler Sub Open()
add MacUSBDeviceMBS.root
End EventHandler
Protected Sub Add(r as MacUSBDeviceMBS)
if r<>nil then
if UBound(r.children)<0 then
DevicesList.Addrow r.Name
else
DevicesList.AddFolder r.Name
end if
DevicesList.RowTag(DevicesList.LastIndex)=r
end if
End Sub
Protected Sub Show(r as MacUSBDeviceMBS)
List.AddRow "Address", str(r.Address)
List.AddRow "BusPowerAvailable", str(r.BusPowerAvailable)
List.AddRow "ClassName", r.ClassName
List.AddRow "DeviceClass", str(r.DeviceClass)
List.AddRow "DeviceMaxPacketSize", str(r.DeviceMaxPacketSize)
List.AddRow "DeviceNumConfigs", str(r.DeviceNumConfigs)
List.AddRow "DeviceProtocol", str(r.DeviceProtocol)
List.AddRow "DeviceReleaseNumber", str(r.DeviceReleaseNumber)
List.AddRow "DeviceSpeed", str(r.DeviceSpeed)
List.AddRow "DeviceSubClass", str(r.DeviceSubClass)
List.AddRow "ExtraPowerForPorts", str(r.ExtraPowerForPorts)
List.AddRow "Name", r.Name
List.AddRow "NumEndpoints", str(r.NumEndpoints)
List.AddRow "Path", r.Path
List.AddRow "Ports", str(r.Ports)
List.AddRow "ProductID", str(r.ProductID)
List.AddRow "ProductName", r.ProductName
List.AddRow "RequestedPowers", str(r.RequestedPower)
List.AddRow "SerialNumber", r.SerialNumber
List.AddRow "VendorID", str(r.VendorID)
List.AddRow "VendorName", r.VendorName
End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Module Module1
Sub AddRow(extends l as Listbox, c1 as string, c2 as string)
l.AddRow c1
l.Cell(l.LastIndex,1)=c2
End Sub
End Module
End Project
The items on this page are in the following plugins: MBS MacOSX Plugin.