Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Win User Notification
Function:
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Win User Notification
This example is the version from Thu, 3rd Jan 2018.
Project "Win User Notification.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() #if TargetWin32 then if not WinUserNotificationCenterMBS.Available then MsgBox "Not available on this Windows version." end if #else MsgBox "This example is for Windows only." #endif End EventHandler
End Class
Class Window1 Inherits Window
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control ImageField Inherits TextField
ControlInstance ImageField Inherits TextField
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
Control TextField1 Inherits TextField
ControlInstance TextField1 Inherits TextField
End Control
Control Label3 Inherits Label
ControlInstance Label3 Inherits Label
End Control
Control TextField2 Inherits TextField
ControlInstance TextField2 Inherits TextField
End Control
Control Label4 Inherits Label
ControlInstance Label4 Inherits Label
End Control
Control TextField3 Inherits TextField
ControlInstance TextField3 Inherits TextField
End Control
Control OpenButton Inherits PushButton
ControlInstance OpenButton Inherits PushButton
EventHandler Sub Action() dim f as FolderItem = GetOpenFolderItem("") if f = nil then Return #if RBVersion >= 2013 then // xojo ImageField.Text = f.NativePath #else // Real Studio ImageField.Text = f.AbsolutePath #endif End EventHandler
End Control
Control ShowButton Inherits PushButton
ControlInstance ShowButton Inherits PushButton
EventHandler Sub Action() if center = nil then dim appName as string = "MyTestApp" dim aumi as string = WinUserNotificationCenter.configureAUMI("MyCompany", "test", "test", "1.0") center = new WinUserNotificationCenter(appname, aumi) center.list = listbox1 end if dim n as new WinUserNotificationMBS n.Image = ImageField.Text n.text(0) = TextField1.Text n.text(1) = TextField2.Text n.text(2) = TextField3.Text currentNotification = n if center.ShowNotification(n) then MsgBox "OK" else MsgBox "Failed" end if End EventHandler
End Control
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
End Control
Property Private Center As WinUserNotificationCenter
Property Private currentNotification As WinUserNotificationMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class WinUserNotificationCenter Inherits WinUserNotificationCenterMBS
EventHandler Sub Activated(Notification as WinUserNotificationMBS) list.AddRow "Activated." End EventHandler
EventHandler Sub Dismissed(Notification as WinUserNotificationMBS, Reason as Integer) dim r as string Select case reason case me.DismissalReasonApplicationHidden r = "Application Hidden" case me.DismissalReasonTimedOut r = "Time Out" case me.DismissalReasonUserCanceled r = "User Cancelled" else r = str(reason) end Select list.AddRow "Dismissed: "+r End EventHandler
EventHandler Sub Failed(Notification as WinUserNotificationMBS, ErrorCode as Integer) list.AddRow "Failed: "+str(ErrorCode) End EventHandler
Property list As listbox
End Class
End Project

See also:

Feedback, Comments & Corrections

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





Links
MBS Xojo Chart Plugins