3 |
3 |
4 # This file is part of Beremiz, a Integrated Development Environment for |
4 # This file is part of Beremiz, a Integrated Development Environment for |
5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
6 # |
6 # |
7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
|
8 # Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com> |
8 # |
9 # |
9 # See COPYING file for copyrights details. |
10 # See COPYING file for copyrights details. |
10 # |
11 # |
11 # This program is free software; you can redistribute it and/or |
12 # This program is free software; you can redistribute it and/or |
12 # modify it under the terms of the GNU General Public License |
13 # modify it under the terms of the GNU General Public License |
75 |
76 |
76 self.SetSizer(self.MainSizer) |
77 self.SetSizer(self.MainSizer) |
77 |
78 |
78 def _init_ctrls(self, prnt): |
79 def _init_ctrls(self, prnt): |
79 wx.Dialog.__init__(self, id=ID_DISCOVERYDIALOG, |
80 wx.Dialog.__init__(self, id=ID_DISCOVERYDIALOG, |
80 name='DiscoveryDialog', parent=prnt, |
81 name='DiscoveryDialog', parent=prnt, style=wx.DEFAULT_DIALOG_STYLE, |
81 size=wx.Size(600, 600), style=wx.DEFAULT_DIALOG_STYLE, |
|
82 title=_('Service Discovery')) |
82 title=_('Service Discovery')) |
83 |
83 |
84 self.staticText1 = wx.StaticText(id=ID_DISCOVERYDIALOGSTATICTEXT1, |
84 self.staticText1 = wx.StaticText(id=ID_DISCOVERYDIALOGSTATICTEXT1, |
85 label=_('Services available:'), name='staticText1', parent=self, |
85 label=_('Services available:'), name='staticText1', parent=self, |
86 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
86 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
95 self.ServicesList.InsertColumn(3, _('PORT')) |
95 self.ServicesList.InsertColumn(3, _('PORT')) |
96 self.ServicesList.SetColumnWidth(0, 150) |
96 self.ServicesList.SetColumnWidth(0, 150) |
97 self.ServicesList.SetColumnWidth(1, 150) |
97 self.ServicesList.SetColumnWidth(1, 150) |
98 self.ServicesList.SetColumnWidth(2, 150) |
98 self.ServicesList.SetColumnWidth(2, 150) |
99 self.ServicesList.SetColumnWidth(3, 150) |
99 self.ServicesList.SetColumnWidth(3, 150) |
|
100 self.ServicesList.SetInitialSize(wx.Size(-1, 300)) |
100 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST) |
101 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST) |
101 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST) |
102 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST) |
102 |
103 |
103 listmix.ColumnSorterMixin.__init__(self, 4) |
104 listmix.ColumnSorterMixin.__init__(self, 4) |
104 |
105 |
118 self.Bind(wx.EVT_BUTTON, self.OnIpButton, id=ID_DISCOVERYDIALOGIPBUTTON) |
119 self.Bind(wx.EVT_BUTTON, self.OnIpButton, id=ID_DISCOVERYDIALOGIPBUTTON) |
119 |
120 |
120 self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTER) |
121 self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTER) |
121 |
122 |
122 self._init_sizers() |
123 self._init_sizers() |
|
124 self.Fit() |
123 |
125 |
124 def __init__(self, parent): |
126 def __init__(self, parent): |
125 self._init_ctrls(parent) |
127 self._init_ctrls(parent) |
126 |
128 |
127 self.itemDataMap = {} |
129 self.itemDataMap = {} |