python类TableViewCell()的实例源码

UserContributedManagementView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        status = self.data[row].status
        cell = ui.TableViewCell('subtitle')
        cell.text_label.text = self.data[row].name
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.tintColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.detail_text_label.text_color = self.theme_manager.currentTheme.subTextColour
        if not status == 'downloading':
            cell.detail_text_label.text = status
        else:
            cell.detail_text_label.text = self.data[row].stats
        cell.detail_text_label.text = cell.detail_text_label.text + ' - Contributed by ' + self.data[row].authorName
        if not self.data[row].image == None:
            cell.image_view.image = self.data[row].image
        iv = self.__getDetailButtonForStatus(status, cell.height, self.action, self.data[row])
        iv.x = cell.content_view.width - (iv.width * 1.5)
        iv.y = (cell.content_view.height) - (iv.height * 1.05)
        iv.flex = 'L'
        cell.content_view.add_subview(iv)
        cell.selectable = False
        return cell
DocsetManagementView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        status = self.data[row]['status']
        cell = ui.TableViewCell('subtitle')
        cell.text_label.text = self.data[row]['name']
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.tintColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.detail_text_label.text_color = self.theme_manager.currentTheme.subTextColour
        if not status == 'downloading' or not 'stats' in self.data[row].keys():
            cell.detail_text_label.text = status
        else:
            cell.detail_text_label.text = self.data[row]['stats']
        if not self.data[row]['image'] == None:
            cell.image_view.image = self.data[row]['image']
        iv = self.__getDetailButtonForStatus(status, cell.height, self.action, self.data[row])
        iv.x = cell.content_view.width - (iv.width * 1.5)
        iv.y = (cell.content_view.height) - (iv.height * 1.05)
        iv.flex = 'L'
        cell.content_view.add_subview(iv)
        cell.selectable = False
        return cell
DocsetView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.toolbarBackgroundColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.title_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.text_label.text = self.data[row].plural
        cell.accessory_type = 'disclosure_indicator'
        selectedBackgroundView = ui.View()
        selectedBackgroundView.background_color = self.theme_manager.currentTheme.cellSelectionColour
        if not self.theme_manager.currentTheme.showCellSelection:
            selectedBackgroundView.alpha = 0
        cell.selected_background_view = selectedBackgroundView
        if not self.data[row].icon == None:
            cell.image_view.image = self.data[row].icon
        return cell
SettingsView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()       
        cell.border_color = self.theme_manager.currentTheme.borderColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        selectedBackgroundView = ui.View()
        selectedBackgroundView.background_color = self.theme_manager.currentTheme.settingsCellSelectionColour
        if not self.theme_manager.currentTheme.showSettingsCellSelection:
            selectedBackgroundView.alpha = 0
        cell.selected_background_view = selectedBackgroundView
        if section == self.docset_section_number:
            cell.text_label.text = self.data[row]
            cell.accessory_type = 'disclosure_indicator'
        elif section == self.ack_section_number:
            cell.text_label.text = self.ack_data[row]['text']
        elif section == self.pydoc_updates_section_number:
            cell.text_label.text = self.updates_data[row]
        elif section == self.theme_section_number:
            cell.text_label.text = self.theme_data[row]
        elif section == self.websearch_section_number:
            cell.text_label.text = self.webSearch_data[row]
        return cell
StackOverflowManagementView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        status = self.data[row].status
        cell = ui.TableViewCell('subtitle')
        cell.text_label.text = self.data[row].name + ' (' + self.data[row].type + ')'
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.tintColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.detail_text_label.text_color = self.theme_manager.currentTheme.subTextColour
        if not status == 'downloading':
            cell.detail_text_label.text = status
        else:
            cell.detail_text_label.text = self.data[row].stats
        if not self.data[row].image == None:
            cell.image_view.image = self.data[row].image
        iv = self.__getDetailButtonForStatus(status, cell.height, self.action, self.data[row])
        iv.x = cell.content_view.width - (iv.width * 1.5)
        iv.y = (cell.content_view.height) - (iv.height * 1.05)
        iv.flex = 'L'
        cell.content_view.add_subview(iv)
        cell.selectable = False
        return cell
TransferManagementView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        k = list(self.data.keys())[section]
        cell = ui.TableViewCell('subtitle')
        cell.text_label.text = self.data[k][row].name
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.tintColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.detail_text_label.text_color = self.theme_manager.currentTheme.subTextColour
        if not self.data[k][row].status == 'Installing':
            cell.detail_text_label.text = self.data[k][row].status
        else:
            cell.detail_text_label.text = self.data[k][row].stats
        if not self.data[k][row].image == None:
            cell.image_view.image = self.data[k][row].image
        iv = self.__getDetailButtonForStatus(self.data[k][row].status, cell.height, self.action, self.data[k][row])
        iv.x = cell.content_view.width - (iv.width * 1.5)
        iv.y = (cell.content_view.height) - (iv.height * 1.05)
        iv.flex = 'L'
        cell.content_view.add_subview(iv)
        cell.selectable = False
        return cell
CheatsheetManagementView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        status = self.data[row].status
        cell = ui.TableViewCell('subtitle')
        cell.text_label.text = self.data[row].name
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.tintColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        cell.detail_text_label.text_color = self.theme_manager.currentTheme.subTextColour
        if not status == 'downloading':
            cell.detail_text_label.text = status
        else:
            cell.detail_text_label.text = self.data[row].stats
        if not self.data[row].image == None:
            cell.image_view.image = self.data[row].image
        iv = self.__getDetailButtonForStatus(status, cell.height, self.action, self.data[row])
        iv.x = cell.content_view.width - (iv.width * 1.5)
        iv.y = (cell.content_view.height) - (iv.height * 1.05)
        iv.flex = 'L'
        cell.content_view.add_subview(iv)
        cell.selectable = False
        return cell
DocsetIndexView.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.text_label.text = self.data[row]['name']
        cell.accessory_type = 'disclosure_indicator'
        cell.border_color = self.theme_manager.currentTheme.tintColour
        cell.background_color = self.theme_manager.currentTheme.backgroundColour
        cell.bar_tint_color = self.theme_manager.currentTheme.toolbarBackgroundColour
        cell.bg_color = self.theme_manager.currentTheme.backgroundColour
        cell.tint_color = self.theme_manager.currentTheme.tintColour
        cell.title_color = self.theme_manager.currentTheme.tintColour
        cell.text_label.text_color = self.theme_manager.currentTheme.textColour
        selectedBackgroundView = ui.View()
        selectedBackgroundView.background_color = self.theme_manager.currentTheme.cellSelectionColour
        if not self.theme_manager.currentTheme.showCellSelection:
            selectedBackgroundView.alpha = 0
        cell.selected_background_view = selectedBackgroundView      
        if not self.data[row]['type'].icon == None:
            cell.image_view.image = self.data[row]['type'].icon
        return cell
ElementListView.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        section_key = self.elements.keys()[section]
        try:
            cell = ui.TableViewCell('subtitle')
            cell.background_color = self.thememanager.main_background_colour
            cell.text_label.text_color = self.thememanager.main_text_colour
            cell.text_label.text = self.elements[section_key][row].get_title()
            cell.detail_text_label.text = self.elements[section_key][row].get_description()
            cell.detail_text_label.text_color = self.thememanager.main_text_colour
            cell.image_view.image = ui.Image.named(self.elements[section_key][row].get_icon())
            cell.selectable = True
            return cell
        except:
            cell = ui.TableViewCell('subtitle')
            cell.text_label.text = self.elements[section_key][row].get_title()
            cell.detail_text_label.text = 'Is invalid please check file in elements folder'
            cell.selectable = False
            return cell
ElementManagementView.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        section_key = self.elements.keys()[section]
        try:
            cell = ui.TableViewCell('subtitle')
            cell.text_label.text = self.elements[section_key][row].get_title()
            cell.detail_text_label.text = self.elements[section_key][row].get_description()
            cell.image_view.image = ui.Image.named(self.elements[section_key][row].get_icon())
            cell.selectable = False
            cell.background_color = self.thememanager.main_background_colour
            cell.text_label.text_color = self.thememanager.main_text_colour
            cell.detail_text_label.text_color = self.thememanager.main_text_colour
            return cell
        except:
            cell = ui.TableViewCell('subtitle')
            cell.text_label.text = self.elements[section_key][row].get_title()
            cell.detail_text_label.text = 'Is invalid please check file in elements folder'
            cell.selectable = False
            return cell
SebastianJarsve_webbrowser.py 文件源码 项目:py-search 作者: vieira-rafael 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def init_size(self): # initialize with correct size when landscape      orientation = ui.WebView(frame=(0,0,100,200)).eval_js('window.orientation') if orientation in (-90, 90): self.frame = (0, 0, self.height, self.width)
 def did_load(self): self.init_buttons() self.init_webbrowser() self.init_addressbar() self.init_size() self.flex = 'WH' self.bookmarks = self.load_bookmarks() self.history = self.load_history() self.addressbar_is_editing = False self.webpage_has_loaded = False self.favourite_images = {True :ui.Image.named('ionicons-ios7-star-32'), False:ui.Image.named('ionicons-ios7-star-outline-32')}
 def save_history(self, filename=filename_history): with open(filename, 'w') as f:          url = self.get_url() if url in self.history: self.history.remove(url) self.history.append(url)          f.seek(0)           pickle.dump(self.history, f)  def clear_history(self, sender, filename=filename_history): with open(filename, 'w') as f: self.history = []          f.seek(0)           pickle.dump(self.history, f)            sender.superview.superview['history'].data_source.items = self.history          sender.superview.superview['history'].reload()
 def save_bookmark(self, filename=filename_bookmarks): with open(filename, 'w') as f:           url = self.get_url()            title = self.get_title() or self.parse_url(url) self.bookmarks[title] = url         f.seek(0)           json.dump(self.bookmarks, f, indent=4) self['controlpanel']['favourite'].image = self.favourite_images[True]
 def remove_bookmark(self, title=None, filename=filename_bookmarks): with open(filename, 'w') as f:         title = title or self.get_title() del self.bookmarks[title]         f.seek(0)           json.dump(self.bookmarks, f, indent=4) self['controlpanel']['favourite'].image = self.favourite_images[False]
 def popup_menu(self):      popup = ui.View(name='menu', frame=(0, 0, 320, 500))        toolbar = ui.View(frame=(-5, 0, 330, 100), name='toolbar')      toolbar.border_width = 0.5      toolbar.border_color = '#B2B2B2'        label = ui.Label()      label.text = 'Bookmarks'        label.alignment = ui.ALIGN_CENTER       label.frame = (0, 0, 320, 50)       label.name = 'title'        segment_ctrl = ui.SegmentedControl(name='segctrl')      segment_ctrl.segments = ['Bookmarks', 'History']        segment_ctrl.width = 170        segment_ctrl.center = popup.center      segment_ctrl.y = label.height       segment_ctrl.selected_index = 0     segment_ctrl.action = self.bookmarks_or_history         button = ui.Button()        button.frame = (segment_ctrl.x*3.5, segment_ctrl.y, 60, 30)     button.font = ('<system>', 15)      button.title= 'Clear'       button.name = 'clear'       button.action = self.clear_history      button.hidden = True        toolbar.add_subview(label)      toolbar.add_subview(segment_ctrl)       toolbar.add_subview(button)         popup.add_subview(toolbar)      data_source = ui.ListDataSource(sorted(self.bookmarks.keys()))      popup.add_subview(self.list_bookmarks_and_history(data_source, width=320,height=toolbar.superview.height-toolbar.height, y=toolbar.height, name='bookmarks'))       x, y = self['controlpanel']['bookmarks'].center     popup.present('popover', popover_location=(x, y), hide_title_bar=True)
 def bookmarks_or_history(self, sender):        toolbar = sender.superview if sender.selected_index == 0:           toolbar['clear'].hidden = True          toolbar['title'].text = 'Bookmarks'         data_source = ui.ListDataSource(sorted(self.bookmarks.keys()))          tv = self.list_bookmarks_and_history(data_source, width=320, height=toolbar.superview.height-toolbar.height, y=toolbar.height, name='bookmarks')            toolbar.superview.remove_subview(toolbar.superview['history']) else:            toolbar['clear'].hidden = False             toolbar['title'].text = 'History'           data_source = ui.ListDataSource(self.history[::-1])         tv = self.list_bookmarks_and_history(data_source, width=320, height=toolbar.superview.height-toolbar.height, y=toolbar.height, name='history')          toolbar.superview['bookmarks'].hidden=True          toolbar.superview.remove_subview(toolbar.superview['bookmarks'])        sender.superview.superview.add_subview(tv)
 def list_bookmarks_and_history(self, data_source, **kwargs):       tv = ui.TableView()     tv.data_source = data_source        tv.delegate = self for k, v in kwargs.items(): setattr(tv, k, v) return tv
 def show_more_menu(self):      popup = ui.TableView()      popup.width = 250       popup.height = 500      popup.name = 'More'     popup.data_source = popup.delegate = self       button = self['controlpanel']['more']       popup.present('popover', popover_location=(button.x, button.y+button.height))
 def button_tapped(self, sender): if sender.name == 'favourite': if self.get_url() in self.bookmarks.values(): self.remove_bookmark() else: self.save_bookmark() elif sender.name == 'bookmarks': self.popup_menu() elif sender.name == 'more': self.show_more_menu() else: eval("self['webview'].{}()".format(sender.name))
 def tableview_number_of_rows(self, tableview, section): if tableview.name == 'Bookmarks': return len(self.bookmarks) elif tableview.name == 'More': return 1
 def tableview_cell_for_row(self, tableview, section, row): if tableview.name == 'Bookmarks':           cell = ui.TableViewCell()           cell.text_label.text = sorted(self.bookmarks.keys())[row]           cell.image_view.image = ui.Image.named('ionicons-ios7-bookmarks-outline-32')            cell.image_view.tint_color = '#66CCFF' return cell elif tableview.name == 'More':           cell = ui.TableViewCell()           cell.text_label.text = 'Settings'           cell.image_view.image = ui.Image.named('ionicons-wrench-32') return cell
 @ui.in_background def tableview_did_select(self, tableview, section, row): if tableview.name == 'bookmarks':           url = self.bookmarks[sorted(self.bookmarks.keys())[row]] self.load_url(url)         tableview.superview.close() elif tableview.name == 'history':           url = tableview.data_source.items[row]          tableview.superview.close() self.load_url(url) elif tableview.name == 'More':           tableview.close()           console.hud_alert('No settings yet...', 'error', 1)
 def tableview_can_delete(self, tableview, section, row): return True
 def tableview_delete(self, tableview, section, row):       item = sorted(self.bookmarks.keys())[row] self.remove_bookmark(item)        tableview.reload()
 def textfield_did_begin_editing(self, textfield): self.addressbar_is_editing = True self.set_url() self['controlpanel']['reload'].hidden = True
 def textfield_did_end_editing(self, textfield): self.addressbar_is_editing = False self['controlpanel']['reload'].hidden = False self.set_url()
 def textfield_should_return(self, textfield):      url = self['controlpanel']['addressbar'].text self.load_url(url)        textfield.end_editing() return True
 def webview_did_start_load(self, webview): self.webpage_has_loaded = False
 def webview_did_finish_load(self, webview): if not self.addressbar_is_editing: self.set_url() self.webpage_has_loaded = True       page_is_bookmarked = unicode(self.get_url()) in self.bookmarks.values() self['controlpanel']['favourite'].image = self.favourite_images[page_is_bookmarked] self.save_history()
UISearchBarWrapper.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.text_label.text = self.filteredData[row]
        return cell
UISearchControllerWrapper.py 文件源码 项目:PyDoc 作者: shaun-h 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def tableView_cellForRowAtIndexPath_(sel,cmd,tableView,indexPath):
    ip = ObjCInstance(indexPath)
    ds = ObjCInstance(sel)
    data = ds.data[ip.row()]
    tv = ObjCInstance(sel)
    cell = ui.TableViewCell('subtitle')
    cell.text_label.text = data['name']
    cell.detail_text_label.text = data['docsetname']
    cell.image_view.image = data['icon']
    cell.border_color = Theme_manager.currentTheme.borderColour
    cell.background_color = Theme_manager.currentTheme.backgroundColour
    cell.bg_color = Theme_manager.currentTheme.backgroundColour
    cell.tint_color = Theme_manager.currentTheme.tintColour
    cell.text_label.text_color = Theme_manager.currentTheme.textColour
    cell.detail_text_label.text_color = Theme_manager.currentTheme.subTextColour
    selectedBackgroundView = ui.View()
    selectedBackgroundView.background_color = Theme_manager.currentTheme.cellSelectionColour
    if not Theme_manager.currentTheme.showCellSelection:
        selectedBackgroundView.alpha = 0
    cell.selected_background_view = selectedBackgroundView
    iv = ui.ImageView()
    cell.content_view.add_subview(iv)
    iv.image = data['type'].icon
    iv.width = 15
    iv.height = 15
    iv.x = cell.content_view.width - (iv.width * 2)
    iv.y = (cell.content_view.height) / 2 - (iv.height)
    iv.flex = 'L'
    return ObjCInstance(cell).ptr
_delegates.py 文件源码 项目:mediawiki_ui 作者: allanburleson 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
TableView.py 文件源码 项目:ui2 作者: controversial 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
        self._cell = ui.TableViewCell()
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        import ui
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 15 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell



#--- ###################################################
# root tone
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        import ui
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        import ui
        cell = ui.TableViewCell()
        try:
            cell.text_label.text = self.items[row]['title']
        except IndexError:
            return
        cell.text_label.text_color = 'red' if self.items[row]['accessory_type'] == 'checkmark' else 'black'
        return cell
chordcalc.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        cell.accessory_type = self.items[row]['accessory_type']
        return cell
DropDown.py 文件源码 项目:ccMVC 作者: polymerchm 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        # Create and return a cell for the given section/row
        cell = ui.TableViewCell()
        cell.text_label.text = self.items[row]['title']
        return cell
Garfield.py 文件源码 项目:pythonista-toys 作者: Wildog 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.selectable = True
        cell.text_label.text = self.comments[section]['comment']
        return cell
ptinstaller.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell('subtitle')
        tool_name = self.tool_names[row]
        tool_url = self.tools_dict[tool_name]['url']
        cell.text_label.text = tool_name
        cell.detail_text_label.text = self.tools_dict[tool_name]['description']
        # TODO: Cell does not increase its height when label has multi lines of text
        # cell.detail_text_label.line_break_mode = ui.LB_WORD_WRAP
        # cell.detail_text_label.number_of_lines = 0

        InstallButton(self.app, cell, self.category_name, tool_name, tool_url)

        return cell
File Picker.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tv, section, row):
        cell = ui.TableViewCell()
        entry = self.flat_entries[row]
        level = entry.level - 1
        image_view = ui.ImageView(frame=(44 + 20*level, 5, 34, 34))
        label_x = 44+34+8+20*level
        label_w = cell.content_view.bounds.w - label_x - 8
        if entry.subtitle:
            label_frame = (label_x, 0, label_w, 26)
            sub_label = ui.Label(frame=(label_x, 26, label_w, 14))
            sub_label.font = ('<System>', 12)
            sub_label.text = entry.subtitle
            sub_label.text_color = '#999'
            cell.content_view.add_subview(sub_label)
        else:
            label_frame = (label_x, 0, label_w, 44)
        label = ui.Label(frame=label_frame)
        if entry.subtitle:
            label.font = ('<System>', 15)
        else:
            label.font = ('<System>', 18)
        label.text = entry.title
        label.flex = 'W'
        cell.content_view.add_subview(label)
        if entry.leaf and not entry.enabled:
            label.text_color = '#999'
        cell.content_view.add_subview(image_view)
        if not entry.leaf:
            has_children = entry.expanded
            btn = ui.Button(image=ui.Image.named('CollapseFolder' if has_children else 'ExpandFolder'))
            btn.frame = (20*level, 0, 44, 44)
            btn.action = self.expand_dir_action
            cell.content_view.add_subview(btn)
        if entry.icon_name:
            image_view.image = ui.Image.named(entry.icon_name)
        else:
            image_view.image = None
        cell.selectable = entry.enabled
        return cell
CloudJump2.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        cell = ui.TableViewCell()
        cell.text_label.text = str(self.items[row])
        cell.text_label.alignment = ui.ALIGN_CENTER
        return cell
Three-Column-Sortable-TableView.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):
        self.width, height = ui.get_screen_size()
        cell = ui.TableViewCell()
        cell.bounds = (0,0,self.width,self.row_height)
        for i in range(3):
            self.make_labels(cell, tableview.data_source.items[row][i], i)
        return cell
uidir.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def tableview_cell_for_row(self, tableview, section, row):

        cell = ui.TableViewCell()
        cell.accessory_type = ('disclosure_indicator', 'detail_button')[section]
        cell.text_label.text = self.data[section][row]
        if section==0:
            cell.background_color='#eeffee'

        return cell


问题


面经


文章

微信
公众号

扫码关注公众号