(self, parent)
| 294 | class SkillTreeView(wx.Panel): |
| 295 | |
| 296 | def __init__(self, parent): |
| 297 | wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, |
| 298 | style=wx.TAB_TRAVERSAL) |
| 299 | self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor |
| 300 | self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)) |
| 301 | |
| 302 | pmainSizer = wx.BoxSizer(wx.VERTICAL) |
| 303 | |
| 304 | hSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 305 | |
| 306 | self.clonesChoice = wx.Choice(self, wx.ID_ANY, style=0) |
| 307 | i = self.clonesChoice.Append("Omega Clone", None) |
| 308 | self.clonesChoice.SetSelection(i) |
| 309 | hSizer.Add(self.clonesChoice, 5, wx.ALL | wx.EXPAND, 5) |
| 310 | |
| 311 | self.searchInput = wx.SearchCtrl(self, wx.ID_ANY) |
| 312 | hSizer.Add(self.searchInput, 1, wx.ALL | wx.EXPAND, 5) |
| 313 | self.searchInput.Bind(wx.EVT_TEXT, self.delaySearch) |
| 314 | |
| 315 | sChar = Character.getInstance() |
| 316 | self.alphaClones = sChar.getAlphaCloneList() |
| 317 | char = self.charEditor.entityEditor.getActiveEntity() |
| 318 | |
| 319 | for clone in self.alphaClones: |
| 320 | i = self.clonesChoice.Append(clone.alphaCloneName, clone.ID) |
| 321 | if clone.ID == char.alphaCloneID: |
| 322 | self.clonesChoice.SetSelection(i) |
| 323 | |
| 324 | self.clonesChoice.Bind(wx.EVT_CHOICE, self.cloneChanged) |
| 325 | |
| 326 | self.clonesChoice.SetToolTip( |
| 327 | wx.ToolTip(_t("Setting an Alpha clone does not replace the character's skills, but rather caps them to Alpha levels."))) |
| 328 | |
| 329 | pmainSizer.Add(hSizer, 0, wx.EXPAND | wx.ALL, 5) |
| 330 | |
| 331 | # Set up timer for skill search |
| 332 | self.searchTimer = wx.Timer(self) |
| 333 | self.Bind(wx.EVT_TIMER, self.populateSkillTreeSkillSearch, self.searchTimer) |
| 334 | |
| 335 | tree = self.skillTreeListCtrl = TreeListCtrl(self, wx.ID_ANY, style=wx.dataview.TL_DEFAULT_STYLE) |
| 336 | pmainSizer.Add(tree, 1, wx.EXPAND | wx.ALL, 5) |
| 337 | |
| 338 | self.imageList = wx.ImageList(16, 16) |
| 339 | tree.SetImageList(self.imageList) |
| 340 | self.skillBookImageId = self.imageList.Add(wx.Icon(BitmapLoader.getBitmap("skill_small", "gui"))) |
| 341 | self.skillBookDirtyImageId = self.imageList.Add(wx.Icon(BitmapLoader.getBitmap("skill_small_red", "gui"))) |
| 342 | |
| 343 | tree.AppendColumn(_t("Skill")) |
| 344 | tree.AppendColumn(_t("Level")) |
| 345 | # tree.SetMainColumn(0) |
| 346 | |
| 347 | self.root = tree.GetRootItem() |
| 348 | # self.root = tree.AppendItem(root, "Skills") |
| 349 | # |
| 350 | # tree.SetItemText(self.root, 1, "Levels") |
| 351 | |
| 352 | # first one doesn't work right in Windows. Second one doesn't work right in GTK. Together, we make sure it works. |
| 353 | # Gotta love wx |
nothing calls this directly
no test coverage detected