当前位置: 首页>>代码示例>>Python>>正文


Python ui.TableView方法代码示例

本文整理汇总了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, ) 
开发者ID:ywangd,项目名称:stash,代码行数:27,代码来源:easy_config.py

示例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 
开发者ID:ywangd,项目名称:pythonista-tools-installer,代码行数:14,代码来源:ptinstaller.py

示例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() 
开发者ID:ywangd,项目名称:stash,代码行数:19,代码来源:pythonista_ui.py

示例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') 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:23,代码来源:Three-Column-Sortable-TableView.py

示例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) 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:26,代码来源:dropdown.py

示例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() 
开发者ID:lukaskollmer,项目名称:pythonista-scripts,代码行数:11,代码来源:abfahrt.py

示例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) 
开发者ID:ywangd,项目名称:stash,代码行数:10,代码来源:pythonista_ui.py

示例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() 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:42,代码来源:File Picker.py

示例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 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:10,代码来源:ElementListView.py

示例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) 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:11,代码来源:AssetPickerView.py

示例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 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:10,代码来源:ElementManagementView.py

示例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') 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:7,代码来源:tableobjectview.py

示例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 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:9,代码来源:filebrowser.py

示例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 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:9,代码来源:dbobjectsview.py

示例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) 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:13,代码来源:uidir.py


注:本文中的ui.TableView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。