(self, parent)
| 36 | |
| 37 | |
| 38 | def __init__(self, parent): |
| 39 | wx.Panel.__init__(self, parent) |
| 40 | |
| 41 | pyfalog.debug("Initialize marketBrowser") |
| 42 | vbox = wx.BoxSizer(wx.VERTICAL) |
| 43 | self.SetSizer(vbox) |
| 44 | |
| 45 | # Add a search box on top |
| 46 | self.search = SearchBox(self) |
| 47 | vbox.Add(self.search, 0, wx.EXPAND) |
| 48 | |
| 49 | self.splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE) |
| 50 | vbox.Add(self.splitter, 1, wx.EXPAND) |
| 51 | |
| 52 | # Grab service stuff and create child objects |
| 53 | self.sMkt = Market.getInstance() |
| 54 | self.settings = MarketPriceSettings.getInstance() |
| 55 | self.__mode = 'normal' |
| 56 | self.__normalBtnMap = {} |
| 57 | self.marketView = MarketTree(self.splitter, self) |
| 58 | self.itemView = ItemView(self.splitter, self) |
| 59 | |
| 60 | self.splitter.SplitHorizontally(self.marketView, self.itemView) |
| 61 | self.splitter.SetMinimumPaneSize(250) |
| 62 | |
| 63 | # Setup our buttons for metaGroup selection |
| 64 | # Same fix as for search box on macs, |
| 65 | # need some pixels of extra space or everything clips and is ugly |
| 66 | p = wx.Panel(self) |
| 67 | box = wx.BoxSizer(wx.HORIZONTAL) |
| 68 | p.SetSizer(box) |
| 69 | vbox.Add(p, 0, wx.EXPAND) |
| 70 | self.metaButtons = [] |
| 71 | btn = None |
| 72 | for name in list(self.sMkt.META_MAP.keys()): |
| 73 | btn = MetaButton(p, wx.ID_ANY, name.capitalize(), style=wx.BU_EXACTFIT) |
| 74 | setattr(self, name, btn) |
| 75 | box.Add(btn, 1, wx.ALIGN_CENTER) |
| 76 | btn.Bind(wx.EVT_TOGGLEBUTTON, self.toggleMetaButton) |
| 77 | btn.metaName = name |
| 78 | self.metaButtons.append(btn) |
| 79 | # Make itemview to set toggles according to list contents |
| 80 | self.itemView.setToggles() |
| 81 | |
| 82 | p.SetMinSize((wx.SIZE_AUTO_WIDTH, btn.GetSize()[1] + 5)) |
| 83 | |
| 84 | def toggleMetaButton(self, event): |
| 85 | """Process clicks on toggle buttons""" |
nothing calls this directly
no test coverage detected