本文整理汇总了Python中kivy.uix.popup.Popup方法的典型用法代码示例。如果您正苦于以下问题:Python popup.Popup方法的具体用法?Python popup.Popup怎么用?Python popup.Popup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.popup
的用法示例。
在下文中一共展示了popup.Popup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def open(self, path=None, title="File to Run", filters=['*.g', '*.gcode', '*.nc', '*.gc', '*.ngc'], file_list=None, cb=None):
self.cb = cb
if file_list is not None:
# print("{}: {}".format(title, file_list))
fs = Factory.filesystemsd()
fs.open(file_list)
path = '/sd/'
show_dirs = False
else:
fs = Factory.filesystem()
show_dirs = True
content = LoadDialog(load=self._load, cancel=self.dismiss_popup, path=path if path else os.path.expanduser("~"), filesystem=fs, show_dirs=show_dirs, filters=filters)
self._popup = Popup(title=title, content=content, size_hint=(0.9, 0.9), auto_dismiss=False)
self._popup.open()
示例2: game
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def game(self,instance):
letters=self.letttersinput.text
letters = ",".join(list(letters))
#post data
mydata=[('letters', letters),('order','length'),('pos','beg'),('dic','1'),('table','dict')]
#Encoding
mydata=urllib.urlencode(mydata)
codedPath ='''aHR0cDovL3d3dy50aGV3b3JkZmluZGVyLmNvbS9zY3JhYmJsZS5waHA='''
path=base64.b64decode(codedPath)
req=urllib2.Request(path, mydata)
req.add_header("Content-type", "application/x-www-form-urlencoded")
page=urllib2.urlopen(req).read()
# applying beautifulsoup for parsing
soup = BS(page,"html.parser")
# parsing the div with id
res = soup.find("div", { "id" : "displayresults" })
Con= res.contents[1].contents[1]
line=""
for child in Con.children:
line+= child.string
popup = Popup(title="Result",content=Label(text=line))
popup.open()
示例3: __init__
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def __init__(self, *args, **kwargs):
super(AddBlockButton, self).__init__(*args, **kwargs)
self.bind(on_release=self.openPopup)
box=BoxLayout(padding=10)
self.Input=TextInput(text="New Block", multiline=False, font_size=18)
self.Input.bind(on_text_validate=self.addBlock)
b=Button(text="Add it")
b.bind(on_release=self.addBlock)
box.add_widget(self.Input)
box.add_widget(b)
self.addPopup = Popup(title="Add A New Block",
size_hint=(None,None),
size=(400,115),
separator_color=[.9,.4,.2,1],
background_color=[0,0,0,.6],
content=box
)
示例4: _on_update_check
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def _on_update_check(self):
def on_update_check_success():
def _success():
# do this in the UI thread
popup.content.on_message('Processing...')
Clock.schedule_once(lambda dt: self.refresh_view())
popup.dismiss()
Clock.schedule_once(lambda dt: _success())
def on_update_check_error(details):
def _error(details):
# do this in the UI thread
popup.dismiss()
Clock.schedule_once(lambda dt: self.refresh_view())
Logger.error('PresetBrowserView: Error updating: {}'.format(details))
alertPopup('Error Updating', 'There was an error updating the presets.\n\nPlease check your network connection and try again')
Clock.schedule_once(lambda dt: _error(details))
self.set_view_disabled(True)
update_view = PresetUpdateStatusView()
popup = Popup(title='Checking for updates', content=update_view, auto_dismiss=False, size_hint=(None, None), size=(dp(400), dp(200)))
popup.open()
self.preset_manager.refresh(update_view.on_progress, on_update_check_success, on_update_check_error)
示例5: showChannelConfigDialog
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def showChannelConfigDialog(self):
def popup_dismissed(instance):
self.settings.userPrefs.set_alertrules(self.channel, alertrules)
self.dashboard_state.clear_channel_states(self.channel)
alertrules = self.settings.userPrefs.get_alertrules(self.channel)
content = AlertRulesView(alertrules, channel=self.channel)
content.min_value = self.min
content.max_value = self.max
content.precision = self.precision
popup = Popup(title='Customize {}'.format(self.channel),
content=content,
size=(min(Window.width, dp(700)), min(Window.height, dp(400))),
size_hint=(None, None))
popup.bind(on_dismiss=popup_dismissed)
content.bind(title=lambda i, t: setattr(popup, 'title', t))
popup.open()
示例6: show_customize_dialog
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def show_customize_dialog(self):
"""
Display the customization dialog for this widget
"""
current_track_id = None if self.track == None else self.track.track_id
params = CustomizeParams(settings=self.settings, datastore=self.datastore, track_manager=self.track_manager)
values = CustomizeValues(heatmap_channel=self.heatmap_channel, track_id=current_track_id)
content = OptionsView(values)
content.add_options_screen(CustomizeHeatmapView(name='heat', params=params, values=values), HeatmapButton())
content.add_options_screen(CustomizeTrackView(name='track', params=params, values=values), TrackmapButton())
popup = Popup(title="Customize Track Map", content=content, size_hint=(0.7, 0.7))
content.bind(on_customized=self._customized)
content.bind(on_close=lambda *args:popup.dismiss())
popup.open()
示例7: editor_popup
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def editor_popup(title, content, answerCallback, size_hint=(None, None), size=(dp(500), dp(220)), hide_ok=False, auto_dismiss_time=None):
def auto_dismiss(*args):
popup.dismiss()
def on_title(instance, title):
popup.title = title
content.bind(on_title=on_title)
content = EditorPopup(content=content, hide_ok=hide_ok)
content.bind(on_answer=answerCallback)
popup = Popup(title=title,
content=content,
size=size, size_hint=size_hint,
auto_dismiss=True,
title_size=sp(18))
popup.open()
if auto_dismiss_time:
Clock.create_trigger(auto_dismiss, auto_dismiss_time)()
return popup
示例8: show_save
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def show_save(self):
'''Displays a popup widget to perform a save operation.'''
content = SaveDialog(save=self.save, cancel=self.dismiss_popup)
self._popup = Popup(title="Save file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
示例9: zAxisPopup
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def zAxisPopup(self):
self.popupContent = ZAxisPopupContent(done=self.dismissZAxisPopup)
self.popupContent.data = self.data
self.popupContent.initialize()
self._popup = Popup(title="Z-Axis", content=self.popupContent,
size_hint=(0.5, 0.5))
self._popup.open()
示例10: textInputPopup
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def textInputPopup(self, target):
self.targetWidget = target
self.popupContent = TouchNumberInput(done=self.dismiss_popup, data=self.data)
self._popup = Popup(title="Change increment size of machine movement", content=self.popupContent,
size_hint=(0.9, 0.9))
self._popup.open()
if global_variables._keyboard:
global_variables._keyboard.bind(on_key_down=self.keydown_popup)
self._popup.bind(on_dismiss=self.ondismiss_popup)
示例11: gotoLinePopup
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def gotoLinePopup(self):
self.popupContent = TouchNumberInput(done=self.dismiss_gotoLinePopup, data=self.data)
self._popup = Popup(title="Go to gcode line", content=self.popupContent,
size_hint=(0.9, 0.9))
self._popup.open()
if global_variables._keyboard:
global_variables._keyboard.bind(on_key_down=self.keydown_popup)
self._popup.bind(on_dismiss=self.ondismiss_popup)
示例12: about
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def about(self):
popupText = 'Ground Control v' + str(self.data.version) + ' allows you to control the Maslow machine. ' + \
'From within Ground Control, you can move the machine to where you want to begin a cut, calibrate the machine, ' + \
'open and run a g-code file, or monitor the progress of an ongoing cut. For more details see the Maslow website ' + \
'at http://www.maslowcnc.com/. The source code can be downloaded at https://github.com/MaslowCNC. ' + \
'\n\n' + \
'GroundControl is part of the of the Maslow Control Software Copyright (C) 2014-2017 Bar Smith. ' + \
'This program is free software: you can redistribute it and/or modify ' + \
'it under the terms of the GNU General Public License as published by ' + \
'the Free Software Foundation, either version 3 of the License, or ' + \
'(at your option) any later version. ' + \
'\n\n' + \
'This program is distributed in the hope that it will be useful, ' + \
'but WITHOUT ANY WARRANTY; without even the implied warranty of ' + \
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' + \
'GNU General Public License for more details. ' + \
'\n\n' + \
'You should have received a copy of the GNU General Public License ' + \
'along with the Maslow Control Software. If not, see <http://www.gnu.org/licenses/>.'
content = ScrollableTextPopup(cancel = self.dismiss_popup, text = popupText, markup = True)
if sys.platform.startswith('darwin'):
self._popup = Popup(title="About GroundControl", content=content, size=(520,400), size_hint=(.6, .6))
else:
self._popup = Popup(title="About GroundControl", content=content, size=(520,400), size_hint=(None, None))
self._popup.open()
示例13: calibrateChainLengths
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def calibrateChainLengths(self):
'''
This function is called when the "Calibrate Chain Lengths Automatic" button is pressed under the Actions window
'''
self.popupContent = CalibrationFrameWidget(done=self.dismissCalibrationPopup)
self.popupContent.setupJustChainsCalibration()
self.popupContent.on_Enter()
self._popup = Popup(title="Calibrate Chain Lengths", content=self.popupContent,
size_hint=(0.85, 0.95), auto_dismiss = False)
self._popup.open()
示例14: manualCalibration
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def manualCalibration(self):
'''
This function is called when the "Run Triangular Test Cuts" button under advanced options is pressed
'''
self.popupContent = CalibrationFrameWidget(done=self.dismissCalibrationPopup)
self.popupContent.setupManualCalibration()
self.popupContent.on_Enter()
self._popup = Popup(title="Calibrate Chain Lengths", content=self.popupContent,
size_hint=(0.85, 0.95), auto_dismiss = False)
self._popup.open()
示例15: calibrateMachine
# 需要导入模块: from kivy.uix import popup [as 别名]
# 或者: from kivy.uix.popup import Popup [as 别名]
def calibrateMachine(self):
'''
Spawns a walk through that helps the user measure the machine's dimensions
'''
self.popupContent = CalibrationFrameWidget(done=self.dismissCalibrationPopup)
self.popupContent.setupFullCalibration()
self.popupContent.on_Enter()
self._popup = Popup(title="Calibration", content=self.popupContent,
size_hint=(0.95, 0.95), auto_dismiss = False)
self._popup.open()