本文整理汇总了Python中ui.TableView方法的典型用法代码示例。如果您正苦于以下问题:Python ui.TableView方法的具体用法?Python ui.TableView怎么用?Python ui.TableView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui
的用法示例。
在下文中一共展示了ui.TableView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self):
ui.View.__init__(self)
self.background_color = "#ffffff"
self.table = ui.TableView()
self.table.delegate = self.table.data_source = self
self.table.flex = "WH"
self.add_subview(self.table)
self.ai = ui.ActivityIndicator()
self.ai.style = ui.ACTIVITY_INDICATOR_STYLE_WHITE_LARGE
self.ai.hides_when_stopped = True
self.ai.x = self.width / 2.0 - (self.ai.width / 2.0)
self.ai.y = self.height / 2.0 - (self.ai.height / 2.0)
self.ai.flex = "LRTB"
self.ai.background_color = "#000000"
self.ai.alpha = 0.7
self.ai.corner_radius = 5
self.add_subview(self.ai)
self.subview_open = False
self.cur_tf = None
self.hide_kb_button = ui.ButtonItem(
"Hide Keyboard",
action=self.hide_keyboard,
enabled=False,
)
self.right_button_items = (self.hide_kb_button, )
示例2: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self, app, category_name, category_url):
self.app = app
self.category_name = category_name
self.category_url = category_url
self.view = ui.TableView(frame=(0, 0, 640, 640))
self.view.name = category_name
self.tools_dict = self.app.repo.get_tools_from_md(category_url)
self.tool_names = sorted(self.tools_dict.keys())
self.view.data_source = self
self.view.delegate = self
示例3: history_present
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def history_present(self, history):
"""
Present a history popover.
:param history: history to present
:type history: ShHistory
"""
listsource = ui.ListDataSource(history.getlist())
listsource.action = self.history_popover_tapped
table = ui.TableView()
listsource.font = self.BUTTON_FONT
table.data_source = listsource
table.delegate = listsource
table.width = 300
table.height = 300
table.row_height = self.BUTTON_FONT[1] + 4
table.present('popover')
table.wait_modal()
示例4: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self):
self.dirs = []
self.files = []
self.select_color = 'lightgrey'
self.unselect_color = 'white'
self.active_button = None
self.button_height = 50
self.btn_name = self.make_buttons('Name')
self.btn_size = self.make_buttons('Size')
self.btn_date = self.make_buttons('Date')
self.tv = ui.TableView()
self.tv.row_height = 30
self.tv.data_source = MyTableViewDataSource(self.tv.row_height)
self.get_dir()
self.all_items = self.dirs + self.files
self.tv.data_source.items = self.all_items
self.name = 'TableView-Test'
#self.tv.delegate = MyTableViewDelegate()
self.tv.allows_selection = False
self.add_subview(self.tv)
self.present('full_screen')
示例5: open_finder
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def open_finder(self,sender):
# expand out a view/dialog from sender
root=self.find_root()
overlay=ui.Button(frame=(0,0)+tuple(root.frame)[2:],bg_color=(0,0,0,0.25),name='overlay')
dialog=ui.View(frame=sender.frame,bg_color='white',name='dialog')
self.tbl=ui.TableView()
self.tbl.width=dialog.width
self.tbl.height=dialog.height
self.listsource=ui.ListDataSource(items=[])
self.tbl.data_source=self.listsource
self.tbl.delegate=self.listsource
self.listsource.action=self.stop_populating
self.tbl.flex='wh'
dialog.add_subview(self.tbl)
overlay.add_subview(dialog)
overlay.action=self.stop_populating
root.add_subview(overlay)
self.dialog=dialog
def ani():
dialog.x,dialog.y=ui.convert_point((self.textfield.x,self.textfield.y+self.textfield.height),self,root)
dialog.width=self.textfield.width
dialog.height=min(400,root.height-ui.convert_point((0,dialog.y),self,root)[1])
ui.delay(self.start_populating,0.16)
ui.animate(ani,0.15)
示例6: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self):
self.tv = ui.TableView()
self.tv.flex = 'WH'
self.tv.data_source = self
self.tv.delegate = self
self.add_subview(self.tv)
self.name = 'Nearby'
self.right_button_items = [ui.ButtonItem(image=ui.Image.named('refresh'), title="refresh", action=lambda x: self.load_stations())]
self.load_stations()
示例7: history_popover_tapped
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def history_popover_tapped(self, sender):
"""
Called when a row in the history popover was tapped.
:param sender: sender of the event
:type sender: ui.TableView
"""
if sender.selected_row >= 0:
self.history_selected(sender.items[sender.selected_row], sender.selected_row)
示例8: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self, root_node, allow_multi=False, async_mode=False):
self.async_mode = async_mode
self.allow_multi = allow_multi
self.selected_entries = None
self.table_view = ui.TableView()
self.table_view.frame = (0, 0, 500, 500)
self.table_view.data_source = self
self.table_view.delegate = self
self.table_view.flex = 'WH'
self.table_view.allows_multiple_selection = True
self.table_view.tint_color = 'gray'
self.view = ui.View(frame=self.table_view.frame)
self.view.add_subview(self.table_view)
self.view.name = root_node.title
self.busy_view = ui.View(frame=self.view.bounds, flex='WH', background_color=(0, 0, 0, 0.35))
hud = ui.View(frame=(self.view.center.x - 50, self.view.center.y - 50, 100, 100))
hud.background_color = (0, 0, 0, 0.7)
hud.corner_radius = 8.0
hud.flex = 'TLRB'
spinner = ui.ActivityIndicator()
spinner.style = ui.ACTIVITY_INDICATOR_STYLE_WHITE_LARGE
spinner.center = (50, 50)
spinner.start_animating()
hud.add_subview(spinner)
self.busy_view.add_subview(hud)
self.busy_view.alpha = 0.0
self.view.add_subview(self.busy_view)
self.done_btn = ui.ButtonItem(title='Done', action=self.done_action)
if self.allow_multi:
self.view.right_button_items = [self.done_btn]
self.done_btn.enabled = False
self.root_node = root_node
self.entries = []
self.flat_entries = []
if self.async_mode:
self.set_busy(True)
t = threading.Thread(target=self.expand_root)
t.start()
else:
self.expand_root()
示例9: get_view
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def get_view(elements, cb, thememanager):
dbo = ElementListView(elements = elements, selectedCallBack = cb, thememanager = thememanager)
table_view = ui.TableView()
table_view.name = 'Elements'
table_view.data_source = dbo
table_view.delegate = dbo
table_view.background_color = thememanager.main_background_colour
return table_view
示例10: create_table_view
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def create_table_view(self):
table_view = ui.TableView()
table_view.name = 'tableview'
table_view.flex = 'WH'
table_view.width = self.width
table_view.height = self.height
table_view.delegate = self
table_view.data_source = self
self.add_subview(table_view)
示例11: get_view
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def get_view(elements, thememanager):
dbo = ElementManagementView(elements = elements, thememanager = thememanager)
table_view = ui.TableView()
table_view.name = 'Elements'
table_view.data_source = dbo
table_view.delegate = dbo
table_view.background_color = thememanager.main_background_colour
return table_view
示例12: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self):
self.schema_v = ui.TableView('grouped')
self.data_v = ui.TableView()
self.nbutton = ui.Button(title='Next')
self.pbutton = ui.Button(title='Prev')
示例13: get_view
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def get_view(dir, cb, filetypes):
test = FilebrowserController(dir=dir, cb=cb, filetypes=filetypes)
table_view = ui.TableView()
table_view.name = 'Files'
table_view.data_source = test
table_view.delegate = test
return table_view
示例14: get_view
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def get_view(dbpath, navview):
dbo = dbobjectsview(dbpath, navview)
table_view = ui.TableView()
table_view.name = dbpath
table_view.data_source = dbo
table_view.delegate = dbo
return table_view
示例15: __init__
# 需要导入模块: import ui [as 别名]
# 或者: from ui import TableView [as 别名]
def __init__(self,setter, base_dir = '.', *args, **kargs):
self.table = ui.TableView(*args, **kargs)
self.name=os.path.split(os.path.abspath(base_dir))[1]
self.src = MyTableViewDataSource(setter, base_dir)
self.table.data_source = self.src
self.table.delegate = self.src
self.table.flex = 'WHTBLR'
self.setter=setter
#self.view = ui.View(name = base_dir)
self.background_color = 'white'
self.add_subview(self.table)