Beispiel #1
0
 def __init__(self, parent):
     Component.__init__(self, parent)
     TextBase.__init__(self)
     CheckBase.__init__(self)
     TipBase.__init__(self)
     self.command = ''
     self.changeEvent('checked', self.__onCheckChanged, postevent = False)
Beispiel #2
0
    def __init__(self, parent = None, longFormat = False):        
        Component.__init__(self, parent)
        TextBase.__init__(self)

        self.iPlatform = subsys.GetLatestInterface('IPlatform')
        self.date = 2007, 1, 1
        self.margin = (2, 2, 2, 2)
        self.longFormat = longFormat
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__datePicker = koan.platform.CreateDatePicker(callback = self.callback, longFormat = self.longFormat)
        self.window._window.AttachChild2( self.__datePicker.GetHWND() )

        #self.__datePicker.Show( False )
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('date', self.__onDateChange)
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        #koan.anim.Execute(0.3, self.__datePicker.Show, True)
        
        # font
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
Beispiel #3
0
    def __init__(self, parent = None):        
        Component.__init__(self, parent)
        TextBase.__init__(self)
        self.vscroll = False
        self.hscroll = False
        self.maxlen = -1
        self.bgColor = color.white

        self.margin = (2, 2, 2, 2)
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__edit = koan.platform.CreateEdit(callback = self.callback)
        self.changeEvent('text', self.__onTextChanged, sync = False)
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('align', self.__onEditStyleChange)
        self.changeEvent('vscroll', self.__onEditStyleChange)
        self.changeEvent('hscroll', self.__onEditStyleChange)
        self.changeEvent('maxlen', self.__onEditMaxlenChange, sync = False)
        
        # font
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        self.changeEvent('fontColor', self.__onFontColorChange, sync = False)
        self.changeEvent('bgColor', self.__onBgColorChange, sync = False)
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
Beispiel #4
0
 def __init__(self, parent):
     Component.__init__(self, parent)
     TextBase.__init__(self)
     CheckBase.__init__(self)
     TipBase.__init__(self)
     self.command = ''
     self.changeEvent('checked', self.__onCheckChanged, postevent=False)
Beispiel #5
0
 def __init__(self, parent = None):
     Button.__init__(self, parent)
     TextBase.__init__(self)
     ImageBase.__init__(self)
     self.imgSize = 16, 16
     self.textGap = 0
     self.margin = 5, 5, 5, 5
     self.altCmd = ''
     self.changeEvent('text', self.onResize)
     self.changeEvent('textGap', self.onResize)
     self.changeEvent('imgSize', self.onResize)
Beispiel #6
0
    def __init__(self, parent):
        Static.__init__(self, parent)
        TextBase.__init__(self)
        # data
        self.progress = 0.0  # 0.0 ~ 1.0

        # display
        self.margin = 0
        self.margin2 = 0
        self.progressImg = ""
        self.autoDirty(["progress", "progressImg"])
Beispiel #7
0
 def __init__(self, parent):
     Static.__init__(self, parent)
     TextBase.__init__(self)
     # data
     self.progress = 0.0     # 0.0 ~ 1.0
     
     # display
     self.margin = 0
     self.margin2 = 0
     self.progressImg = ''
     self.autoDirty(['progress', 'progressImg'])
Beispiel #8
0
 def __init__(self, parent=None):
     Button.__init__(self, parent)
     TextBase.__init__(self)
     ImageBase.__init__(self)
     self.imgSize = 16, 16
     self.textGap = 0
     self.margin = 5, 5, 5, 5
     self.altCmd = ''
     self.changeEvent('text', self.onResize)
     self.changeEvent('textGap', self.onResize)
     self.changeEvent('imgSize', self.onResize)
Beispiel #9
0
    def __init__(self, parent = None):
        Component.__init__(self, parent)
        TextBase.__init__(self)

        # cursor
        self.cursorColor = color.black
        self.cursorWidth = 1
        self.cursorPos = 0
        self.cursorShow = self.focus
        self.cursorShowAlways = False
        self.changeEvent('cursorPos', self.Regular)        
        
        # blink effect for cursor
        self.cursorAlpha = koan.anim.AnimLinear(1.0, (0, 0.45, 0.55, 1), (1, 1, 0, 0), loop = True)
        #koan.anim.IntervalExecute(0.5, self.onCursorShowChange)
        
        self.password = ''
        self.changeEvent('text', self.__onCheckCursorPos, sync = False)
        self.changeEvent('text', self.invoke, 'Value Change', self)

        self.margin = (2, 2, 2, 2)
        self.editrect = (0, 0, 0, 0)
        self._grawBound = (0, 0, 0, 0)
        self.spaceWidth = 10
               
        self.unit = 1, 1
        self.maxlen = 255
        self.beginOffset = 0

        self.autoDirty(['text', 'cursorPos', 'beginOffset', 'cursorShow'])
        
        self.bind('Size Change', self.onSize)
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))
        self.bind('Focus Change', self.onCursorShowChange)

        # file name input
        self.legalFileNameOnly = False
        
        # number        
        self.numbersOnly = False     
        self.autoadddecimal = True
        import locale
        self.decimal = locale.localeconv()['decimal_point']
        
        # 10 key input
        self.EnableDigitLetter = koan.config.getBool('Misc', 'EnableDigitLetter', True)  
        self.RCExpireTime = 1.5
        self.RCKeyTimer = 0
        self.RCKeyValue = -1
        self.RCKeyIndex = 0        
Beispiel #10
0
    def __init__(self, parent=None, **argd):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        CheckBase.__init__(self, **argd)
        TipBase.__init__(self)

        # property
        self.checkImg = ''
        self.autosize = False
        self.margin = 5
        self.onAutoSize()  # self.checkPos

        self.changeEvent('text', self.onAutoSize)
        self.changeEvent('margin', self.onAutoSize)
        self.bind('Size Change', self.onAutoSize)
        self.autoDirty(['checkImg', 'margin'])
Beispiel #11
0
    def __init__(self, parent = None, **argd):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        CheckBase.__init__(self, **argd)
        TipBase.__init__(self)
        
        # property
        self.checkImg = ''
        self.autosize = False
        self.margin = 5
        self.onAutoSize()     # self.checkPos

        self.changeEvent('text', self.onAutoSize)
        self.changeEvent('margin', self.onAutoSize)
        self.bind('Size Change', self.onAutoSize)
        self.autoDirty( ['checkImg', 'margin'] )     
Beispiel #12
0
    def __init__(self, parent=None, header=''):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        AutoLayout.__init__(self)

        # default value
        self.tabStop = False
        self.height = 20
        self.clip = False

        # menu item
        self.header = header
        self.margin = 5, 2, 5, 2
        self.command = ''

        # icon
        self.icon = ''
        self.iconMargin = 0, 3, 5, 3
        self.iconWidth = 28

        # sub menu
        self.subMenuSize = 10, 10
        self.subMenuPos = 0, 0
        self.sysMenuItem = False
        self.subMenuExpand = False
        self.subMenuOffset = 0
        self.highLit = 'Empty'

        self.changeEvent('header', self.onHeaderChange)
        self.changeEvent('font', self.onHeaderChange)
        self.changeEvent('fontSize', self.onHeaderChange)
        self.changeEvent('subMenuExpand',
                         self.onSubMenuExpandChange,
                         sync=False)
        self.bind('Click', self.onClick)
        self.bind('Mouse Enter', self.setFocus, postevent=False)
        self.bind('Mouse Wheel', self.scroll)
        self.bind('Focus Change', self.onFocusChange, postevent=False)
        self.bind('Mouse Enter', self.onMouseEnter, postevent=False)
        self.bind('Parent Change', self.onParentChange)
        self.onParentChange()

        self.autoDirty(['subMenuExpand', 'highLit', 'sightRect'])
Beispiel #13
0
    def __init__(self, parent=None, header=""):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        AutoLayout.__init__(self)

        # default value
        self.tabStop = False
        self.height = 20
        self.clip = False

        # menu item
        self.header = header
        self.margin = 5, 2, 5, 2
        self.command = ""

        # icon
        self.icon = ""
        self.iconMargin = 0, 3, 5, 3
        self.iconWidth = 28

        # sub menu
        self.subMenuSize = 10, 10
        self.subMenuPos = 0, 0
        self.sysMenuItem = False
        self.subMenuExpand = False
        self.subMenuOffset = 0
        self.highLit = "Empty"

        self.changeEvent("header", self.onHeaderChange)
        self.changeEvent("font", self.onHeaderChange)
        self.changeEvent("fontSize", self.onHeaderChange)
        self.changeEvent("subMenuExpand", self.onSubMenuExpandChange, sync=False)
        self.bind("Click", self.onClick)
        self.bind("Mouse Enter", self.setFocus, postevent=False)
        self.bind("Mouse Wheel", self.scroll)
        self.bind("Focus Change", self.onFocusChange, postevent=False)
        self.bind("Mouse Enter", self.onMouseEnter, postevent=False)
        self.bind("Parent Change", self.onParentChange)
        self.onParentChange()

        self.autoDirty(["subMenuExpand", "highLit", "sightRect"])
Beispiel #14
0
    def __init__(self, parent = None):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        # default value
        self.tabStop = False
        self.height = 20

        # menu item
        self.header = ''
        self.margin = 5, 2, 5, 2
        self.autosize = True
        self.toolbar = ''
        
        self.selected = False

        self.changeEvent('header', self.onHeaderChange)
        self.changeEvent('font', self.onHeaderChange)
        self.changeEvent('fontSize', self.onHeaderChange)
        self.bind('Click', self.setFocus)
        self.autoRemove( self.parent.bind('Focus Child Change', self.onSelectChange) )
        self.bind('Visible Change', self.onSelectChange)
        self.onSelectChange()
Beispiel #15
0
    def __init__(self, parent=None):
        Component.__init__(self, parent)
        TextBase.__init__(self)
        # default value
        self.tabStop = False
        self.height = 20

        # menu item
        self.header = ''
        self.margin = 5, 2, 5, 2
        self.autosize = True
        self.toolbar = ''

        self.selected = False

        self.changeEvent('header', self.onHeaderChange)
        self.changeEvent('font', self.onHeaderChange)
        self.changeEvent('fontSize', self.onHeaderChange)
        self.bind('Click', self.setFocus)
        self.autoRemove(
            self.parent.bind('Focus Child Change', self.onSelectChange))
        self.bind('Visible Change', self.onSelectChange)
        self.onSelectChange()
Beispiel #16
0
    def __init__(self, parent=None, longFormat=False):
        Component.__init__(self, parent)
        TextBase.__init__(self)

        self.iPlatform = subsys.GetLatestInterface('IPlatform')
        self.date = 2007, 1, 1
        self.margin = (2, 2, 2, 2)
        self.longFormat = longFormat
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__datePicker = koan.platform.CreateDatePicker(
            callback=self.callback, longFormat=self.longFormat)
        self.window._window.AttachChild2(self.__datePicker.GetHWND())

        #self.__datePicker.Show( False )
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('date', self.__onDateChange)
        self.changeEvent('font', self.__onFontChanged, sync=False)
        self.changeEvent('fontSize', self.__onFontChanged, sync=False)
        #koan.anim.Execute(0.3, self.__datePicker.Show, True)

        # font
        self.bind('Visible Change', self.__onEditVisibleChange)
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)

        child = self
        while parent != None:
            child.autoRemove(
                parent.bind('Parent Position Change',
                            child.invoke,
                            'Parent Position Change',
                            postevent=False))
            child = parent
            parent = child.parent
Beispiel #17
0
 def __init__(self, parent = None):
     Button.__init__(self, parent)
     TextBase.__init__(self)
Beispiel #18
0
 def __init__(self, parent=None):
     Button.__init__(self, parent)
     TextBase.__init__(self)