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

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

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

revision 1694 by bh, Mon Aug 25 13:55:35 2003 UTC revision 1695 by bh, Mon Sep 1 12:45:07 2003 UTC
# Line 36  ID_LB_DCLICK         = 9204 Line 36  ID_LB_DCLICK         = 9204
36    
37  class ChooseDBTableDialog(wxDialog):  class ChooseDBTableDialog(wxDialog):
38    
39      def __init__(self, session, *args, **kwds):      def __init__(self, parent, session):
40          kwds["style"] = wxDIALOG_MODAL|wxCAPTION          wxDialog.__init__(self, parent, -1, _("Choose layer from database"),
41          wxDialog.__init__(self, *args, **kwds)                            style = wxDIALOG_MODAL|wxCAPTION)
42          self.session = session          self.session = session
43          self.dbconns = self.session.DBConnections()          self.dbconns = self.session.DBConnections()
44          self.tables = []          self.tables = []
45          self.list_box_4 = wxListBox(self, -1)          self.list_box_4 = wxListBox(self, -1)
46          for i in range(len(self.dbconns)):          for i in range(len(self.dbconns)):
47              self.list_box_4.Append(self.dbconns[i].BriefDescription())              self.list_box_4.Append(self.dbconns[i].BriefDescription())
48            if self.list_box_4.GetCount() > 0:
49                self.list_box_4.SetSelection(0, True)
50          self.DB_CHOOSE_RETRIEVE = wxButton(self, ID_DBCHOOSE_RETRIEVE,          self.DB_CHOOSE_RETRIEVE = wxButton(self, ID_DBCHOOSE_RETRIEVE,
51                                             _("Retrieve"))                                             _("Retrieve"))
52          self.list_box_5 = wxListBox(self, ID_LB_DCLICK)          self.list_box_5 = wxListBox(self, ID_LB_DCLICK)
53          self.DB_CHOOSE_OK = wxButton(self, ID_DBCHOOSE_OK, _("OK"))          self.DB_CHOOSE_OK = wxButton(self, ID_DBCHOOSE_OK, _("OK"))
54          self.DB_CHOOSE_CANCEL = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel"))          self.DB_CHOOSE_CANCEL = wxButton(self, ID_DBCHOOSE_CANCEL, _("Cancel"))
         self.__set_properties()  
55          self.__do_layout()          self.__do_layout()
56    
57          EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK)          EVT_BUTTON(self, ID_DBCHOOSE_OK, self.OnOK)
# Line 58  class ChooseDBTableDialog(wxDialog): Line 59  class ChooseDBTableDialog(wxDialog):
59          EVT_BUTTON(self, ID_DBCHOOSE_RETRIEVE, self.OnRetrieve)          EVT_BUTTON(self, ID_DBCHOOSE_RETRIEVE, self.OnRetrieve)
60          EVT_LISTBOX_DCLICK(self, ID_LB_DCLICK, self.OnLBDClick)          EVT_LISTBOX_DCLICK(self, ID_LB_DCLICK, self.OnLBDClick)
61    
   
     def __set_properties(self):  
         self.SetTitle(_("Choose layer from database"))  
         self.list_box_4.SetSelection(0)  
         self.list_box_5.SetSelection(0)  
   
62      def __do_layout(self):      def __do_layout(self):
63          grid_sizer_1 = wxFlexGridSizer(2, 1, 0, 0)          grid_sizer_1 = wxFlexGridSizer(2, 1, 0, 0)
64          grid_sizer_3 = wxFlexGridSizer(1, 2, 0, 0)          grid_sizer_3 = wxFlexGridSizer(1, 2, 0, 0)
# Line 108  class ChooseDBTableDialog(wxDialog): Line 103  class ChooseDBTableDialog(wxDialog):
103      def OnLBDClick(self, event):      def OnLBDClick(self, event):
104          if self.list_box_5.GetSelection() >= 0:          if self.list_box_5.GetSelection() >= 0:
105              self.EndModal(wxID_OK)              self.EndModal(wxID_OK)
106              self.Show(false)              self.Show(False)
107    
108      def OnOK(self, event):      def OnOK(self, event):
109          self.EndModal(wxID_OK)          self.EndModal(wxID_OK)
110          self.Show(false)          self.Show(False)
111    
112      def OnCancel(self, event):      def OnCancel(self, event):
113          self.EndModal(wxID_CANCEL)          self.EndModal(wxID_CANCEL)
114          self.Show(false)          self.Show(False)
115    
116    
117  class DBDialog(wxDialog):  class DBDialog(wxDialog):
# Line 202  class DBDialog(wxDialog): Line 197  class DBDialog(wxDialog):
197              self.EndModal(wxID_OK)              self.EndModal(wxID_OK)
198          else:          else:
199              self.EndModal(wxID_CANCEL)              self.EndModal(wxID_CANCEL)
200          self.Show(false)          self.Show(False)
201    
202      def OnOK(self, event):      def OnOK(self, event):
203          result = {}          result = {}
# Line 244  class DBFrame(NonModalDialog): Line 239  class DBFrame(NonModalDialog):
239      def __set_properties(self):      def __set_properties(self):
240          self.SetTitle(_("Database Management"))          self.SetTitle(_("Database Management"))
241          self.DB_ListBox.SetSize((200, 157))          self.DB_ListBox.SetSize((200, 157))
         self.DB_ListBox.SetSelection(0)  
242    
243      def __do_layout(self):      def __do_layout(self):
244          top = wxBoxSizer(wxVERTICAL)          top = wxBoxSizer(wxVERTICAL)

Legend:
Removed from v.1694  
changed lines
  Added in v.1695

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26