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

Method __init__

gui/targetProfileEditor.py:129–248  ·  view source on GitHub ↗
(self, parent)

Source from the content-addressed store, hash-verified

127 ('hp', (_t('Total HP\nAffects how much damage breacher pods can do. Leave blank for infinitely big value'), 'hp'))])
128
129 def __init__(self, parent):
130 super().__init__(
131 parent, id=wx.ID_ANY, title=_t("Target Profile Editor"), resizeable=True,
132 # Dropdown list widget is scaled to its longest content line on GTK, adapt to that
133 size=wx.Size(630, 240) if "wxGTK" in wx.PlatformInfo else wx.Size(450, 240))
134
135 self.mainFrame = gui.mainFrame.MainFrame.getInstance()
136 self.block = False
137 self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
138
139 mainSizer = wx.BoxSizer(wx.VERTICAL)
140
141 self.entityEditor = TargetProfileEntityEditor(parent=self)
142 mainSizer.Add(self.entityEditor, 0, wx.ALL | wx.EXPAND, 2)
143
144 self.sl = wx.StaticLine(self)
145 mainSizer.Add(self.sl, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
146
147 contentSizer = wx.BoxSizer(wx.VERTICAL)
148
149 resistEditSizer = wx.BoxSizer(wx.HORIZONTAL)
150 resistEditSizer.AddStretchSpacer()
151
152 defSize = wx.Size(70, -1)
153
154 for type_ in self.DAMAGE_TYPES:
155 leftPad = 25 if type_ != list(self.DAMAGE_TYPES)[0] else 0
156 ttText = self.DAMAGE_TYPES[type_]
157 bmp = wx.StaticBitmap(self, wx.ID_ANY, BitmapLoader.getBitmap("%s_big" % type_, "gui"))
158 bmp.SetToolTip(wx.ToolTip(ttText))
159 resistEditSizer.Add(bmp, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, leftPad)
160 # set text edit
161 editBox = FloatBox(parent=self, id=wx.ID_ANY, value=None, pos=wx.DefaultPosition, size=defSize)
162 editBox.SetToolTip(wx.ToolTip(ttText))
163 self.Bind(event=wx.EVT_TEXT, handler=self.OnFieldChanged, source=editBox)
164 setattr(self, '{}Edit'.format(type_), editBox)
165 resistEditSizer.Add(editBox, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
166 unit = wx.StaticText(self, wx.ID_ANY, "%", wx.DefaultPosition, wx.DefaultSize, 0)
167 unit.SetToolTip(wx.ToolTip(ttText))
168 resistEditSizer.Add(unit, 0, wx.BOTTOM | wx.TOP | wx.ALIGN_CENTER_VERTICAL, 5)
169
170 resistEditSizer.AddStretchSpacer()
171 contentSizer.Add(resistEditSizer, 1, wx.EXPAND | wx.ALL, 5)
172
173 miscAttrSizer = wx.BoxSizer(wx.HORIZONTAL)
174 miscAttrSizer.AddStretchSpacer()
175
176 for attr in self.ATTRIBUTES:
177 leftPad = 25 if attr != list(self.ATTRIBUTES)[0] else 0
178 ttText, unitText = self.ATTRIBUTES[attr]
179 bmp = wx.StaticBitmap(self, wx.ID_ANY, BitmapLoader.getBitmap("%s_big" % attr, "gui"))
180 bmp.SetToolTip(wx.ToolTip(ttText))
181 miscAttrSizer.Add(bmp, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, leftPad)
182 # set text edit
183 editBox = FloatBox(parent=self, id=wx.ID_ANY, value=None, pos=wx.DefaultPosition, size=defSize)
184 editBox.SetToolTip(wx.ToolTip(ttText))
185 self.Bind(event=wx.EVT_TEXT, handler=self.OnFieldChanged, source=editBox)
186 setattr(self, '{}Edit'.format(attr), editBox)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 10

patternChangedMethod · 0.95
FloatBoxClass · 0.90
GetBitmapMethod · 0.80
checkEntitiesExistMethod · 0.80
SetSizeMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
getBitmapMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected