1 |
bh |
535 |
# Copyright (c) 2001, 2003 by Intevation GmbH |
2 |
bh |
28 |
# Authors: |
3 |
|
|
# Bernhard Herzog <[email protected]> |
4 |
|
|
# |
5 |
|
|
# This program is free software under the GPL (>=v2) |
6 |
|
|
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
|
8 |
|
|
"""Base classes for dialogs""" |
9 |
|
|
|
10 |
|
|
__version__ = "$Revision$" |
11 |
|
|
|
12 |
jonathan |
814 |
#from wxPython.wx import wxFrame, EVT_CLOSE |
13 |
bh |
28 |
|
14 |
jonathan |
814 |
#class NonModalDialog(wxFrame): |
15 |
bh |
28 |
|
16 |
jonathan |
814 |
#def __init__(self, parent, name, title): |
17 |
|
|
#wxFrame.__init__(self, parent, -1, title) |
18 |
|
|
#self.parent = parent |
19 |
|
|
#self.name = name |
20 |
|
|
#EVT_CLOSE(self, self.OnClose) |
21 |
|
|
# |
22 |
|
|
#def OnClose(self, event): |
23 |
|
|
#self.parent.remove_dialog(self.name) |
24 |
|
|
#self.Destroy() |
25 |
|
|
|
26 |
|
|
from wxPython.wx import * |
27 |
|
|
|
28 |
|
|
class NonModalDialog(wxDialog): |
29 |
|
|
|
30 |
bh |
535 |
def __init__(self, parent, name, title): |
31 |
jonathan |
814 |
wxDialog.__init__(self, parent, -1, title, |
32 |
|
|
style = wxDEFAULT_DIALOG_STYLE |
33 |
|
|
| wxSYSTEM_MENU |
34 |
|
|
| wxMINIMIZE_BOX |
35 |
|
|
| wxMAXIMIZE_BOX |
36 |
|
|
| wxRESIZE_BORDER) |
37 |
bh |
28 |
self.parent = parent |
38 |
|
|
self.name = name |
39 |
|
|
EVT_CLOSE(self, self.OnClose) |
40 |
|
|
|
41 |
|
|
def OnClose(self, event): |
42 |
|
|
self.parent.remove_dialog(self.name) |
43 |
|
|
self.Destroy() |