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


Python ui.ButtonItem方法代码示例

本文整理汇总了Python中ui.ButtonItem方法的典型用法代码示例。如果您正苦于以下问题:Python ui.ButtonItem方法的具体用法?Python ui.ButtonItem怎么用?Python ui.ButtonItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ui的用法示例。


在下文中一共展示了ui.ButtonItem方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [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 ButtonItem [as 别名]
def __init__(self, elements, saveCallBack, addElementAction, saveFlowAction, runFlowAction, showElementRuntimeView, thememanager, flowType, flowTypeSelection):
		self.flowType = flowType
		self.elements = elements
		self.saveCallBack = saveCallBack
		self.flowTypeSelection = flowTypeSelection
		self.showElementRuntimeView = showElementRuntimeView
		self.extraRows = 2
		self.adminRow = 0
		self.typeRow = 1
		self.title = ''
		self.currentElementNumber = -1
		self.addElementButton = ui.ButtonItem(title = 'Add Element', action = addElementAction)
		self.saveFlowButton = ui.ButtonItem(title='Save', action=saveFlowAction)
		self.runFlowButton = ui.ButtonItem(title='Run', action=runFlowAction)
		self.titleButton = ui.Button(title='Change Title')
		self.editButtonsRight = [self.addElementButton]
		self.editButtonsLeft = [self.saveFlowButton]
		self.runButtonsRight = [self.runFlowButton]
		self.runButtonsLeft = []
		self.thememanager = thememanager 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:22,代码来源:FlowCreationView.py

示例3: __init__

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [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

示例4: __init__

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def __init__(self, change_set, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.name = 'Preview'
        self.apply_changes = False

        def apply(sender):
            self.apply_changes = True
            self.close()

        button = ui.ButtonItem('Apply', action=apply)
        self.right_button_items = [button]

        textview = ui.TextView(frame=self.bounds, flex='WH')
        textview.editable = False

        diff = _change_set_diff(change_set)
        attributed_string = _diff_to_attributed_string(diff)
        _set_attributed_text(textview, attributed_string)

        self.add_subview(textview)

        def cancel():
            self.close()

        self.handlers = [
            register_key_event_handler(UIEventKeyCode.ESCAPE, cancel),
            register_key_event_handler(UIEventKeyCode.DOT, cancel, modifier=UIKeyModifier.COMMAND),
            register_key_event_handler(UIEventKeyCode.ENTER, lambda: apply(None))
        ] 
开发者ID:zrzka,项目名称:blackmamba,代码行数:31,代码来源:refactoring.py

示例5: __init__

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [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

示例6: setup_navigationview

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def setup_navigationview(self, initview):           
		initview.right_button_items = [ui.ButtonItem(title='Add Flow', action=self.show_flowcreationview)]
		initview.left_button_items = [ui.ButtonItem(title='Elements', action=self.show_elementmanagementview)]
		self.navigation_view = ui.NavigationView(initview)
		self.navigation_view.bar_tint_color=self.theme_manager.main_bar_colour
		self.navigation_view.tint_color = self.theme_manager.main_tint_colour
		self.navigation_view.background_color = self.theme_manager.main_background_colour
		self.navigation_view.title_color = self.theme_manager.main_title_text_colour 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:10,代码来源:istaflow.py

示例7: show_elementmanagementview

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def show_elementmanagementview(self, sender):
		self.validate_navigationview()
		if self.element_management_view == None:
			raise ValueError("element_management_view hasnt been initialised")
		else:	
			self.element_management_view.right_button_items = [ui.ButtonItem(title='Create Element', action=self.show_elementcreationview)]
			self.navigation_view.push_view(self.element_management_view) 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:9,代码来源:istaflow.py

示例8: load_button_items

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def load_button_items(self):
		if self.is_main():
			self.left_button_items = [ui.ButtonItem('Cancel', action=lambda s: self.navigation_view.close())]
		else:
			self.right_button_items = [ui.ButtonItem('Done', action=lambda s: self.navigation_view.close())] 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:7,代码来源:AssetPickerView.py

示例9: get_view

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def get_view(savecb, apcb, capcb, thememanager):
	dbo = ElementCreationView(saveCallBack = savecb, showAssetPickerCallBack = apcb, closeAssetPickerCallBack = capcb, thememanager = thememanager)
	table_view.name = 'Element'
	table_view.data_source = dbo
	table_view.delegate = dbo
	table_view.right_button_items = [ui.ButtonItem(title='Save Element', action=dbo.create_element)]
	table_view.background_color = thememanager.main_background_colour
	return table_view 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:10,代码来源:ElementCreationView.py

示例10: make_button_item

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def make_button_item(action, image_name):
    return ui.ButtonItem(action=action, image=ui.Image.named(image_name)) 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:4,代码来源:Webbrowser.py

示例11: getFile

# 需要导入模块: import ui [as 别名]
# 或者: from ui import ButtonItem [as 别名]
def getFile(setter=None,base_dir='.'):
    fv = FileViewer(setter,base_dir)
    fv.height=700
    nv = ui.NavigationView(fv)
    
    def openDocuments(sender,path):
       def setme(fv,value):
       # set and bubble up setters
           fv.src.sel[0]=value
           if fv.src.setter is not None:
              fv.src.setter(value)
       newfv = FileViewer(setter=lambda value:setme(fv,value),base_dir=path)
       nv.push_view(newfv)
       
       
    nv.right_button_items=[
        ui.ButtonItem(title='Documents',
         action=lambda sender:openDocuments(sender,os.path.expanduser('~/Documents'))), 
        ui.ButtonItem(title='Library',
         action=lambda sender:openDocuments(sender,os.path.split(os.__file__)[0]))]
    nv.height=800
    nv.width=500
    nv.name = 'File Selector'
    nv.present('popover')
    ui.in_background(nv.wait_modal)
    nv.wait_modal()
    return fv.src.sel[0] 
开发者ID:khilnani,项目名称:pythonista-scripts,代码行数:29,代码来源:uidir.py


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