New topic: "MsgBoxInterrupt" - Method to display "Stop" dialog
<http://forums.realsoftware.com/viewtopic.php?t=34333> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message basil.bourque Post subject: "MsgBoxInterrupt" - Method to display "Stop" dialogPosted: Sat Jun 19, 2010 6:53 pm Joined: Thu Apr 15, 2010 10:41 pm Posts: 31 Location: Seattle-area Here's a little convenience method to tell the user some process failed to complete, in a dialog with the "Stop" dialog. Calling this method in one line of code takes the places of several lines of code. To use this code, create a method on "App", and paste this code. Sub MsgBoxInterrupt(win as Window, majorMessage as String, minorMessage as String = "") // MsgBoxInterrupt ( WindowReference, majorMessage ) --> void // MsgBoxInterrupt ( WindowReference, majorMessage, minorMessage ) --> void // Purpose: A convenience method to display a message indicating some process was interrupted or otherwise failed. // © 2010 Basil Bourque. // This source code may be freely used by anyone taking full responsibility for doing so. // Example: // app.MsgBoxInterrupt( self, "SuchAndSuch cannot be completed at this time.", "The Oompa-Loompas are taking a break now." ) Dim d as New MessageDialog //declare the MessageDialog object Dim b as MessageDialogButton // Not used, but required make compiler happy (by capturing object returned in code below). d.icon = MessageDialog.GraphicStop // Display Stop icon. Note that Mac OS X displays app's icon rather than Stop icon. d.ActionButton.Caption = "OK" d.CancelButton.Visible = False // Hide the Cancel button d.AlternateActionButton.Visible = False d.Message = majorMessage d.Explanation = minorMessage b = d.ShowModalWithin(win) // Display the message in a dialog. Appears as a sheet window on Mac OS X. // FIN. End Sub _________________ --Basil Bourque (Using REAL Studio 2010 release 2 with REAL Server 2009r1.2 on Mac OS X 10.6.2 & .3) Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ]
-- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
