Bambookit Home    Bambookit GUI Tutorial

Back   

II. GUI Basics

Chapter 8. Prebuilt Widgets




Message Box Control

Message Box Control Message Box consists of the following widgets: Widget, Drag, Button. Message box may also be called a dialog or an alert. A dialog is a window designed to elicit a response from the user. Many dialogs—the Print dialog, for example—permit the user to provide many responses at one time. Alerts are dialogs that appear when the system or an application needs to communicate information to the user. They provide messages about error conditions and warn users about potentially hazardous situations or actions.

XML Element Name Structure

<Widget>
<Drag>
<Button/>
</Drag>
<Widget/>
<Widget/>
<Button/>
</Widget>

Example





Line 02 Widget-container in which Message Box will be placed.
Line 03 Widget-container - it is container for the Message Box. The attributes are discribed in the Widgets Attributes, Chapter 10.
Line 05 Drag widget discribed in Widgets, Chapter 7.<9>. Drag is used as a header in the window. It allows to drag a window, set a title for a window and place any widget inside, like in this case we have placed the 'close' buttons.
Line 10 Button widget is used to create a close (cls) button.
Line 16 When the user clicks on the 'cls' button, only one event is triggured: window is placed in location with coordinates '-200' and '-200' to make it out of visible range.
Line 20 Widget is used here to describe the text of the message in the box.
Line 22 Button widget is used as 'OK' button. You may want to add a 'Cancel' buttton in here. At this point you may make a call to your php, asp, or jsp file by adding 'addActionTarget' event for a desired action to occur.

Message Box attributes

Message Box control consists of the following widgets: widget, button, and drag. All basic widget's attributes apply to these widgets. Basic set of methods that applies to all widgets is described in the Chapter 9 for widgets styles, and Chapter 10 for widgets attributes. For event handling methods please refer to Chapter 12.

Back