1 |
# Copyright (c) 2001, 2003 by Intevation GmbH |
# Copyright (c) 2001, 2003 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
|
# Frank Koormann <[email protected]> |
5 |
# |
# |
6 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
7 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
10 |
|
|
11 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
12 |
|
|
13 |
#from wxPython.wx import wxFrame, EVT_CLOSE |
from wxPython.wx import wxFrame, wxDEFAULT_FRAME_STYLE, EVT_CLOSE |
14 |
|
|
15 |
#class NonModalDialog(wxFrame): |
#class NonModalDialog(wxFrame): |
|
|
|
|
#def __init__(self, parent, name, title): |
|
|
#wxFrame.__init__(self, parent, -1, title) |
|
|
#self.parent = parent |
|
|
#self.name = name |
|
|
#EVT_CLOSE(self, self.OnClose) |
|
16 |
# |
# |
17 |
#def OnClose(self, event): |
# def __init__(self, parent, name, title): |
18 |
#self.parent.remove_dialog(self.name) |
# wxFrame.__init__(self, parent, -1, title, |
19 |
#self.Destroy() |
# style = wxDEFAULT_FRAME_STYLE ) |
20 |
|
# self.parent = parent |
21 |
|
# self.name = name |
22 |
|
# EVT_CLOSE(self, self.OnClose) |
23 |
|
# |
24 |
|
# def OnClose(self, event): |
25 |
|
# self.parent.remove_dialog(self.name) |
26 |
|
# self.Destroy() |
27 |
|
# |
28 |
from wxPython.wx import * |
from wxPython.wx import * |
29 |
|
|
30 |
class NonModalDialog(wxDialog): |
class NonModalDialog(wxDialog): |
|
|
|
31 |
def __init__(self, parent, name, title): |
def __init__(self, parent, name, title): |
32 |
wxDialog.__init__(self, parent, -1, title, |
wxDialog.__init__(self, parent, -1, title, |
33 |
style = wxDEFAULT_DIALOG_STYLE |
style = wxDEFAULT_DIALOG_STYLE |
34 |
| wxSYSTEM_MENU |
| wxSYSTEM_MENU |
35 |
| wxMINIMIZE_BOX |
| wxMINIMIZE_BOX |
36 |
| wxMAXIMIZE_BOX |
| wxMAXIMIZE_BOX |
37 |
| wxRESIZE_BORDER) |
| wxRESIZE_BORDER |
38 |
|
) |
39 |
|
self.parent = parent |
40 |
|
self.name = name |
41 |
|
EVT_CLOSE(self, self.OnClose) |
42 |
|
|
43 |
|
def OnClose(self, event): |
44 |
|
if self.parent.dialogs.has_key(self.name): |
45 |
|
self.parent.remove_dialog(self.name) |
46 |
|
self.Destroy() |
47 |
|
|
48 |
|
class NonModalNonParentDialog(wxDialog): |
49 |
|
def __init__(self, parent, name, title): |
50 |
|
wxDialog.__init__(self, None, -1, title, |
51 |
|
style = wxDEFAULT_DIALOG_STYLE |
52 |
|
| wxSYSTEM_MENU |
53 |
|
| wxMINIMIZE_BOX |
54 |
|
| wxMAXIMIZE_BOX |
55 |
|
| wxRESIZE_BORDER |
56 |
|
| wxDIALOG_NO_PARENT |
57 |
|
) |
58 |
self.parent = parent |
self.parent = parent |
59 |
self.name = name |
self.name = name |
60 |
EVT_CLOSE(self, self.OnClose) |
EVT_CLOSE(self, self.OnClose) |
61 |
|
|
62 |
def OnClose(self, event): |
def OnClose(self, event): |
63 |
self.parent.remove_dialog(self.name) |
if self.parent.dialogs.has_key(self.name): |
64 |
|
self.parent.remove_dialog(self.name) |
65 |
self.Destroy() |
self.Destroy() |