예제 #1
0
    def __init__(self, screen, orientation):

        self.style = talkshowConfig.config().parser.style
        self.screen = screen
        
        
        # expecting a list of 4 values for the padding values. no css shorthands allowed.
        self.imagePadding = self.style.commandImage.padding
        self.pagePadding = map(lambda x:x/100.0, self.style.page.padding)
        
        self.leftPadding = self.screen.w * self.pagePadding[3] + self.imagePadding[3]
        self.topPadding = self.screen.w * self.pagePadding[0] + self.imagePadding[0]
    
        # 0 = landscape; 1 = vertical
        self.orientation = orientation
        
        # calculate bar size by orientation property
        if self.orientation == 0:
            self.height = screen.h * self.style.commandBar.height / 100.0
            self.width = screen.w * self.style.commandBar.width / 100.0
        else:
            self.height = screen.h * self.style.sideBar.height / 100.0
            self.width = screen.w * self.style.sideBar.width / 100.0

        self.increaseX = 0;
        self.increaseY = 0;
예제 #2
0
import weakref
from sys import getrefcount
import string
import talkshowConfig


style = talkshowConfig.config().parser.style

from talkshowLogger import logger
debug = logger.debug
info = logger.info
warn = logger.warn

#?? pyglet.options['audio'] = ('directsound', 'openal', 'silent')
from pyglet.gl import *
from pyglet.media import *
from rect import *
from animated_property import AnimatedProperty

class Visible(object):
    instanceCount = 0

    def __init__(self, p, name, x=0, y=0, w=10, h=10):
        self.x = x
        self.y = y
        self.w = w
        self.h = h
        self.name = name
        
        self.__parent__ = None
        self.setParent(p)
예제 #3
0
파일: widget.py 프로젝트: regular/talkshow
from round_rect import RoundRect
import wrappers
from wrappers import Group, Text, splitColorChannels, mergeColorChannels, Video, style, Image
from delayed_call import *

from styleSettings import *

import talkshowConfig

conf = talkshowConfig.config()
import talkshowUtils

style = conf.style
mydict = conf.parser.dict


class Widget(Group):
    def __init__(self, p, name, x=0, y=0, w=10, h=10, ox=0, oy=0):
        Group.__init__(self, p, name, x, y, w, h, ox, oy)
        self.mouseOwner = None

    def reverseIterator(self):
        childrencopy = list(self.__children__)
        childrencopy.reverse()
        return childrencopy.__iter__()

    def captureMouse(self):
        self._captureMouse(self)

    def releaseMouse(self):
        self._captureMouse(None)