Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/Service in Cocoa/TestService
Function:
Required plugins for this example: MBS MacBase 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: /MacCocoa/Service in Cocoa/TestService
This example is the version from Tue, 21th Apr 2014.
Project "TestService.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() ServiceProvider = new MyNSServiceProviderMBS nsapp = NSApplicationMBS.sharedApplication nsapp.servicesProvider = ServiceProvider End EventHandler
Property NSApp As NSApplicationMBS
Property ServiceProvider As MyNSServiceProviderMBS
End Class
Class MainWindow Inherits Window
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
End Control
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
Class MyNSServiceProviderMBS Inherits NSServiceProviderMBS
EventHandler Sub ServiceInvoked(pboard as NSPasteboardMBS, userData as string, byref error as string) dim s as string = pboard.stringForType(pboard.NSPasteboardTypeString) MainWindow.TextArea1.Text = s s = "“"+s+"”" call pboard.clearContents pboard.stringForType(pboard.NSPasteboardTypeString) = s End EventHandler
End Class
RunIDEScriptStep
End RunIDEScriptStep
End Project

Feedback, Comments & Corrections

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





Links
MBS Xojo Chart Plugins