Revision 399 org.gvsig.scripting.app/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/src/main/resources/scripting/lib/commonsdialog.py
commonsdialog.py | ||
---|---|---|
25 | 25 |
|
26 | 26 |
__author__ = """Antonio Carrasco Valero |
27 | 27 |
Model Driven Development sl and Antonio Carrasco Valero |
28 |
<carrasco@modeldd.org>""" |
|
28 |
<carrasco@modeldd.org> |
|
29 |
Victor Acevedo Royer <vacevedo@gvsig.com> <vacevedor@gmail.com> |
|
30 |
""" |
|
29 | 31 |
__docformat__ = 'plaintext' |
30 | 32 |
|
31 | 33 |
|
... | ... | |
86 | 88 |
WARNING= 2 |
87 | 89 |
QUESTION= 3 |
88 | 90 |
|
89 |
# Confirmdialog Options |
|
91 |
# Confirmdialog optionType Options
|
|
90 | 92 |
YES_NO = 0 |
91 | 93 |
YES_NO_CANCEL = 1 |
92 | 94 |
ACEPT_CANCEL = 2 |
93 | 95 |
|
94 |
def msgbox(message, title="", messageType=1):
|
|
96 |
def msgbox(message, title="", messageType=IDEA):
|
|
95 | 97 |
""" |
96 | 98 |
Create a message dialog with ok button only |
97 | 99 |
|
... | ... | |
103 | 105 |
DefaultThreadSafeDialogs().messageDialog(message, title, messageType) |
104 | 106 |
|
105 | 107 |
|
106 |
def inputbox(message, title="", messageType=1, initialValue=""):
|
|
108 |
def inputbox(message, title="", messageType=IDEA, initialValue=""):
|
|
107 | 109 |
""" |
108 | 110 |
Show a input dialog. |
109 | 111 |
|
... | ... | |
116 | 118 |
return DefaultThreadSafeDialogs().inputDialog(message, title, messageType, initialValue) |
117 | 119 |
|
118 | 120 |
|
119 |
def confirmDialog(message, title="", optionType=0, messageType=1):
|
|
121 |
def confirmDialog(message, title="", optionType=YES_NO, messageType=IDEA):
|
|
120 | 122 |
""" |
121 | 123 |
Create a message dialog with options button |
122 | 124 |
|
... | ... | |
142 | 144 |
return None |
143 | 145 |
|
144 | 146 |
def openFileDialog(title=None): |
145 |
#fc = JFileChooser() |
|
146 |
fc = DefaultThreadSafeDialogs().createComponent(JFileChooser) |
|
147 |
#createComponentWithParams |
|
147 |
fc = JFileChooser() |
|
148 | 148 |
if title!=None: |
149 | 149 |
fc.setDialogTitle(title) |
150 | 150 |
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES) |
... | ... | |
155 | 155 |
return None |
156 | 156 |
|
157 | 157 |
def openFolderDialog(title=None): |
158 |
fc = DefaultThreadSafeDialogs().createComponent(JFileChooser) |
|
159 |
#fc = JFileChooser() |
|
158 |
fc = JFileChooser() |
|
160 | 159 |
if title!=None: |
161 | 160 |
fc.setDialogTitle(title) |
162 | 161 |
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) |
... | ... | |
166 | 165 |
return None |
167 | 166 |
|
168 | 167 |
def saveFileDialog(title=None): |
169 |
#fc = JFileChooser() |
|
170 |
fc = DefaultThreadSafeDialogs().createComponent(JFileChooser) |
|
168 |
fc = JFileChooser() |
|
171 | 169 |
if title!=None: |
172 | 170 |
fc.setDialogTitle(title) |
173 | 171 |
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES) |
Also available in: Unified diff