DiscoveryDialog.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
def _init_ctrls(self, prnt):
        wx.Dialog.__init__(
            self, id=ID_DISCOVERYDIALOG,
            name='DiscoveryDialog', parent=prnt, style=wx.DEFAULT_DIALOG_STYLE,
            title=_('Service Discovery'))

        self.staticText1 = wx.StaticText(
            id=ID_DISCOVERYDIALOGSTATICTEXT1,
            label=_('Services available:'), name='staticText1', parent=self,
            pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)

        # Set up list control
        self.ServicesList = AutoWidthListCtrl(
            id=ID_DISCOVERYDIALOGSERVICESLIST,
            name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0),
            style=wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL)
        self.ServicesList.InsertColumn(0, _('NAME'))
        self.ServicesList.InsertColumn(1, _('TYPE'))
        self.ServicesList.InsertColumn(2, _('IP'))
        self.ServicesList.InsertColumn(3, _('PORT'))
        self.ServicesList.SetColumnWidth(0, 150)
        self.ServicesList.SetColumnWidth(1, 150)
        self.ServicesList.SetColumnWidth(2, 150)
        self.ServicesList.SetColumnWidth(3, 150)
        self.ServicesList.SetInitialSize(wx.Size(-1, 300))
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST)

        listmix.ColumnSorterMixin.__init__(self, 4)

        self.RefreshButton = wx.Button(
            id=ID_DISCOVERYDIALOGREFRESHBUTTON,
            label=_('Refresh'), name='RefreshButton', parent=self,
            pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
        self.Bind(wx.EVT_BUTTON, self.OnRefreshButton, id=ID_DISCOVERYDIALOGREFRESHBUTTON)

        self.LocalButton = wx.Button(
            id=ID_DISCOVERYDIALOGLOCALBUTTON,
            label=_('Local'), name='LocalButton', parent=self,
            pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
        self.Bind(wx.EVT_BUTTON, self.OnLocalButton, id=ID_DISCOVERYDIALOGLOCALBUTTON)

        self.IpButton = wx.Button(
            id=ID_DISCOVERYDIALOGIPBUTTON,
            label=_('Add IP'), name='IpButton', parent=self,
            pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
        self.Bind(wx.EVT_BUTTON, self.OnIpButton, id=ID_DISCOVERYDIALOGIPBUTTON)

        self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTER)

        self._init_sizers()
        self.Fit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号