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


Python modalview.ModalView方法代码示例

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


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

示例1: open

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def open(self, *largs):
		'''Show the view window from the :attr:`attach_to` widget. If set, it
		will attach to the nearest window. If the widget is not attached to any
		window, the view will attach to the global
		:class:`~kivy.core.window.Window`.
		'''
		if self._window is not None:
			Logger.warning('ModalView: you can only open once.')
			return self
		# search window
		self._window = self._search_window()
		if not self._window:
			Logger.warning('ModalView: cannot open view, no window found.')
			return self
		self._window.add_widget(self)
		self._window.bind(on_resize=self._align_center,
		                  on_keyboard=self._handle_keyboard)
		self.center = self._window.center
		self.bind(size=self._update_center)
		a = Animation(_anim_alpha=1., d=self._anim_duration)
		a.bind(on_complete=lambda *x: self.dispatch('on_open'))
		a.start(self)
		return self 
开发者ID:kivymd,项目名称:KivyMD,代码行数:25,代码来源:dialog.py

示例2: highlight_at

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def highlight_at(self, x, y):
        widget = None
        # reverse the loop - look at children on top first and
        # modalviews before others
        win_children = self.win.children
        children = chain(
            (c for c in reversed(win_children) if isinstance(c, ModalView)),
            (c for c in reversed(win_children) if not isinstance(c, ModalView))
        )
        for child in children:
            if child is self:
                continue
            widget = self.pick(child, x, y)
            if widget:
                break
        self.highlight_widget(widget) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:18,代码来源:inspector.py

示例3: write_rcp_config

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def write_rcp_config(self, info_msg, callback):
        def timeout(dt):
            progress_view.dismiss()
            Clock.schedule_once(lambda dt: callback(), 0.25)

        def write_win(details):
            msg.text += ' Success'
            self.rc_config.stale = False
            Clock.schedule_once(timeout, 1.5)

        def write_fail(details):
            progress_view.dismiss()
            okPopup('Oops!',
                         'We had a problem updating the device. Check the device connection and try again.\n\nError:\n\n{}'.format(details),
                         lambda *args: None)


        progress_view = ModalView(size_hint=(None, None), size=(dp(600), dp(200)))
        msg = FieldLabel(text=info_msg, halign='center')
        progress_view.add_widget(msg)
        progress_view.open()

        self.rc_api.writeRcpCfg(self.rc_config, write_win, write_fail) 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:25,代码来源:infoview.py

示例4: on_preferences

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def on_preferences(self, *args):
        """
        Display the dashboard preferences view 
        """
        settings_view = DashboardPreferences(self._settings, self._dashboard_factory)

        def popup_dismissed(*args):
            self._notify_preference_listeners()
            screens = settings_view.get_selected_screens()
            screens = self._filter_dashboard_screens(screens)
            self._settings.userPrefs.set_dashboard_screens(screens)
            self._update_screens(screens)

        popup = ModalView(size_hint=DashboardView._POPUP_SIZE_HINT)
        popup.add_widget(settings_view)
        popup.bind(on_dismiss=popup_dismissed)
        popup.open() 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:19,代码来源:dashboardview.py

示例5: on_heatmap_options

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def on_heatmap_options(self):
        def popup_dismissed(response):
            self._update_heatmap_preferences()

        settings_view = SettingsWithNoMenu()
        base_dir = self._settings.base_dir
        settings_view.add_json_panel('Heatmap Settings',
                                     self._settings.userPrefs.config,
                                     os.path.join(base_dir,
                                                  'autosportlabs',
                                                  'racecapture',
                                                  'views',
                                                  'dashboard',
                                                  'heatmap_settings.json'))

        popup = ModalView(size_hint=HeatmapView._POPUP_SIZE_HINT)
        popup.add_widget(settings_view)
        popup.bind(on_dismiss=popup_dismissed)
        popup.open() 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:21,代码来源:heatmapview.py

示例6: open

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def open(self, *largs):
        '''Show the view window from the :attr:`attach_to` widget. If set, it
        will attach to the nearest window. If the widget is not attached to any
        window, the view will attach to the global
        :class:`~kivy.core.window.Window`.
        '''
        if self._window is not None:
            Logger.warning('ModalView: you can only open once.')
            return self
        # search window
        self._window = self._search_window()
        if not self._window:
            Logger.warning('ModalView: cannot open view, no window found.')
            return self
        self._window.add_widget(self)
        self._window.bind(on_resize=self._align_center,
                          on_keyboard=self._handle_keyboard)
        self.center = self._window.center
        self.bind(size=self._align_center)
        a = Animation(_anim_alpha=1., d=self._anim_duration)
        a.bind(on_complete=lambda *x: self.dispatch('on_open'))
        a.start(self)
        return self 
开发者ID:kiok46,项目名称:Blogs-Posts-Tutorials,代码行数:25,代码来源:dialog.py

示例7: dismiss

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def dismiss(self, *largs, **kwargs):
		'''Close the view if it is open. If you really want to close the
		view, whatever the on_dismiss event returns, you can use the *force*
		argument:
		::

			view = ModalView(...)
			view.dismiss(force=True)

		When the view is dismissed, it will be faded out before being
		removed from the parent. If you don't want animation, use::

			view.dismiss(animation=False)

		'''
		if self._window is None:
			return self
		if self.dispatch('on_dismiss') is True:
			if kwargs.get('force', False) is not True:
				return self
		if kwargs.get('animation', True):
			Animation(_anim_alpha=0., d=self._anim_duration).start(self)
		else:
			self._anim_alpha = 0
			self._real_remove_widget()
		return self 
开发者ID:kivymd,项目名称:KivyMD,代码行数:28,代码来源:dialog.py

示例8: open

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def open(self, *largs):
        self._window = self._search_window()
        if not self._window:
            Logger.warning('ModalView: cannot open view, no window found.')
            return
        if self.parent:
            self.parent.remove_widget(self)
        self._window.add_widget(self) 
开发者ID:mahart-studio,项目名称:kivystudio,代码行数:10,代码来源:modal_cursor.py

示例9: submit_text

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def submit_text(self, text):
        self.submit_func(text)
        # Window.softinput_mode = 'pan'
        self.dismiss()

    # This is the normal ModalView on_touch_down, with
    # self.submit_func added to ensure that some text is submitted. 
开发者ID:inclement,项目名称:Pyonic-interpreter,代码行数:9,代码来源:interpreter.py

示例10: on_touch_down

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def on_touch_down(self, touch):
        if not self.collide_point(*touch.pos):
            if self.auto_dismiss:
                self.submit_func(self.ids.ti.text)
                self.dismiss()
                return True
        super(ModalView, self).on_touch_down(touch)
        return True

    # Again, modify the normal _handle_keyboard so that
    # self.submit_func is called before self.dismiss 
开发者ID:inclement,项目名称:Pyonic-interpreter,代码行数:13,代码来源:interpreter.py

示例11: open

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def open(self, *largs):
        self._window = self._search_window()
        if not self._window:
            Logger.warning('ModalView: cannot open view, no window found.')
            return
        try:
            self._window.remove_widget(self)
            self._window.add_widget(self)
        except:
            pass 
开发者ID:snuq,项目名称:Snu-Photo-Manager,代码行数:12,代码来源:modal_cursor.py

示例12: set_language

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def set_language(self, language):
        language_map = {
            "English": "en_US",
            "简体中文": "zh_CN"
        }
        self.parent.configer.lang = language_map.get(language, "en_US")
        self.parent.configer.save_config()
        # show popup hint
        view = ModalView(size_hint=(None, None), size=(0, 0))
        view.add_widget(Label(text=_("This will take effect next time you start"), font_size=30))
        view.open() 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:13,代码来源:GUI.py

示例13: __init__

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def __init__(self, **kwargs):

        super(ModalView, self).__init__(**kwargs) 
开发者ID:ODiogoSilva,项目名称:TriFusion,代码行数:5,代码来源:custom_widgets.py

示例14: info_popup

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def info_popup(self, msg, callback):
        def done():
            view.dismiss()
            Clock.schedule_once(lambda dt: callback(), 0.25)

        view = ModalView(size_hint=(None, None), size=(dp(600), dp(200)))
        msg = FieldLabel(halign='center', text=msg)
        view.add_widget(msg)
        view.open()
        Clock.schedule_once(lambda dt: done(), 2.0) 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:12,代码来源:infoview.py

示例15: _start_stopwatch

# 需要导入模块: from kivy.uix import modalview [as 别名]
# 或者: from kivy.uix.modalview import ModalView [as 别名]
def _start_stopwatch(self):
        '''
        Starts the stopwatch timer
        '''

        if not self._popup:
            self._popup = ModalView(size_hint=self._POPUP_SIZE_HINT, auto_dismiss=False)
            self._popup.add_widget(self)
        self._set_exit_speed_frame_visible(False)
        self._popup.open()
        self._current_time = 0.0
        self._start_time = time()
        self._flash_count = 0
        self._currently_racing = False
        Clock.schedule_interval(self._tick_stopwatch, self._STOPWATCH_TICK) 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:17,代码来源:stopwatch.py


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