def _init_image_list(self): image_list, mapping = self.node_tool.create_image_list() self.SetImageList(image_list, wx.IMAGE_LIST_SMALL) if not util.is_mac(): image_list, mapping = self.node_tool.create_image_list(size=(64, 64)) self.SetImageList(image_list, wx.IMAGE_LIST_NORMAL) # self.SetImageList(image_list, wx.IMAGE_LIST_NORMAL) self._image_list = image_list self._name_to_image_id = mapping
def OnGridFocus(self, evt): _ = evt # evt.Veto() # prev = evt.GetWindow() # # if prev == self.text_ctrl: # next_ = self.tree_ctrl # else: # next_ = self.text_ctrl next_ = self.text_ctrl if is_mac(): next_.SetFocus() else: # todo: test again! wx.CallLater(0.001, next_.SetFocus)
def _show_tip(self, row, col, vlog=None): if row < 0 or col < 0: return if util.is_mac(): return r, c = row, col # print 'show tip:', row, col # show tip t = self.GetTable() at = t.get_attr_type(r, c) if at: if not vlog: val = t.get_attr_value(r, c) vlog = at.verify(val, self._ctx.project) if vlog.has_error(): screen_width, _ = wx.DisplaySize() # rect = self.CellToRect(r, c) self._tip_window = CellTipWindow(self, vlog, screen_width / 3) self.position_tip(r, c) self._tip_window.Show()
def supports_list_mode(mode): if mode == LIST_MODE_REPORT: return True elif mode == LIST_MODE_ICON: return not util.is_mac()