Esempio n. 1
0
from kivy.uix.label import Label
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.widget import Widget
from kivy.uix.anchorlayout import AnchorLayout
from kivy.utils import get_color_from_hex
from kivy.properties import (ObjectProperty, StringProperty, AliasProperty,
                             NumericProperty, ListProperty, BooleanProperty,
                             OptionProperty)
from kivy.graphics import Color, Rectangle, Ellipse
from kivy.graphics.instructions import InstructionGroup
from kivy.vector import Vector
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.metrics import dp
import components.resources as res
Builder.load_file(res.get_kv("buttons"))


class Decorators(AnchorLayout):
    def __init__(self, **kargs):
        super(Decorators, self).__init__(**kargs)


class ButtonBase(ButtonBehavior, Widget):
    tag = ObjectProperty(None, allownone=True)
    bgColor = StringProperty('#707070')
    font_size = StringProperty("30dp")
    container = ObjectProperty(None)
    listchild = ListProperty([])
    color = ListProperty([1, 1, 1, 1])
    shape_up = ObjectProperty(None)
Esempio n. 2
0
# @Date:   14-Jul-2017
# @Email:  [email protected]
# @Filename: pagenavigations.py
# @Last modified by:   valle
# @Last modified time: 06-Feb-2018
# @License: Apache license vesion 2.0

from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import (StringProperty, ListProperty, NumericProperty,
                             ObjectProperty, DictProperty)
from kivy.animation import Animation
from kivy.lang import Builder
import components.resources as res

Builder.load_file(res.get_kv("pagenavigations"))


#The home page is the first page that is displayed and usually contains a menu.
class MainPage(RelativeLayout):
    title = StringProperty('')
    title_bg_color = StringProperty("#ffffff")
    page_manager = ObjectProperty(None)
    show = ObjectProperty(None)

    def __init__(self, **kargs):
        super(MainPage, self).__init__(**kargs)

    def add_widget(self, widget):
        if len(self.children) < 1:
            super(MainPage, self).add_widget(widget)
Esempio n. 3
0
# @License: Apache license vesion 2.0

from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.widget import Widget
from kivy.uix.behaviors import ButtonBehavior
from kivy.vector import Vector
from kivy.graphics import Color, Rectangle, Ellipse
from kivy.graphics.instructions import InstructionGroup
from kivy.lang import Builder
from kivy.properties import (StringProperty, ObjectProperty, ListProperty,
                             OptionProperty, NumericProperty)
from kivy.clock import Clock
from math import ceil
import components.resources as res

Builder.load_file(res.get_kv("labels"))


class LabelDecorators(AnchorLayout):
    def __init__(self, **kargs):
        super(LabelDecorators, self).__init__(**kargs)


class LabelBase(Widget):
    bgColor = StringProperty("#4594be")
    color = StringProperty("#000000")
    text = StringProperty()
    font_size = StringProperty('30dp')
    listchild = ListProperty([])
    border_size = NumericProperty(5)
Esempio n. 4
0
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.behaviors import ButtonBehavior
from kivy.utils import get_color_from_hex, get_hex_from_color
from kivy.properties import (StringProperty, ObjectProperty, OptionProperty,
                             ListProperty, DictProperty, BooleanProperty,
                             AliasProperty)
from kivy.lang import Builder
from kivy.animation import Animation
from kivy.metrics import dp
from components.resources import Res as res
from components.resources import get_kv

Builder.load_file(get_kv('inputform'))

tipo = [
    'CharField', 'DecimalField', 'DateField', 'DateTimeField', 'BooleanField',
    'IntegerField', 'FloatField', 'TextField'
]


def get_type_control(tipo):
    if tipo in ['CharField', 'EmailField']:
        return "text"
    elif tipo in ["TextField"]:
        return "text_edit"
    elif tipo in ['IntegerField']:
        return "number"
    elif tipo in [
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.widget import Widget
from kivy.uix.anchorlayout import AnchorLayout
from kivy.graphics import Color, Ellipse
from kivy.graphics.instructions import InstructionGroup
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.logger import Logger
from kivy.utils import get_color_from_hex
from kivy.clock import Clock
from kivy.animation import Animation
from functools import partial
from components.resources import Res as res
from components.resources import get_kv

Builder.load_file(get_kv("floatbuttons"))


class FloatButtonBase(AnchorLayout):
    icon = StringProperty(res.FA_EDIT)
    color = ObjectProperty([1, 1, 1, 1])
    bg_color = ObjectProperty([0, .4, .6, 1])
    font_size = ObjectProperty('20dp')
    button_size = ObjectProperty("65dp")
    align = OptionProperty("bottom", options=["bottom", "top"])
    press = ObjectProperty(None)
    release = ObjectProperty(None)

    def get_button_size(self):
        if type(self.button_size) is str:
            self.button_size = dp(self.button_size.replace('dp', ''))
Esempio n. 6
0
from kivy.metrics import dp
from kivy.graphics import Color, Rectangle, Ellipse
from kivy.graphics.instructions import InstructionGroup
from kivy.lang import Builder
from kivy.utils import get_color_from_hex
from kivy.properties import (StringProperty, ObjectProperty, BooleanProperty,
                             ListProperty, OptionProperty, NumericProperty,
                             AliasProperty)
from kivy.clock import Clock
from kivy.animation import Animation
from math import ceil
from datetime import datetime
from components.resources import Res as res
from components.resources import get_kv

Builder.load_file(get_kv("labels"))


class LabelDecorators(AnchorLayout):
    def __init__(self, **kargs):
        super(LabelDecorators, self).__init__(**kargs)


class LabelBase(ButtonBehavior, Widget):
    bg_color = ObjectProperty((0, 1, .5, 1))
    color = ObjectProperty((0, 0, 0, 1))
    text = StringProperty()
    font_size = StringProperty('30dp')
    border_size = NumericProperty("3dp")
    valign = OptionProperty("middle", options=["top", "middle", "bottom"])
    halign = OptionProperty("center", options=["left", "center", "right"])