Platforms to show: All Mac Windows Linux Cross-Platform
/MacFrameworks/Addressbook People Picker
Required plugins for this example: MBS MacFrameworks Plugin, MBS MacBase Plugin, MBS MacControls Plugin, MBS MacCocoa Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/Addressbook People Picker
This example is the version from Thu, 2nd Jan 2013.
Project "Addressbook People Picker.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control CocoaControlMBS1 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS1 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS
m = new MyABPeoplePickerViewMBS(0,0,me.Width, me.Height)
m.l = list
m.AddProperty ABAddressBookMBS.kABEmailProperty
m.AddProperty ABAddressBookMBS.kABPhoneProperty
Return m
End EventHandler
End Control
Control Info1 Inherits Label
ControlInstance Info1 Inherits Label
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open()
if not CocoaControlMBS1.Available then
MsgBox "This example requires Mac OS X 10.5."
quit
end if
End EventHandler
Property m As MyABPeoplePickerViewMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MyABPeoplePickerViewMBS Inherits ABPeoplePickerViewMBS
EventHandler Sub DisplayedPropertyDidChange()
log CurrentMethodName
log me.displayedProperty
End EventHandler
EventHandler Sub GroupDoubleClick()
log CurrentMethodName
dim groups() as ABGroupMBS = me.selectedGroups
for each g as ABGroupMBS in groups
log "group: "+g.DisplayName
next
End EventHandler
EventHandler Sub GroupSelectionDidChange()
log CurrentMethodName
dim groups() as ABGroupMBS = me.selectedGroups
for each g as ABGroupMBS in groups
log "group: "+g.DisplayName
next
End EventHandler
EventHandler Sub NameDoubleClick()
log CurrentMethodName
dim name as string
dim records() as ABRecordMBS = me.selectedRecords
for each r as ABRecordMBS in records
log "Record: "+r.DisplayName
next
End EventHandler
EventHandler Sub NameSelectionDidChange()
log CurrentMethodName
dim records() as ABRecordMBS = me.selectedRecords
for each r as ABRecordMBS in records
log "Record: "+r.DisplayName
next
End EventHandler
EventHandler Sub ValueSelectionDidChange()
log CurrentMethodName
dim records() as ABRecordMBS = me.selectedRecords
for each r as ABRecordMBS in records
log "Record: "+r.DisplayName
next
dim values() as variant = me.selectedValues
for each r as variant in values
log "Value: "+r
next
End EventHandler
Sub log(s as string)
l.AddRow s
l.ScrollPosition = l.ListCount
End Sub
Property l As listbox
End Class
End Project
The items on this page are in the following plugins: MBS MacFrameworks Plugin.