Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/Kiosk application
Function:
Required plugins for this example: MBS MacCF Plugin, MBS MacClassic Plugin, MBS MacOSX Plugin, MBS Main Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/Kiosk application
This example is the version from Sun, 17th Mar 2012.
Project "Kiosk application.rbp"
Class MainWindow Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control list Inherits ListBox
ControlInstance list Inherits ListBox
End Control
EventHandler Sub Close() SetSystemUIModeMBS 0,0 End EventHandler
EventHandler Sub Open() setsystemuimode End EventHandler
Sub setsystemuimode() SetSystemUIModeMBS 3,32+16+8+4 End Sub
Property Protected mode As integer
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class CarbonApplicationEvents Inherits CarbonApplicationEventsMBS
EventHandler Sub ApplicationLaunched(ProcessSerial as memoryblock) // An application launched, this is Option-Fkeys for the system preferences or some hacker attack. // Maybe a filter should be added for special applications like spell checking. dim p as new ProcessMBS p.GetCurrentProcess dim x as MemoryBlock = p.MacProcessSerial if x.Int64Value(0) = ProcessSerial.Int64Value(0) then // ourself else p.GetProcess ProcessSerial MainWindow.list.AddRow "Launched: "+p.Name+" ("+p.MacCreator+")" if p.QuitProcess=0 then // quit it. // ok else if p.KillProcess=0 then // else kill it end if end if app.FrontmostMBS=true // move me to front end if End EventHandler
EventHandler Sub ApplicationSwitched(ProcessSerial as memoryblock) app.FrontmostMBS=true MainWindow.list.AddRow "Switched application" End EventHandler
EventHandler Sub VolumeMounted(VolumeRefNum as integer) dim i as integer dim c as integer dim f as FolderItem c=VolumeCount-1 for i=0 to c f=volume(i) if f.MacVRefNum=VolumeRefNum then // found MainWindow.list.AddRow "Volume mounted." if f.UnMountVolumeMBS=0 then // unmounted end if Return end if next End EventHandler
End Class
Class app Inherits Application
EventHandler Sub Open() // We need to watch for some events: c=new CarbonApplicationEvents c.Listen End EventHandler
Property Protected c As carbonapplicationEventsMBS
End Class
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins