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 * |
14 |
|
|
15 |
#class NonModalDialog(wxFrame): |
class ThubanFrame(wxFrame): |
16 |
|
|
17 |
#def __init__(self, parent, name, title): |
def __init__(self, parent, name, title): |
18 |
#wxFrame.__init__(self, parent, -1, title) |
wxFrame.__init__(self, parent, -1, title, |
19 |
#self.parent = parent |
style = wxDEFAULT_FRAME_STYLE ) |
20 |
#self.name = name |
self.parent = parent |
21 |
#EVT_CLOSE(self, self.OnClose) |
self.name = name |
22 |
# |
EVT_CLOSE(self, self.OnClose) |
23 |
#def OnClose(self, event): |
EVT_WINDOW_DESTROY(self, self.OnDestroy) |
|
#self.parent.remove_dialog(self.name) |
|
|
#self.Destroy() |
|
24 |
|
|
25 |
from wxPython.wx import * |
def OnClose(self, event): |
26 |
|
# FIXME: Shouldn't this really be in OnDestroy? |
27 |
|
if self.parent.dialogs.has_key(self.name): |
28 |
|
self.parent.remove_dialog(self.name) |
29 |
|
self.Destroy() |
30 |
|
|
31 |
|
def OnDestroy(self, event): |
32 |
|
"""Implement in derived classes for resource cleanup, etc.""" |
33 |
|
|
|
class NonModalDialog(wxDialog): |
|
34 |
|
|
35 |
|
class NonModalDialog(wxDialog): |
36 |
def __init__(self, parent, name, title): |
def __init__(self, parent, name, title): |
37 |
wxDialog.__init__(self, parent, -1, title, |
wxDialog.__init__(self, parent, -1, title, |
38 |
style = wxDEFAULT_DIALOG_STYLE |
style = wxDEFAULT_DIALOG_STYLE |
39 |
| wxSYSTEM_MENU |
| wxSYSTEM_MENU |
40 |
| wxMINIMIZE_BOX |
| wxMINIMIZE_BOX |
41 |
| wxMAXIMIZE_BOX |
| wxMAXIMIZE_BOX |
42 |
| wxRESIZE_BORDER) |
| wxRESIZE_BORDER |
43 |
|
) |
44 |
|
self.parent = parent |
45 |
|
self.name = name |
46 |
|
EVT_CLOSE(self, self.OnClose) |
47 |
|
|
48 |
|
def OnClose(self, event): |
49 |
|
if self.parent.dialogs.has_key(self.name): |
50 |
|
self.parent.remove_dialog(self.name) |
51 |
|
self.Destroy() |
52 |
|
|
53 |
|
class NonModalNonParentDialog(wxDialog): |
54 |
|
def __init__(self, parent, name, title): |
55 |
|
wxDialog.__init__(self, None, -1, title, |
56 |
|
style = wxDEFAULT_DIALOG_STYLE |
57 |
|
| wxSYSTEM_MENU |
58 |
|
| wxMINIMIZE_BOX |
59 |
|
| wxMAXIMIZE_BOX |
60 |
|
| wxRESIZE_BORDER |
61 |
|
| wxDIALOG_NO_PARENT |
62 |
|
) |
63 |
self.parent = parent |
self.parent = parent |
64 |
self.name = name |
self.name = name |
65 |
EVT_CLOSE(self, self.OnClose) |
EVT_CLOSE(self, self.OnClose) |
66 |
|
|
67 |
def OnClose(self, event): |
def OnClose(self, event): |
68 |
self.parent.remove_dialog(self.name) |
if self.parent.dialogs.has_key(self.name): |
69 |
|
self.parent.remove_dialog(self.name) |
70 |
self.Destroy() |
self.Destroy() |