1 |
# Copyright (c) 2001, 2003, 2004 by Intevation GmbH vim:encoding=latin-1: |
# Copyright (c) 2001, 2003, 2004 by Intevation GmbH vim:encoding=latin-1: |
2 |
# Authors: |
# Authors: |
3 |
# Martin M�ller <[email protected]> |
# Martin Müller <[email protected]> |
4 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
5 |
# |
# |
6 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
11 |
|
|
12 |
import sys, traceback |
import sys, traceback |
13 |
|
|
14 |
from wxPython.wx import * |
import wx |
15 |
|
|
16 |
try: |
try: |
17 |
import ogr |
import ogr |
29 |
ID_LB_DCLICK = 9204 |
ID_LB_DCLICK = 9204 |
30 |
|
|
31 |
|
|
32 |
class ChooseFileFormat(wxDialog): |
class ChooseFileFormat(wx.Dialog): |
33 |
"""This dialog lists all available drivers. |
"""This dialog lists all available drivers. |
34 |
""" |
""" |
35 |
def __init__(self, parent, session): |
def __init__(self, parent, session): |
36 |
"""Initialize the dialog. |
"""Initialize the dialog. |
37 |
""" |
""" |
38 |
wxDialog.__init__(self, parent, -1, _("Choose file format"), |
wx.Dialog.__init__(self, parent, -1, _("Choose file format"), |
39 |
style = wxDIALOG_MODAL|wxCAPTION) |
style = wx.DIALOG_MODAL|wx.CAPTION) |
40 |
self.session = session |
self.session = session |
41 |
self.tables = [] |
self.tables = [] |
42 |
|
|
45 |
# |
# |
46 |
|
|
47 |
# Sizer for the entire dialog |
# Sizer for the entire dialog |
48 |
top = wxFlexGridSizer(2, 1, 0, 0) |
top = wx.FlexGridSizer(2, 1, 0, 0) |
49 |
|
|
50 |
# Sizer for the main part with the list box |
# Sizer for the main part with the list box |
51 |
main_sizer = wxBoxSizer(wxHORIZONTAL) |
main_sizer = wx.BoxSizer(wx.HORIZONTAL) |
52 |
top.Add(main_sizer, 1, wxEXPAND, 0) |
top.Add(main_sizer, 1, wx.EXPAND, 0) |
53 |
|
|
54 |
# The list box with the drivers |
# The list box with the drivers |
55 |
static_box = wxStaticBoxSizer(wxStaticBox(self, -1, "File formats"), |
static_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, "File formats"), |
56 |
wxHORIZONTAL) |
wx.HORIZONTAL) |
57 |
self.lb_drivers = wxListBox(self, -1) |
self.lb_drivers = wx.ListBox(self, -1) |
58 |
static_box.Add(self.lb_drivers, 0, wxEXPAND, 0) |
static_box.Add(self.lb_drivers, 0, wx.EXPAND, 0) |
59 |
main_sizer.Add(static_box, 1, wxEXPAND, 0) |
main_sizer.Add(static_box, 1, wx.EXPAND, 0) |
60 |
|
|
61 |
for i in range(ogr.GetDriverCount()): |
for i in range(ogr.GetDriverCount()): |
62 |
self.lb_drivers.Append(ogr.GetDriver(i).GetName()) |
self.lb_drivers.Append(ogr.GetDriver(i).GetName()) |
64 |
self.lb_drivers.SetSelection(0, True) |
self.lb_drivers.SetSelection(0, True) |
65 |
|
|
66 |
# The standard button box at the bottom of the dialog |
# The standard button box at the bottom of the dialog |
67 |
buttons = wxFlexGridSizer(1, 2, 0, 0) |
buttons = wx.FlexGridSizer(1, 2, 0, 0) |
68 |
ok_button = wxButton(self, ID_DBCHOOSE_OK, _("OK")) |
ok_button = wx.Button(self, ID_DBCHOOSE_OK, _("OK")) |
69 |
EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
70 |
buttons.Add(ok_button, 0, wxALL|wxALIGN_RIGHT, 4) |
buttons.Add(ok_button, 0, wx.ALL|wx.ALIGN_RIGHT, 4) |
71 |
cancel_button = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
cancel_button = wx.Button(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
72 |
EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
73 |
buttons.Add(cancel_button, 0, wxALL, 4) |
buttons.Add(cancel_button, 0, wx.ALL, 4) |
74 |
top.Add(buttons, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 4) |
top.Add(buttons, 1, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 4) |
75 |
|
|
76 |
# Autosizing |
# Autosizing |
77 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
90 |
"""Close dialog. |
"""Close dialog. |
91 |
""" |
""" |
92 |
if self.lb_tables.GetSelection() >= 0: |
if self.lb_tables.GetSelection() >= 0: |
93 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
94 |
self.Show(False) |
self.Show(False) |
95 |
|
|
96 |
def OnOK(self, event): |
def OnOK(self, event): |
97 |
"""Close dialog. |
"""Close dialog. |
98 |
""" |
""" |
99 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
100 |
self.Show(False) |
self.Show(False) |
101 |
|
|
102 |
def OnCancel(self, event): |
def OnCancel(self, event): |
103 |
"""Close dialog. |
"""Close dialog. |
104 |
""" |
""" |
105 |
self.EndModal(wxID_CANCEL) |
self.EndModal(wx.ID_CANCEL) |
106 |
self.Show(False) |
self.Show(False) |
107 |
|
|
108 |
|
|
109 |
class ChooseLayer(wxDialog): |
class ChooseLayer(wx.Dialog): |
110 |
"""This dialog lists all the layers contained in the given datasource. |
"""This dialog lists all the layers contained in the given datasource. |
111 |
|
|
112 |
One layer can be chosen, which is then opened. |
One layer can be chosen, which is then opened. |
115 |
def __init__(self, parent, filename): |
def __init__(self, parent, filename): |
116 |
"""Initialize the dialog. |
"""Initialize the dialog. |
117 |
""" |
""" |
118 |
wxDialog.__init__(self, parent, -1, _("Choose layer"), |
wx.Dialog.__init__(self, parent, -1, _("Choose layer"), |
119 |
style = wxDIALOG_MODAL|wxCAPTION) |
style = wx.DIALOG_MODAL|wx.CAPTION) |
120 |
self.tables = [] |
self.tables = [] |
121 |
|
|
122 |
# |
# |
124 |
# |
# |
125 |
|
|
126 |
# Sizer for the entire dialog |
# Sizer for the entire dialog |
127 |
top = wxFlexGridSizer(2, 1, 0, 0) |
top = wx.FlexGridSizer(2, 1, 0, 0) |
128 |
|
|
129 |
# Sizer for the main part with the list boxes |
# Sizer for the main part with the list boxes |
130 |
main_sizer = wxBoxSizer(wxHORIZONTAL) |
main_sizer = wx.BoxSizer(wx.HORIZONTAL) |
131 |
top.Add(main_sizer, 1, wxEXPAND, 0) |
top.Add(main_sizer, 1, wx.EXPAND, 0) |
132 |
|
|
133 |
# The list box with the drivers |
# The list box with the drivers |
134 |
static_box = wxStaticBoxSizer(wxStaticBox(self, -1, _("Layers")), |
static_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, _("Layers")), |
135 |
wxHORIZONTAL) |
wx.HORIZONTAL) |
136 |
self.lb_drivers = wxListBox(self, -1) |
self.lb_drivers = wx.ListBox(self, -1) |
137 |
static_box.Add(self.lb_drivers, 0, wxEXPAND, 0) |
static_box.Add(self.lb_drivers, 0, wx.EXPAND, 0) |
138 |
main_sizer.Add(static_box, 1, wxEXPAND, 0) |
main_sizer.Add(static_box, 1, wx.EXPAND, 0) |
139 |
|
|
140 |
datasource = ogr.Open(filename) |
datasource = ogr.Open(filename) |
141 |
self.layer = [] |
self.layer = [] |
146 |
self.lb_drivers.SetSelection(0, True) |
self.lb_drivers.SetSelection(0, True) |
147 |
|
|
148 |
# The standard button box at the bottom of the dialog |
# The standard button box at the bottom of the dialog |
149 |
buttons = wxFlexGridSizer(1, 2, 0, 0) |
buttons = wx.FlexGridSizer(1, 2, 0, 0) |
150 |
ok_button = wxButton(self, ID_DBCHOOSE_OK, _("OK")) |
ok_button = wx.Button(self, ID_DBCHOOSE_OK, _("OK")) |
151 |
EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
152 |
buttons.Add(ok_button, 0, wxALL|wxALIGN_RIGHT, 4) |
buttons.Add(ok_button, 0, wx.ALL|wx.ALIGN_RIGHT, 4) |
153 |
cancel_button = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
cancel_button = wx.Button(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
154 |
EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
155 |
buttons.Add(cancel_button, 0, wxALL, 4) |
buttons.Add(cancel_button, 0, wx.ALL, 4) |
156 |
top.Add(buttons, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 4) |
top.Add(buttons, 1, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 4) |
157 |
|
|
158 |
# Autosizing |
# Autosizing |
159 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
168 |
""" |
""" |
169 |
self.result = result |
self.result = result |
170 |
if result is not None: |
if result is not None: |
171 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
172 |
else: |
else: |
173 |
self.EndModal(wxID_CANCEL) |
self.EndModal(wx.ID_CANCEL) |
174 |
self.Show(False) |
self.Show(False) |
175 |
|
|
176 |
def OnOK(self, event): |
def OnOK(self, event): |
188 |
return self.layer[self.lb_drivers.GetSelection()].GetName() |
return self.layer[self.lb_drivers.GetSelection()].GetName() |
189 |
|
|
190 |
|
|
191 |
class ChooseOGRDBTableDialog(wxDialog): |
class ChooseOGRDBTableDialog(wx.Dialog): |
192 |
"""This dialog opens a datasource from an existing database connection. |
"""This dialog opens a datasource from an existing database connection. |
193 |
|
|
194 |
A list of all available database connections is offered. If one connection |
A list of all available database connections is offered. If one connection |
199 |
def __init__(self, parent, session): |
def __init__(self, parent, session): |
200 |
"""Initialize the dialog. |
"""Initialize the dialog. |
201 |
""" |
""" |
202 |
wxDialog.__init__(self, parent, -1, _("Choose layer from database"), |
wx.Dialog.__init__(self, parent, -1, _("Choose layer from database"), |
203 |
style = wxDIALOG_MODAL|wxCAPTION) |
style = wx.DIALOG_MODAL|wx.CAPTION) |
204 |
self.session = session |
self.session = session |
205 |
self.dbconns = self.session.DBConnections() |
self.dbconns = self.session.DBConnections() |
206 |
self.tables = [] |
self.tables = [] |
210 |
# |
# |
211 |
|
|
212 |
# Sizer for the entire dialog |
# Sizer for the entire dialog |
213 |
top = wxFlexGridSizer(2, 1, 0, 0) |
top = wx.FlexGridSizer(2, 1, 0, 0) |
214 |
|
|
215 |
# Sizer for the main part with the list boxes |
# Sizer for the main part with the list boxes |
216 |
main_sizer = wxBoxSizer(wxHORIZONTAL) |
main_sizer = wx.BoxSizer(wx.HORIZONTAL) |
217 |
top.Add(main_sizer, 1, wxEXPAND, 0) |
top.Add(main_sizer, 1, wx.EXPAND, 0) |
218 |
|
|
219 |
# The list box with the connections |
# The list box with the connections |
220 |
static_box = wxStaticBoxSizer(wxStaticBox(self, -1, _("Databases")), |
static_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, _("Databases")), |
221 |
wxHORIZONTAL) |
wx.HORIZONTAL) |
222 |
self.lb_connections = wxListBox(self, -1) |
self.lb_connections = wx.ListBox(self, -1) |
223 |
static_box.Add(self.lb_connections, 0, wxEXPAND, 0) |
static_box.Add(self.lb_connections, 0, wx.EXPAND, 0) |
224 |
main_sizer.Add(static_box, 1, wxEXPAND, 0) |
main_sizer.Add(static_box, 1, wx.EXPAND, 0) |
225 |
|
|
226 |
for i in range(len(self.dbconns)): |
for i in range(len(self.dbconns)): |
227 |
self.lb_connections.Append(self.dbconns[i].BriefDescription()) |
self.lb_connections.Append(self.dbconns[i].BriefDescription()) |
230 |
|
|
231 |
# The button box between the connections list box and the table |
# The button box between the connections list box and the table |
232 |
# list box |
# list box |
233 |
buttons = wxFlexGridSizer(3, 1, 0, 0) |
buttons = wx.FlexGridSizer(3, 1, 0, 0) |
234 |
buttons.Add(20, 80, 0, wxEXPAND, 0) |
buttons.Add(20, 80, 0, wx.EXPAND, 0) |
235 |
retrieve_button = wxButton(self, ID_DBCHOOSE_RETRIEVE, _("Retrieve")) |
retrieve_button = wx.Button(self, ID_DBCHOOSE_RETRIEVE, _("Retrieve")) |
236 |
EVT_BUTTON(self, ID_DBCHOOSE_RETRIEVE, self.OnRetrieve) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_RETRIEVE, self.OnRetrieve) |
237 |
buttons.Add(retrieve_button, 0, wxALL |
buttons.Add(retrieve_button, 0, wx.ALL |
238 |
|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4) |
|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 4) |
239 |
buttons.Add(20, 80, 0, wxEXPAND, 0) |
buttons.Add(20, 80, 0, wx.EXPAND, 0) |
240 |
main_sizer.Add(buttons, 0, wxEXPAND, 0) |
main_sizer.Add(buttons, 0, wx.EXPAND, 0) |
241 |
|
|
242 |
# The list box with the tables |
# The list box with the tables |
243 |
static_box = wxStaticBoxSizer(wxStaticBox(self, -1, _("Tables")), |
static_box = wx.StaticBoxSizer(wx.StaticBox(self, -1, _("Tables")), |
244 |
wxHORIZONTAL) |
wx.HORIZONTAL) |
245 |
self.lb_tables = wxListBox(self, ID_LB_DCLICK) |
self.lb_tables = wx.ListBox(self, ID_LB_DCLICK) |
246 |
EVT_LISTBOX(self, ID_LB_DCLICK, self.OnTableSelect) |
wx.EVT_LISTBOX(self, ID_LB_DCLICK, self.OnTableSelect) |
247 |
EVT_LISTBOX_DCLICK(self, ID_LB_DCLICK, self.OnLBDClick) |
wx.EVT_LISTBOX_DCLICK(self, ID_LB_DCLICK, self.OnLBDClick) |
248 |
static_box.Add(self.lb_tables, 0, wxEXPAND, 0) |
static_box.Add(self.lb_tables, 0, wx.EXPAND, 0) |
249 |
main_sizer.Add(static_box, 1, wxEXPAND, 0) |
main_sizer.Add(static_box, 1, wx.EXPAND, 0) |
250 |
|
|
251 |
# id column and geometry column selection |
# id column and geometry column selection |
252 |
box = wxBoxSizer(wxVERTICAL) |
box = wx.BoxSizer(wx.VERTICAL) |
253 |
box.Add(wxStaticText(self, -1, _("ID Column")), 0, |
box.Add(wx.StaticText(self, -1, _("ID Column")), 0, |
254 |
wxALL|wxALIGN_CENTER_VERTICAL, 4) |
wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) |
255 |
self.text_id_column = wxComboBox(self, -1, "") |
self.text_id_column = wx.ComboBox(self, -1, "") |
256 |
box.Add(self.text_id_column, 0, |
box.Add(self.text_id_column, 0, |
257 |
wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 4) |
wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 4) |
258 |
main_sizer.Add(box, 1, wxEXPAND, 0) |
main_sizer.Add(box, 1, wx.EXPAND, 0) |
259 |
|
|
260 |
# The standard button box at the bottom of the dialog |
# The standard button box at the bottom of the dialog |
261 |
buttons = wxFlexGridSizer(1, 2, 0, 0) |
buttons = wx.FlexGridSizer(1, 2, 0, 0) |
262 |
ok_button = wxButton(self, ID_DBCHOOSE_OK, _("OK")) |
ok_button = wx.Button(self, ID_DBCHOOSE_OK, _("OK")) |
263 |
EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
264 |
buttons.Add(ok_button, 0, wxALL|wxALIGN_RIGHT, 4) |
buttons.Add(ok_button, 0, wx.ALL|wx.ALIGN_RIGHT, 4) |
265 |
cancel_button = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
cancel_button = wx.Button(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
266 |
EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
267 |
buttons.Add(cancel_button, 0, wxALL, 4) |
buttons.Add(cancel_button, 0, wx.ALL, 4) |
268 |
top.Add(buttons, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 4) |
top.Add(buttons, 1, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 4) |
269 |
|
|
270 |
# Autosizing |
# Autosizing |
271 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
324 |
"""Close dialog. |
"""Close dialog. |
325 |
""" |
""" |
326 |
if self.lb_tables.GetSelection() >= 0: |
if self.lb_tables.GetSelection() >= 0: |
327 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
328 |
self.Show(False) |
self.Show(False) |
329 |
|
|
330 |
def OnOK(self, event): |
def OnOK(self, event): |
331 |
"""Dialog closed with OK button. |
"""Dialog closed with OK button. |
332 |
""" |
""" |
333 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
334 |
self.Show(False) |
self.Show(False) |
335 |
|
|
336 |
def OnCancel(self, event): |
def OnCancel(self, event): |
337 |
"""Dialog closed with Cancel. |
"""Dialog closed with Cancel. |
338 |
""" |
""" |
339 |
self.EndModal(wxID_CANCEL) |
self.EndModal(wx.ID_CANCEL) |
340 |
self.Show(False) |
self.Show(False) |
341 |
|
|
342 |
|
|
343 |
class OGRConnectionDialog(wxDialog): |
class OGRConnectionDialog(wx.Dialog): |
344 |
"""A string can be enteres, which is directly passed to ogr to open a |
"""A string can be enteres, which is directly passed to ogr to open a |
345 |
datasource. |
datasource. |
346 |
""" |
""" |
347 |
def __init__(self, parent, session): |
def __init__(self, parent, session): |
348 |
"""Initialize the dialog. |
"""Initialize the dialog. |
349 |
""" |
""" |
350 |
wxDialog.__init__(self, parent, -1, "Enter string for OGRConnection", |
wx.Dialog.__init__(self, parent, -1, "Enter string for OGRConnection", |
351 |
style = wxDIALOG_MODAL|wxCAPTION) |
style = wx.DIALOG_MODAL|wx.CAPTION) |
352 |
self.session = session |
self.session = session |
353 |
|
|
354 |
# Sizer for the entire dialog |
# Sizer for the entire dialog |
355 |
top = wxBoxSizer(wxVERTICAL) |
top = wx.BoxSizer(wx.VERTICAL) |
356 |
|
|
357 |
# The list box with the drivers |
# The list box with the drivers |
358 |
box = wxBoxSizer(wxHORIZONTAL)#wxBox(self, -1, _("OGRConnection")), |
box = wx.BoxSizer(wx.HORIZONTAL)#wx.Box(self, -1, _("OGRConnection")), |
359 |
# wxHORIZONTAL) |
# wx.HORIZONTAL) |
360 |
box.Add(wxStaticText(self, -1, _("URL:")), 0, |
box.Add(wx.StaticText(self, -1, _("URL:")), 0, |
361 |
wxALL|wxALIGN_CENTER_VERTICAL, 4) |
wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) |
362 |
self.text_string = wxTextCtrl(self, -1, "") |
self.text_string = wx.TextCtrl(self, -1, "") |
363 |
box.Add(self.text_string, 0, wxEXPAND, 0) |
box.Add(self.text_string, 0, wx.EXPAND, 0) |
364 |
top.Add(box, 0, wxEXPAND) |
top.Add(box, 0, wx.EXPAND) |
365 |
|
|
366 |
# The standard button box at the bottom of the dialog |
# The standard button box at the bottom of the dialog |
367 |
buttons = wxFlexGridSizer(1, 2, 0, 0) |
buttons = wx.FlexGridSizer(1, 2, 0, 0) |
368 |
ok_button = wxButton(self, ID_DBCHOOSE_OK, _("OK")) |
ok_button = wx.Button(self, ID_DBCHOOSE_OK, _("OK")) |
369 |
EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK) |
370 |
buttons.Add(ok_button, 0, wxALL|wxALIGN_RIGHT, 4) |
buttons.Add(ok_button, 0, wx.ALL|wx.ALIGN_RIGHT, 4) |
371 |
cancel_button = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
cancel_button = wx.Button(self, ID_DBCHOOSE_CANCEL, _("Cancel")) |
372 |
EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
wx.EVT_BUTTON(self, ID_DBCHOOSE_CANCEL, self.OnCancel) |
373 |
buttons.Add(cancel_button, 0, wxALL, 4) |
buttons.Add(cancel_button, 0, wx.ALL, 4) |
374 |
top.Add(buttons, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 4) |
top.Add(buttons, 1, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 4) |
375 |
|
|
376 |
# Autosizing |
# Autosizing |
377 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
392 |
""" |
""" |
393 |
self.result = result |
self.result = result |
394 |
if result is not None: |
if result is not None: |
395 |
self.EndModal(wxID_OK) |
self.EndModal(wx.ID_OK) |
396 |
else: |
else: |
397 |
self.EndModal(wxID_CANCEL) |
self.EndModal(wx.ID_CANCEL) |
398 |
self.Show(False) |
self.Show(False) |
399 |
|
|
400 |
def OnOK(self, event): |
def OnOK(self, event): |