Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c49000
commit 710bd80
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import kivy | ||
kivy.require('1.10.0') | ||
from kivy.core.window import Window | ||
from kivy.app import App | ||
from kivy.uix.floatlayout import FloatLayout | ||
from kivy.base import runTouchApp | ||
from kivy.uix.label import Label | ||
from kivy.graphics import Color, Rectangle | ||
from kivy.uix.textinput import TextInput | ||
from kivy.uix.spinner import Spinner | ||
from kivy.uix.checkbox import CheckBox | ||
Window.size = (500, 400) | ||
Window.clearcolor = (0.1, 0.1, 0.3, 0.2) | ||
|
||
|
||
def show_selected_value(spinner, text): | ||
print('Selected Process', spinner, 'have text', text) | ||
|
||
|
||
class LRefConfigAutomation(App): | ||
config = None | ||
|
||
def build_config(self, config): | ||
config.setdefaults('LefConfigWindowSection', { | ||
'PartInputLabel': 'Please Enter your Part No', | ||
'TypeOfProcessLabel': 'Select Type Of Process', | ||
'NormalFolderName': 'Enter Normal Folder Name', | ||
|
||
}) | ||
self.config = config | ||
|
||
def build(self): | ||
config = self.config | ||
root = FloatLayout() | ||
lbl = config.get('LefConfigWindowSection', 'PartInputLabel') | ||
self.label = Label(text=lbl, pos_hint={"center_x": .66, "center_y": .90}, size_hint=(1.0, 1.0), halign="left",valign="middle", font_name='Georgia') | ||
self.label.bind(size=self.label.setter('text_size')) | ||
self.label.font_size = '14.5dp' # something that'll give texture bigger than phone's screen size | ||
root.add_widget(self.label) | ||
with self.label.canvas: | ||
Color(0, 0, 0, 0) | ||
Rectangle(pos=self.label.pos, size=self.label.size) | ||
self.txtKemNo = TextInput(pos_hint={"center_x": .66, "center_y": .90}, size_hint=(None, None),font_name="Georgia", size=(100, 30), multiline=False, hint_text="Part Number") | ||
root.add_widget(self.txtKemNo) | ||
lbl = config.get('LefConfigWindowSection', 'TypeOfProcessLabel') | ||
self.label = Label(text=lbl, pos_hint={"center_x": .66, "center_y": .75}, size_hint=(1.0, 1.0), halign="left",valign="middle", font_name='Georgia') | ||
self.label.bind(size=self.label.setter('text_size')) | ||
self.label.font_size = '14.5dp' # something that'll give texture bigger than phone's screen size | ||
root.add_widget(self.label) | ||
with self.label.canvas: | ||
Color(0, 0, 0, 0) | ||
Rectangle(pos=self.label.pos, size=self.label.size) | ||
self.requestsspinner = Spinner( | ||
# default value shown | ||
text='Select Process', | ||
# available values will be binded to the combo | ||
values=("Normal", "Official"), | ||
# just for positioning in our example | ||
size_hint=(None, None), | ||
size=(110, 20), | ||
pos_hint={'center_x': .66, 'center_y': .75}, font_name='Georgia') | ||
self.requestsspinner.font_size = '14.5dp' | ||
self.requestsspinner.bind(text=show_selected_value) | ||
self.requestsspinner.bind(on_click=self.CreateLable) | ||
root.add_widget(self.requestsspinner) | ||
runTouchApp(root) | ||
def CreateLable(self, spinner, text): | ||
root = FloatLayout() | ||
print(text) | ||
if text == "Normal": | ||
pass | ||
elif text == "Official": | ||
config = self.config | ||
lbl = config.get('LefConfigWindowSection', 'NormalFolderName') | ||
print(lbl) | ||
self.label = Label(text=lbl, pos_hint={"center_x": .66, "center_y": .65}, size_hint=(1.0, 1.0),halign="left",valign="middle", font_name='Georgia') | ||
self.label.bind(size=self.label.setter('text_size')) | ||
self.label.font_size = '14.5dp' | ||
root.add_widget(self.label) | ||
with self.label.canvas: | ||
Color(0, 0, 0, 0) | ||
Rectangle(pos=self.label.pos, size=self.label.size) | ||
|
||
if __name__ == "__main__": | ||
LRefConfigAutomation().run() |
710bd80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``