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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 535 by bh, Fri Mar 14 20:42:18 2003 UTC revision 1057 by frank, Tue May 27 11:30:02 2003 UTC
# Line 1  Line 1 
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.
# Line 9  Line 10 
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):
16    #
17    #    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    from wxPython.wx import *
29    
30    class NonModalDialog(wxDialog):
31        def __init__(self, parent, name, title):
32            wxDialog.__init__(self, parent, -1, title,
33                style = wxDEFAULT_DIALOG_STYLE
34                      | wxSYSTEM_MENU
35                      | wxMINIMIZE_BOX
36                      | wxMAXIMIZE_BOX
37                      | 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):      def __init__(self, parent, name, title):
50          wxFrame.__init__(self, parent, -1, title)          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()

Legend:
Removed from v.535  
changed lines
  Added in v.1057

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26