Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/StandardAlert
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/StandardAlert
This example is the version from Sun, 17th Mar 2012.
Project "StandardAlert.rbp"
Class Window1 Inherits Window
Control RunButton Inherits PushButton
ControlInstance RunButton Inherits PushButton
EventHandler Sub Action() dim s as StandardAlertMBS s=new StandardAlertMBS s.type=popupType.listindex s.error=error.text s.explanation=explanation.text s.HelpButton=checkhelpbutton.value s.moveable=checkmoveable.value s.position=popupposition.listindex s.defaultButtonCaption=defaultButton.text s.cancelButtonCaption=cancelButton.text s.otherButtonCaption=otherbutton.text s.whichisCancelButton=popupCancel.listindex s.whichisDefaultButton=popupDefault.listindex s.useDefaultCancelButtonCaption=useCancelButton.value s.useDefaultDefaultButtonCaption=useDefaultButton.value s.useDefaultOtherButtonCaption=useOtherbutton.value s.WindowsTitle=wintitle.Text s.WindowsButtons=PopupMenu1.ListIndex s.run if TargetWin32 then msgBox "You pressed button with ID "+str(s.resultButton)+". There was returned the error code "+str(s.resultError)+"." else msgBox "You pressed button number "+str(s.resultButton)+". There was returned the error code "+str(s.resultError)+"." end if End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PopupType Inherits PopupMenu
ControlInstance PopupType Inherits PopupMenu
End Control
Control Error Inherits TextField
ControlInstance Error Inherits TextField
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control Explanation Inherits TextField
ControlInstance Explanation Inherits TextField
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control CheckMoveable Inherits CheckBox
ControlInstance CheckMoveable Inherits CheckBox
End Control
Control CheckHelpbutton Inherits CheckBox
ControlInstance CheckHelpbutton Inherits CheckBox
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control PopupPosition Inherits PopupMenu
ControlInstance PopupPosition Inherits PopupMenu
End Control
Control DefaultButton Inherits TextField
ControlInstance DefaultButton Inherits TextField
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control CancelButton Inherits TextField
ControlInstance CancelButton Inherits TextField
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control Otherbutton Inherits TextField
ControlInstance Otherbutton Inherits TextField
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control PopupDefault Inherits PopupMenu
ControlInstance PopupDefault Inherits PopupMenu
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
Control PopupCancel Inherits PopupMenu
ControlInstance PopupCancel Inherits PopupMenu
End Control
Control UseDefaultButton Inherits CheckBox
ControlInstance UseDefaultButton Inherits CheckBox
EventHandler Sub Action() defaultButton.enabled=not usedefaultButton.value End EventHandler
End Control
Control UseCancelButton Inherits CheckBox
ControlInstance UseCancelButton Inherits CheckBox
EventHandler Sub Action() cancelButton.enabled=not useCancelButton.value End EventHandler
End Control
Control UseOtherbutton Inherits CheckBox
ControlInstance UseOtherbutton Inherits CheckBox
EventHandler Sub Action() otherbutton.enabled=not useotherbutton.value End EventHandler
End Control
Control StaticText10 Inherits Label
ControlInstance StaticText10 Inherits Label
End Control
Control PopupMenu1 Inherits PopupMenu
ControlInstance PopupMenu1 Inherits PopupMenu
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() erroralert error.text,explanation.text End EventHandler
End Control
Control wintitle Inherits TextField
ControlInstance wintitle Inherits TextField
End Control
Control StaticText11 Inherits Label
ControlInstance StaticText11 Inherits Label
End Control
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
Module ErrorAlert
Sub ErrorAlert(error as string,explanation as string) dim s as StandardAlertMBS s=new StandardAlertMBS s.Type=2 s.Error=error s.explanation=explanation s.UseDefaultDefaultButtonCaption=true s.whichisCancelButton=0 s.whichisDefaultButton=1 s.Moveable=true s.position=0 s.run msgBox str(s.resultError) End Sub
End Module
Class App Inherits Application
End Class
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo tutorial videos