def _applySettings(self): s = SettingsManager() iIndex = wx.NOT_FOUND if self.optStartType[0].GetValue() is True: for i, o in enumerate(self.optDefPos): if o.GetValue() is True: iIndex = i break iStartPos = wx.ALIGN_NOT if iIndex > wx.NOT_FOUND: iH = 0 if iIndex in [0, 3, 6]: iH = wx.LEFT elif iIndex in [1, 4, 7]: iH = wx.CENTER else: iH = wx.RIGHT iV = 0 if (iIndex > -1) and (iIndex < 3): iV = wx.TOP elif (iIndex > 2) and (iIndex < 6): iV = wx.CENTER else: iV = wx.BOTTOM if (iH == wx.CENTER) and (iV == wx.CENTER): iStartPos = (wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) else: iStartPos = iH | iV s.MainWndStartupPos = iStartPos s.MultipleInstancesAllowed = self.chkSingleInstance.IsChecked( ) is False s.CompressSettingsFile = self.chkCompFile.IsChecked() self.btnApply.Disable()
def _onWindowResized(self, evt): if not self.IsShown(): return s = SettingsManager() if self.IsMaximized(): s.MainWndStartupPos = wx.DefaultPosition s.MainWndStartupSize = wx.DefaultSize else: s.MainWndStartupRect = self.GetRect() evt.Skip()