/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/dialogs.py
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/Thuban/UI/dialogs.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1057 - (hide annotations)
Tue May 27 11:30:02 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/UI/dialogs.py
File MIME type: text/x-python
File size: 1981 byte(s)
(NonModalNonParentDialog): New class, without
	parent, i.e. can fall behind other windows.
(NonModalDialog.OnClose): Check is dialog is in mainwindow.dialog
	dictionary before removing it.

1 bh 535 # Copyright (c) 2001, 2003 by Intevation GmbH
2 bh 28 # Authors:
3     # Bernhard Herzog <[email protected]>
4 frank 1057 # Frank Koormann <[email protected]>
5 bh 28 #
6     # This program is free software under the GPL (>=v2)
7     # Read the file COPYING coming with Thuban for details.
8    
9     """Base classes for dialogs"""
10    
11     __version__ = "$Revision$"
12    
13 frank 1057 from wxPython.wx import wxFrame, wxDEFAULT_FRAME_STYLE, EVT_CLOSE
14 bh 28
15 jonathan 814 #class NonModalDialog(wxFrame):
16     #
17 frank 1057 # def __init__(self, parent, name, title):
18     # wxFrame.__init__(self, parent, -1, title,
19     # 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 jonathan 814 from wxPython.wx import *
29    
30     class NonModalDialog(wxDialog):
31 bh 535 def __init__(self, parent, name, title):
32 jonathan 814 wxDialog.__init__(self, parent, -1, title,
33     style = wxDEFAULT_DIALOG_STYLE
34     | wxSYSTEM_MENU
35     | wxMINIMIZE_BOX
36     | wxMAXIMIZE_BOX
37 frank 1057 | wxRESIZE_BORDER
38     )
39 bh 28 self.parent = parent
40     self.name = name
41     EVT_CLOSE(self, self.OnClose)
42    
43     def OnClose(self, event):
44 frank 1057 if self.parent.dialogs.has_key(self.name):
45     self.parent.remove_dialog(self.name)
46 bh 28 self.Destroy()
47 frank 1057
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
59     self.name = name
60     EVT_CLOSE(self, self.OnClose)
61    
62     def OnClose(self, event):
63     if self.parent.dialogs.has_key(self.name):
64     self.parent.remove_dialog(self.name)
65     self.Destroy()

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26