gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / scripts / examples / dialogs / 03_optionbox.py @ 696
History | View | Annotate | Download (934 Bytes)
1 |
from gvsig import commonsdialog |
---|---|
2 |
|
3 |
def main(): |
4 |
'''Asks if you want to see a message and shows a message with selected
|
5 |
option using commonsdialog functions
|
6 |
- msgbox
|
7 |
- confirmDialog
|
8 |
'''
|
9 |
message = 'Do you want see a message?'
|
10 |
title = 'Select Option'
|
11 |
optionType = commonsdialog.YES_NO |
12 |
messageType = commonsdialog.IDEA |
13 |
|
14 |
option = commonsdialog.confirmDialog( |
15 |
message, |
16 |
title, |
17 |
optionType, |
18 |
messageType |
19 |
) |
20 |
|
21 |
if option == 0: |
22 |
message = 'You have chosen "Yes" Option (%s)'%option
|
23 |
elif option == 1: |
24 |
message = 'No matter. You have chosen "No" Option (%s)'%option
|
25 |
messageType = commonsdialog.WARNING |
26 |
else:
|
27 |
message = 'You just closed the window. Option (%s)'%option
|
28 |
messageType = commonsdialog.FORBIDEN |
29 |
|
30 |
commonsdialog.msgbox(message, |
31 |
'YOUR OPTION',
|
32 |
messageType |
33 |
) |