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


Python Slider.value方法代码示例

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


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

示例1: build

# 需要导入模块: from kivy.uix.slider import Slider [as 别名]
# 或者: from kivy.uix.slider.Slider import value [as 别名]
    def build(self):
        self.root = BoxLayout(pos_hint={'center_x':.5, 'center_y':.5}, orientation='vertical')

        self.svg = SvgWidget(size_hint_y=0.9)
        self.root.add_widget(self.svg)
        s = Slider(min=0, max=100, value=0, size_hint_y=0.1)
        self.root.add_widget(s)
        s.bind(value=self.on_value)
        s.value=50
开发者ID:ryandoherty,项目名称:kivysvgtest,代码行数:11,代码来源:main.py

示例2: build

# 需要导入模块: from kivy.uix.slider import Slider [as 别名]
# 或者: from kivy.uix.slider.Slider import value [as 别名]
    def build(self):
        root = Widget()
        print(root.height,root.width)
        puzzle = Camera(size=(480, 320), resolution=(480, 320), play=True, allow_stretch=True)
        print("The camera is a {}".format(puzzle))
        slider = Slider(min=100, max=400, step=10, size=(800, 50))
        slider.value=100
        slider.bind(value=partial(self.on_value, puzzle))

        root.add_widget(puzzle)
        root.add_widget(slider)
        return root
开发者ID:TristanTrim,项目名称:magnifyingPhoneApp,代码行数:14,代码来源:main.py

示例3: getUI

# 需要导入模块: from kivy.uix.slider import Slider [as 别名]
# 或者: from kivy.uix.slider.Slider import value [as 别名]
    def getUI(self):
        """get the ui element"""
        result = Slider()  #SliderExt()
        if self.value:
            result.value = self.value
        skin = sm.getSkin('slider', self.asset)
        result.size = sm.getControlSize(skin, self.asset)
        result.orientation = sm.getVar(skin, self.asset, "orientation")
        result.min = sm.getMinimum('slider', self.value, self._typeInfo)
        result.max = sm.getMaximum('slider', self.value, self._typeInfo)
        result.step = sm.getStep('slider', self._typeInfo)
        result.show_label = sm.getVar(skin,  self.asset, "show_label")
        result.show_marker = sm.getVar(skin, self.asset, "show_marker")

        self.uiEl = result
        self.prepareUiElement()
        if sm.getVar(skin, self.asset, "send_on_release", False):
            result.on_dragEnded = self.value_changed                    # set the callback for when drag ends (self made, so no binding)
        else:
            result.bind(value=self.value_changed)
        return result
开发者ID:ATT-JBO,项目名称:att-dash,代码行数:23,代码来源:layout.py

示例4: build

# 需要导入模块: from kivy.uix.slider import Slider [as 别名]
# 或者: from kivy.uix.slider.Slider import value [as 别名]
    def build(self):
        
        self.sm = ScreenManager(transition=SlideTransition())
        layout = BoxLayout(padding=20, orientation=self.orient, spacing=20)

        self.graphScreen = GraphScreen()

        self.console = Console(app=app)
        
        self.sm.switch_to(self.console)
        
        self.graph = self.graphScreen.getGraph();
        
        layout.add_widget(self.sm)

        menuWrapper = BoxLayout()
        
        for i in range(0,3):            
            #pragma mark boczne menu z lewej
            if(i==0):
                menuInside = BoxLayout(orientation="vertical")
                self.meuCenterWrapper = menuInside;
                self.buildLeftMenu(menuInside)
                menuWrapper.add_widget(menuInside)
                
            #srodkowa czesc
            if(i==1):
                scrollView = ScrollView(bar_margin=10, bar_color=[1,1,1,1])
                #pragma mark padding narzucony w srodkowym menu
                menuInside = GridLayout(cols=4, row_default_height=40,size_hint_y=None,padding=[50,0,0,0])
                menuInside.bind(minimum_height=menuInside.setter('height'))
                self.menuCenterWrapper = menuInside;
                self.buildCenterMenu(menuInside)
                scrollView.add_widget(menuInside)
                menuWrapper.add_widget(scrollView)
                    
            #menu po prawej
            if(i==2):
                menuInside = BoxLayout(orientation="vertical")
                gridWrapper = GridLayout(cols=2)
                #liczba przedzialow
                s = Slider(min=0, max=10, value=5, step=1)
                s.value = 10
                numberOfIntervalsBaseString = Constant("Liczba przedzialow:",1)
                textNumberOfIntervalsBaseString = "{0} {1}".format(numberOfIntervalsBaseString.value, s.value)
                l = Label(text=textNumberOfIntervalsBaseString, halign="center")
                gridWrapper.add_widget(l)
                s.bind(value=partial(self.sliderValueChanged,l,numberOfIntervalsBaseString))
                gridWrapper.add_widget(s)
                
                #wartosc min delklaracja
                minSlider = Slider(min=0, max=100, value=5, step=1)
                #wartosc max deklaracja
                maxSlider = Slider(min=0, max=100, value=5, step=1)
                
                #wartosc min cd
                minSlider.value = 0
                textMinBaseString = Constant("Wartosc min\nuzytkownika:",2)
                textMinString = "{0} {1}".format(textMinBaseString.value, minSlider.value)
                min = Label(text=textMinString, halign="center")
                gridWrapper.add_widget(min)
                minSlider.bind(value=partial(self.sliderValueChanged,min,textMinBaseString, maxSlider))
                gridWrapper.add_widget(minSlider)
                
                #wartosc max cd
                maxSlider.value = 100
                textMaxBaseString = Constant("Wartosc max\nuzytkownika:",3)
                textMaxString = "{0} {1}".format(textMaxBaseString.value, maxSlider.value)
                max = Label(text=textMaxString, halign="center")
                gridWrapper.add_widget(max)
                maxSlider.bind(value=partial(self.sliderValueChanged,max,textMaxBaseString, minSlider))
                gridWrapper.add_widget(maxSlider)
                
                #skok dla przedzialu
                s = Slider(min=0, max=10, value=5, step=.1)
                s.value = 0
                textJumpBaseString = Constant("Szerokosc przedzialu:",4)
                textJump = "{0} {1}".format(textJumpBaseString.value, s.value_normalized)
                j = Label(text=textJump, halign="left")
                s.bind(value=partial(self.sliderValueChanged,j,textJumpBaseString))
                gridWrapper.add_widget(j)
                gridWrapper.add_widget(s)
                
                # Normalizacja zmiennych rzeczywistych ( (wartosc-srednia)/odchylenie_standardowe)
                b = Button(text="Normalizacja danych", on_press=self.buttonCallback)
                gridWrapper.add_widget(b)
                
                
                z = Button(text="Zamiana danych tekstowych\nna numeryczne",  halign='center')
                gridWrapper.add_widget(z)

                menuInside.add_widget(gridWrapper);
                menuWrapper.add_widget(menuInside)
            
        layout.add_widget(menuWrapper)
        return layout
开发者ID:dworak,项目名称:SWD2014,代码行数:98,代码来源:main.py


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