示例#1
0
 def __init__(self):
     super(mainApp, self).__init__()
     self.log = logging.getLogger("mainApp")
     # Used to decide the connection string
     self.ModelConPool = squeezeConMdle()
     self.ModelGuiThread = taskBarMdle()
     self.ModelFrmSettings = mdlFrmSettings()
     self.ModelFrmNowPlaying = mdlFrmNowPlaying()
示例#2
0
 def __init__(self):
     super(mainApp, self).__init__()
     self.log = logging.getLogger("mainApp")
     # Used to decide the connection string
     self.ModelConPool = squeezeConMdle()
     self.ModelGuiThread = taskBarMdle()
     self.ModelFrmSettings = mdlFrmSettings()
     self.ModelFrmNowPlaying = mdlFrmNowPlaying()
示例#3
0
 def __init__(self, parent,  title):
     self.log = logging.getLogger("FrmSettings")
     self.callbacks = {
         "on_apply" : {},
         "on_save" : {},
         "on_cancel" : {},
     }
     self.parent = parent
     self.title = title
     w, h = (250, 250)
     wx.Frame.__init__(self, self.parent, -1, self.title, wx.DefaultPosition, wx.Size(w, h))
     self.CreateStatusBar()
     self.sizer = wx.GridBagSizer(8, 3)
     self.Connect(-1, -1, EVT_RESULT_CONNECTED_ID, self.OnConnected)
     self.Connect(-1, -1, EVT_RESULT_PLAYERS_ID, self.OnConnected)
     self.Connect(-1, -1, EVT_RESULT_CONNECTION_ID, self.OnConnected)
     self.BtnApply = wx.Button(self, -1, "Apply")
     self.BtnCancel = wx.Button(self, -1, "Cancel")
     self.BtnSave = wx.Button(self, -1, "Save")
     self.Bind(wx.EVT_BUTTON, self.OnCancel, id=self.BtnCancel.GetId())
     self.Bind(wx.EVT_BUTTON, self.OnSave, id=self.BtnSave.GetId())
     self.Bind(wx.EVT_BUTTON, self.OnApply, id=self.BtnApply.GetId())
     self.sizer.Add(self.BtnApply, (8, 0), wx.DefaultSpan, wx.EXPAND)
     self.sizer.Add(self.BtnCancel, (8, 1), wx.DefaultSpan, wx.EXPAND)
     self.sizer.Add(self.BtnSave, (8, 2), wx.DefaultSpan, wx.EXPAND)
     label1 = wx.StaticText(self, -1, 'Host:')
     self.sizer.Add(label1, (0, 0), wx.DefaultSpan, wx.EXPAND)
     self.tcHost = wx.TextCtrl(self, -1 )
     self.sizer.Add(self.tcHost , (0, 1), (1, 2), wx.EXPAND)
     label2 = wx.StaticText(self, -1, 'Port:')
     self.sizer.Add(label2, (1, 0), wx.DefaultSpan, wx.EXPAND)
     label3 = wx.StaticText(self, -1, 'Player:')
     self.sizer.Add(label3, (2, 0), wx.DefaultSpan, wx.EXPAND)
     self.scPort = wx.SpinCtrl(self, -1, unicode(9000),  min=1, max=99999)
     self.sizer.Add(self.scPort, (1, 1), wx.DefaultSpan, wx.EXPAND)
     #self.statusbar = self.CreateStatusBar()
     #self.sizer.Add(self.statusbar, (9, 0),(2,9), wx.EXPAND)
     self.cbPlayer = wx.ComboBox(self, -1, style=wx.CB_READONLY)
     self.sizer.Add(self.cbPlayer, (2, 1), (1, 2), wx.EXPAND)
     self.sizer.AddGrowableRow(8)
     self.sizer.AddGrowableCol(0)
     self.sizer.AddGrowableCol(1)
     self.sizer.AddGrowableCol(2)
     self.SetSizerAndFit(self.sizer)
     self.icon = wxIcons.trayDefault.getIcon()
     self.SetIcon(self.icon)
     self.IconStatus = None
     self.IconSize = None
     self.model = None
     self.GuiModel = mdlFrmSettings()
     self.GuiModel.statusText.addCallback(self.onStatusText)
     self.GuiModel.host.addCallback(self.onHost)
     self.GuiModel.port.addCallback(self.onPort)
     self.CurrentStatusText = None
示例#4
0
    def __init__(self, parent, title):
        self.log = logging.getLogger("FrmSettings")
        self.callbacks = {
            "on_apply": {},
            "on_save": {},
            "on_cancel": {},
        }
        self.parent = parent
        self.title = title
        w, h = (250, 250)
        wx.Frame.__init__(self, self.parent, -1, self.title,
                          wx.DefaultPosition, wx.Size(w, h))
        self.CreateStatusBar()
        self.sizer = wx.GridBagSizer(8, 3)
        self.Connect(-1, -1, EVT_RESULT_CONNECTED_ID, self.OnConnected)
        self.Connect(-1, -1, EVT_RESULT_PLAYERS_ID, self.OnConnected)
        self.Connect(-1, -1, EVT_RESULT_CONNECTION_ID, self.OnConnected)
        self.BtnApply = wx.Button(self, -1, "Apply")
        self.BtnCancel = wx.Button(self, -1, "Cancel")
        self.BtnSave = wx.Button(self, -1, "Save")

        self.Bind(wx.EVT_BUTTON, self.OnCancel, id=self.BtnCancel.GetId())
        self.Bind(wx.EVT_BUTTON, self.OnSave, id=self.BtnSave.GetId())
        self.Bind(wx.EVT_BUTTON, self.OnApply, id=self.BtnApply.GetId())

        self.sizer.Add(self.BtnApply, (8, 0), wx.DefaultSpan, wx.EXPAND)
        self.sizer.Add(self.BtnCancel, (8, 1), wx.DefaultSpan, wx.EXPAND)
        self.sizer.Add(self.BtnSave, (8, 2), wx.DefaultSpan, wx.EXPAND)

        label1 = wx.StaticText(self, -1, 'Host:')

        self.sizer.Add(label1, (0, 0), wx.DefaultSpan, wx.EXPAND)

        self.tcHost = wx.TextCtrl(self, -1)
        self.sizer.Add(self.tcHost, (0, 1), (1, 2), wx.EXPAND)
        label2 = wx.StaticText(self, -1, 'Port:')

        self.sizer.Add(label2, (1, 0), wx.DefaultSpan, wx.EXPAND)
        label3 = wx.StaticText(self, -1, 'Player:')

        self.sizer.Add(label3, (2, 0), wx.DefaultSpan, wx.EXPAND)

        self.scPort = wx.SpinCtrl(self, -1, unicode(9000), min=1, max=99999)
        self.sizer.Add(self.scPort, (1, 1), wx.DefaultSpan, wx.EXPAND)
        #self.statusbar = self.CreateStatusBar()
        #self.sizer.Add(self.statusbar, (9, 0),(2,9), wx.EXPAND)

        self.cbPlayer = wx.ComboBox(self, -1, style=wx.CB_READONLY)
        self.sizer.Add(self.cbPlayer, (2, 1), (1, 2), wx.EXPAND)

        self.sizer.AddGrowableRow(8)
        self.sizer.AddGrowableCol(0)
        self.sizer.AddGrowableCol(1)
        self.sizer.AddGrowableCol(2)

        self.SetSizerAndFit(self.sizer)

        self.icon = wxIcons.trayDefault.getIcon()
        self.SetIcon(self.icon)
        self.IconStatus = None
        self.IconSize = None
        self.model = None
        self.GuiModel = mdlFrmSettings()
        self.GuiModel.statusText.addCallback(self.onStatusText)
        self.GuiModel.host.addCallback(self.onHost)
        self.GuiModel.port.addCallback(self.onPort)

        self.CurrentStatusText = None