06-15-2011, 03:52 PM,
(This post was last modified: 06-16-2011, 10:40 AM by kino.)
|
|||||
|
|||||
User Interface Basics2:Adding Pop-ups
Pop-up dialogs are an easy way to provide information to your users. A pop-up window is a separate, independent window that is usually smaller than a standard browser window and does not have features such as tool bars or status bars that are commonly found on browser windows.
In general the following are the ways to utilize pop-up dialogs: 1.Display help or information to a user 2.Request additional information or instructions from a user 3.Notify a user of an error condition The invocation of the pop-up is dependent on the purpose of the pop-up window. A help pop-up window can be displayed when the user clicks on a 'help' link or button. An error pop-up can be displayed when an operation requested by a user cannot be performed. Pop-up Dialog Procedures The following pop-up dialogs are shortcut procedures that use the Dialog API to create a pop-up window in the following ways: •popup-message: displays a message with an OK button •popup-text-query: displays a text control •popup-question: displays a yes-or-no question In the following example, a simple pop-up using popup-message is displayed. Code: {curl 6.0, 7.0 applet} One major difference between Curl pop-ups and HTML-based pop-ups is that the HTML pop-up opens a new Web browser window. A Curl pop-up displays content using a Curl applet window. The applet window is part of the running application, therefore it makes it easy to directly pass information between the windows. Since each pop-up is a Curl window, we can easily display pop-up windows sequentially based on the user's input. In the following example, we can display alternate messages based on the selected answer. Here we are combining two pop-up dialogs. Code: {curl 6.0, 7.0 applet} Tip: Notice that cancel?=true is used to display the cancel button. Using a Pop-up to Gather Data Since the message portion of a popup-message can be any graphical object, it can combine other controls and objects. The following is example shows how to embed radio buttons inside a popup-message dialog. Code: {curl 6.0, 7.0 applet} For more information regarding pop-up dialog procedures, please refer to the following section in the Curl Documentation:Curl Developer's Guide > Graphical User Interface > Dialogs and Controls > Using Dialogs > Dialog Procedures > Creating Simple Pop-up Dialogs Code: Displaying a Dialog as a Pop-up For simple pop-up windows, it is easy to use Curl's related procedures to create simple dialogs that display a message, obtain a yes/no answer, and obtain a String by way of a TextField. You may, however, want to have full control over the visual layout and functionality of the displayed dialog. In these cases we will need to use the Dialog class. The following example produces the same result as the previous example. Notice that the dialog needs to be explicitly viewed using Dialog.show and closed using Dialog.close. Code: {curl 6.0, 7.0 applet} For more information regarding dialogs, please refer to the following section in the Curl Documentation:Curl Developer's Guide > Graphical User Interface > Dialogs and Controls > Using Dialogs |
|||||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
User Interface Basics7:Stretching Graphical Objects | kino | 0 | 4,781 |
06-15-2011, 04:12 PM Last Post: kino |
|
User Interface Basics6:Object Layout | kino | 0 | 4,507 |
06-15-2011, 04:08 PM Last Post: kino |
|
User Interface Basics5:Swapping UI Content | kino | 0 | 3,500 |
06-15-2011, 04:03 PM Last Post: kino |
|
User Interface Basics4:Populating Control List Data | kino | 0 | 3,709 |
06-15-2011, 03:58 PM Last Post: kino |
|
User Interface Basics3:Creating Dialogs | kino | 0 | 3,360 |
06-15-2011, 03:55 PM Last Post: kino |
|
User Interface Basics1:Linking to Content | kino | 0 | 3,672 |
06-15-2011, 03:48 PM Last Post: kino |
Users browsing this thread:
2 Guest(s)
2 Guest(s)