78 self._init_coll_ButtonGridSizer_Items(self.ButtonGridSizer) |
78 self._init_coll_ButtonGridSizer_Items(self.ButtonGridSizer) |
79 self._init_coll_ButtonGridSizer_Growables(self.ButtonGridSizer) |
79 self._init_coll_ButtonGridSizer_Growables(self.ButtonGridSizer) |
80 |
80 |
81 self.SetSizer(self.MainSizer) |
81 self.SetSizer(self.MainSizer) |
82 |
82 |
83 def _init_ctrls(self, prnt): |
83 def _init_list_ctrl(self): |
84 wx.Dialog.__init__( |
|
85 self, id=ID_DISCOVERYDIALOG, |
|
86 name='DiscoveryDialog', parent=prnt, style=wx.DEFAULT_DIALOG_STYLE, |
|
87 title=_('Service Discovery')) |
|
88 |
|
89 self.staticText1 = wx.StaticText( |
|
90 id=ID_DISCOVERYDIALOGSTATICTEXT1, |
|
91 label=_('Services available:'), name='staticText1', parent=self, |
|
92 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
|
93 |
|
94 # Set up list control |
84 # Set up list control |
95 self.ServicesList = AutoWidthListCtrl( |
85 self.ServicesList = AutoWidthListCtrl( |
96 id=ID_DISCOVERYDIALOGSERVICESLIST, |
86 id=ID_DISCOVERYDIALOGSERVICESLIST, |
97 name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), |
87 name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), |
98 style=wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL) |
88 style=wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL) |
106 self.ServicesList.SetColumnWidth(3, 150) |
96 self.ServicesList.SetColumnWidth(3, 150) |
107 self.ServicesList.SetInitialSize(wx.Size(-1, 300)) |
97 self.ServicesList.SetInitialSize(wx.Size(-1, 300)) |
108 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST) |
98 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST) |
109 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST) |
99 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST) |
110 |
100 |
111 listmix.ColumnSorterMixin.__init__(self, 4) |
101 def _init_ctrls(self, prnt): |
|
102 self.staticText1 = wx.StaticText( |
|
103 id=ID_DISCOVERYDIALOGSTATICTEXT1, |
|
104 label=_('Services available:'), name='staticText1', parent=self, |
|
105 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
112 |
106 |
113 self.RefreshButton = wx.Button( |
107 self.RefreshButton = wx.Button( |
114 id=ID_DISCOVERYDIALOGREFRESHBUTTON, |
108 id=ID_DISCOVERYDIALOGREFRESHBUTTON, |
115 label=_('Refresh'), name='RefreshButton', parent=self, |
109 label=_('Refresh'), name='RefreshButton', parent=self, |
116 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
110 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
132 |
126 |
133 self._init_sizers() |
127 self._init_sizers() |
134 self.Fit() |
128 self.Fit() |
135 |
129 |
136 def __init__(self, parent): |
130 def __init__(self, parent): |
|
131 wx.Dialog.__init__( |
|
132 self, id=ID_DISCOVERYDIALOG, |
|
133 name='DiscoveryDialog', parent=parent, |
|
134 style=wx.DEFAULT_DIALOG_STYLE, |
|
135 title=_('Service Discovery')) |
|
136 |
|
137 self._init_list_ctrl() |
|
138 listmix.ColumnSorterMixin.__init__(self, 4) |
|
139 |
137 self._init_ctrls(parent) |
140 self._init_ctrls(parent) |
138 |
141 |
139 self.itemDataMap = {} |
142 self.itemDataMap = {} |
140 self.nextItemId = 0 |
143 self.nextItemId = 0 |
141 |
144 |