MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / __init__

Method __init__

gui/marketBrowser.py:38–82  ·  view source on GitHub ↗
(self, parent)

Source from the content-addressed store, hash-verified

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"""

Callers

nothing calls this directly

Calls 9

SearchBoxClass · 0.90
MarketTreeClass · 0.90
ItemViewClass · 0.90
MetaButtonClass · 0.90
setTogglesMethod · 0.80
getInstanceMethod · 0.45
keysMethod · 0.45
appendMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected