コード例 #1
0
    def __init__(self,
                 resources=None,
                 view=None,
                 state=IMPORT,
                 modal=True,
                 parent=None):
        global dialogShowing
        dialogShowing = True

        self.resources = resources
        self.view = view
        self.state = state

        self.changedTimeZone = None

        pre = wx.PreDialog()
        self.resources.LoadOnDialog(pre, parent, "TurnOnTimezonesDialog")
        self.PostCreate(pre)

        self.text = wx.xrc.XRCCTRL(self, "Text")
        self.checkbox = wx.xrc.XRCCTRL(self, "Checkbox")
        self.chooser = wx.xrc.XRCCTRL(self, "Chooser")

        TimeZoneList.buildTZChoiceList(view, self.chooser)

        self.FillButtonPanel()

        self.SetText()

        self.Bind(wx.EVT_BUTTON, self.OnYes, id=wx.ID_YES)
        self.Bind(wx.EVT_BUTTON, self.OnNo, id=wx.ID_NO)
        self.Bind(wx.EVT_BUTTON, self.End, id=wx.ID_CANCEL)
        self.chooser.Bind(wx.EVT_CHOICE, self.OnTZChoice)

        self.Fit()
コード例 #2
0
ファイル: TurnOnTimezones.py プロジェクト: HackLinux/chandler
    def __init__(self, resources=None, view=None, state=IMPORT,
                 modal=True, parent=None):
        global dialogShowing
        dialogShowing = True

        self.resources = resources
        self.view      = view
        self.state     = state
        
        self.changedTimeZone = None

        pre = wx.PreDialog()
        self.resources.LoadOnDialog(pre, parent, "TurnOnTimezonesDialog")
        self.PostCreate(pre)

        self.text     = wx.xrc.XRCCTRL(self, "Text")
        self.checkbox = wx.xrc.XRCCTRL(self, "Checkbox")
        self.chooser  = wx.xrc.XRCCTRL(self, "Chooser")

        TimeZoneList.buildTZChoiceList(view, self.chooser)

        self.FillButtonPanel()        
        
        self.SetText()
        
        self.Bind(wx.EVT_BUTTON, self.OnYes, id=wx.ID_YES)
        self.Bind(wx.EVT_BUTTON, self.OnNo, id=wx.ID_NO)
        self.Bind(wx.EVT_BUTTON, self.End, id=wx.ID_CANCEL)
        self.chooser.Bind(wx.EVT_CHOICE, self.OnTZChoice)

        self.Fit()
コード例 #3
0
    def OnTZChoice(self, event):
        choiceIndex = self.chooser.GetSelection()
        if choiceIndex != -1:
            oldTZ = TimeZoneInfo.get(self.view).default
            newTZ = self.chooser.GetClientData(choiceIndex)
            if newTZ == TimeZoneList.TIMEZONE_OTHER_FLAG:
                newTZ = TimeZoneList.pickTimeZone(self.view)
                if newTZ is None:
                    newTZ = oldTZ
                TimeZoneList.buildTZChoiceList(self.view, self.chooser, newTZ)

            if newTZ != oldTZ:
                self.changedTimeZone = newTZ
コード例 #4
0
ファイル: TurnOnTimezones.py プロジェクト: HackLinux/chandler
    def OnTZChoice(self, event):
        choiceIndex = self.chooser.GetSelection()
        if choiceIndex != -1:
            oldTZ = TimeZoneInfo.get(self.view).default
            newTZ = self.chooser.GetClientData(choiceIndex)
            if newTZ == TimeZoneList.TIMEZONE_OTHER_FLAG:
                newTZ = TimeZoneList.pickTimeZone(self.view)
                if newTZ is None:
                    newTZ = oldTZ
                TimeZoneList.buildTZChoiceList(self.view, self.chooser, newTZ)

            if newTZ != oldTZ:
                self.changedTimeZone = newTZ