def onChart(self, event): if self.selection != PDsInChartFrame.CHART: self.selection = PDsInChartFrame.CHART self.w.Destroy() if self.zod: self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, False, -1, self.GetClientSize()) else: self.w = mundanewnd.MundaneWnd(self, self.parent, self.options, self.chart, None, -1, self.GetClientSize())
def onComparison(self, event): if self.selection != PDsInChartFrame.COMPOUND: self.selection = PDsInChartFrame.COMPOUND self.w.Destroy() if self.zod: self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, True, -1, self.GetClientSize()) else: self.w = mundanewnd.MundaneWnd(self, self.parent, self.options, self.chart, self.radix, -1, self.GetClientSize())
def __init__(self, parent, title, chrt, radix, options, sel=0, zod=True): wx.Frame.__init__(self, parent, -1, title, wx.DefaultPosition, wx.Size(640, 400)) self.chart = chrt self.radix = radix self.options = options self.parent = parent self.title = title self.zod = zod self.pmenu = wx.Menu() self.ID_Selection = wx.NewId() self.ID_PrimaryDirections = wx.NewId() self.ID_SaveAsBitmap = wx.NewId() self.ID_BlackAndWhite = wx.NewId() self.ID_Chart = wx.NewId() self.ID_Comparison = wx.NewId() self.ID_Positions = wx.NewId() self.ID_Square = wx.NewId() self.selmenu = wx.Menu() self.chartmenu = self.selmenu.Append(self.ID_Chart, mtexts.txts['Chart'], '', wx.ITEM_RADIO) self.compoundmenu = self.selmenu.Append(self.ID_Comparison, mtexts.txts['Comparison'], '', wx.ITEM_RADIO) self.positionsmenu = self.selmenu.Append(self.ID_Positions, mtexts.txts['Positions'], '', wx.ITEM_RADIO) if self.zod: self.squaremenu = self.selmenu.Append(self.ID_Square, mtexts.txts['Square'], '', wx.ITEM_RADIO) self.pmenu.Append(self.ID_Selection, mtexts.txts['Windows'], self.selmenu) self.pmenu.Append(self.ID_SaveAsBitmap, mtexts.txts['SaveAsBmp'], mtexts.txts['SaveChart']) self.mbw = self.pmenu.Append(self.ID_BlackAndWhite, mtexts.txts['BlackAndWhite'], mtexts.txts['ChartBW'], wx.ITEM_CHECK) self.SetMinSize((200, 200)) self.Bind(wx.EVT_RIGHT_UP, self.onPopupMenu) self.Bind(wx.EVT_MENU, self.onChart, id=self.ID_Chart) self.Bind(wx.EVT_MENU, self.onComparison, id=self.ID_Comparison) self.Bind(wx.EVT_MENU, self.onPositions, id=self.ID_Positions) if self.zod: self.Bind(wx.EVT_MENU, self.onSquare, id=self.ID_Square) self.Bind(wx.EVT_MENU, self.onSaveAsBitmap, id=self.ID_SaveAsBitmap) self.Bind(wx.EVT_MENU, self.onBlackAndWhite, id=self.ID_BlackAndWhite) if self.options.bw: self.mbw.Check() self.selection = sel if sel == PDsInChartFrame.CHART: if self.zod: self.w = transitwnd.TransitWnd(self, self.chart, self.radix, options, parent) else: self.w = mundanewnd.MundaneWnd(self, self.parent, self.options, self.chart, None) self.chartmenu.Check() else: if self.zod: self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, True) else: self.w = mundanewnd.MundaneWnd(self, self.parent, self.options, self.chart, self.radix) self.compoundmenu.Check()
def __init__(self, parent, title, chrt, radix, options, sel=0): wx.Frame.__init__(self, parent, -1, title, wx.DefaultPosition, wx.Size(640, 400)) self.chart = chrt self.radix = radix self.options = options self.parent = parent self.title = title self.pmenu = wx.Menu() self.ID_Selection = wx.NewId() self.ID_PrimaryDirections = wx.NewId() self.ID_SaveAsBitmap = wx.NewId() self.ID_BlackAndWhite = wx.NewId() self.ID_Chart = wx.NewId() self.ID_Comparison = wx.NewId() self.ID_Positions = wx.NewId() self.ID_Square = wx.NewId() self.ID_PDDirect = wx.NewId() self.ID_PDConverse = wx.NewId() self.ID_PDToRadix = wx.NewId() self.selmenu = wx.Menu() self.chartmenu = self.selmenu.Append(self.ID_Chart, mtexts.txts['Chart'], '', wx.ITEM_RADIO) self.compoundmenu = self.selmenu.Append(self.ID_Comparison, mtexts.txts['Comparison'], '', wx.ITEM_RADIO) self.positionsmenu = self.selmenu.Append(self.ID_Positions, mtexts.txts['Positions'], '', wx.ITEM_RADIO) self.squaremenu = self.selmenu.Append(self.ID_Square, mtexts.txts['Square'], '', wx.ITEM_RADIO) self.pmenu.AppendMenu(self.ID_Selection, mtexts.txts['Windows'], self.selmenu) if self.chart.htype == chart.Chart.SOLAR or self.chart.htype == chart.Chart.LUNAR: self.pdselmenu = wx.Menu() self.pddirectmenu = self.pdselmenu.Append(self.ID_PDDirect, mtexts.txts['Direct'], '') self.pdconversemenu = self.pdselmenu.Append(self.ID_PDConverse, mtexts.txts['Converse'], '') self.pdtoradix = self.pdselmenu.Append(self.ID_PDToRadix, mtexts.txts['PDToRadix'], '', wx.ITEM_CHECK) self.pdtoradix.Enable(False) self.pmenu.AppendMenu(self.ID_PrimaryDirections, mtexts.txts['PrimaryDirs'], self.pdselmenu) self.pmenu.Append(self.ID_SaveAsBitmap, mtexts.txts['SaveAsBmp'], mtexts.txts['SaveChart']) self.mbw = self.pmenu.Append(self.ID_BlackAndWhite, mtexts.txts['BlackAndWhite'], mtexts.txts['ChartBW'], wx.ITEM_CHECK) self.SetMinSize((200,200)) self.Bind(wx.EVT_RIGHT_UP, self.onPopupMenu) self.Bind(wx.EVT_MENU, self.onChart, id=self.ID_Chart) self.Bind(wx.EVT_MENU, self.onComparison, id=self.ID_Comparison) self.Bind(wx.EVT_MENU, self.onPositions, id=self.ID_Positions) self.Bind(wx.EVT_MENU, self.onSquare, id=self.ID_Square) if self.chart.htype == chart.Chart.SOLAR or self.chart.htype == chart.Chart.LUNAR: self.Bind(wx.EVT_MENU, self.onPDDirect, id=self.ID_PDDirect) self.Bind(wx.EVT_MENU, self.onPDConverse, id=self.ID_PDConverse) self.Bind(wx.EVT_MENU, self.onPDToRadix, id=self.ID_PDToRadix) self.Bind(wx.EVT_MENU, self.onSaveAsBitmap, id=self.ID_SaveAsBitmap) self.Bind(wx.EVT_MENU, self.onBlackAndWhite, id=self.ID_BlackAndWhite) if self.options.bw: self.mbw.Check() self.selection = sel if sel == TransitFrame.CHART: self.w = transitwnd.TransitWnd(self, self.chart, radix, options, parent) self.chartmenu.Check() else: self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, True) self.compoundmenu.Check() self.Bind(EVT_PDREADY, self.OnPDReady)
def onComparison(self, event): if self.selection != TransitFrame.COMPOUND: self.selection = TransitFrame.COMPOUND self.w.Destroy() self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, True, -1, self.GetClientSize())
def onChart(self, event): if self.selection != TransitFrame.CHART: self.selection = TransitFrame.CHART self.w.Destroy() self.w = transitwnd.TransitWnd(self, self.chart, self.radix, self.options, self.parent, False, -1, self.GetClientSize())