Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacOSX/Services on Mac OS X/servicedemo
Required plugins for this example: MBS MacCF Plugin, MBS MacOSX Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Services on Mac OS X/servicedemo
This example is the version from Mon, 12th Aug 2012.
Project "servicedemo.rbp"
Filetype alles
Filetype archiv
End FileTypes
Class Fenster1 Inherits Window
Control Edit Inherits TextArea
ControlInstance Edit Inherits TextArea
End Control
EventHandler Sub Open() MyEvents1=new MyEvents MyEvents1.Listen End EventHandler
Property Protected MyEvents1 As MyEvents
End Class
MenuBar Menü
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "Ablage"
MenuItem FileQuit = "Beenden"
MenuItem UntitledMenu0 = "Bearbeiten"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Ausschneiden"
MenuItem EditCopy = "Kopieren"
MenuItem EditPaste = "Einfügen"
MenuItem EditClear = "Löschen"
End MenuBar
Class app Inherits Application
EventHandler Sub Open() End EventHandler
End Class
Class MyEvents Inherits CarbonApplicationEventsMBS
EventHandler Function ServicePerform(Scrap as CarbonEventsScrapMBS, MessageName as CFStringMBS, UserData as CFStringMBS) As boolean dim file as FolderItem dim creator,type as string dim flags as integer NSLogMBS "ServicePerform" if MessageName<>nil then NSLogMBS "MessageName: "+MessageName.str else NSLogMBS "MessageName is empty" end if if UserData<>nil then NSLogMBS "UserData: "+UserData.str else NSLogMBS "UserData is empty" end if if Scrap.GetFile(file,type,creator,flags) then NSLogMBS file.UnixpathMBS NSLogMBS type NSLogMBS creator NSLogMBS str(flags) Fenster1.edit.text=file.UnixpathMBS elseif Scrap.UnicodeTextAvailable then NSLogMBS "UnicodeTextAvailable" Fenster1.edit.text=scrap.GetUnicodeText elseif scrap.TextAvailable then NSLogMBS "TextAvailable" Fenster1.edit.text=scrap.GetText end if // show what's available on data types: dim n as integer = Scrap.FlavorCount NSLogMBS "ScrapFlavorCount: "+str(n) for i as integer = 0 to n-1 NSLogMBS "ScrapFlavorType "+str(i)+": "+Scrap.FlavorType(i) next Return true End EventHandler
End Class
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacOSX Plugin.

MBS FileMaker tutorial videos