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


Python FocusWidget.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, element, min_value, max_value,
                       start_value_xy=None, step_xy=None, **kwargs):

        self.min_value_x = min_value[0]
        self.min_value_y = min_value[1]

        self.max_value_x = max_value[0]
        self.max_value_y = max_value[1]

        if start_value_xy is None:
            self.start_value_x = self.min_value_x
            self.start_value_y = self.min_value_y
        else:
            self.start_value_x = start_value_xy[0]
            self.start_value_y = start_value_xy[1]

        if step_xy is None:
            self.step_x = (self.max_value_x - self.min_value_x) / 20
            self.step_y = (self.max_value_y - self.min_value_y) / 20
        else:
            self.step_x = step_xy[0]
            self.step_y = step_xy[1]

        self.value_x = self.start_value_x
        self.value_y = self.start_value_y

        self.valuechange_listeners = []
        self.dragging = False
        self.drag_enabled = False

        if not kwargs.has_key("TabIndex"): kwargs['TabIndex'] = 0
        FocusWidget.__init__(self, element, **kwargs)
        MouseHandler.__init__(self)
开发者ID:Afey,项目名称:pyjs,代码行数:35,代码来源:DoubleControl.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, element, **kwargs):
        self.changeListeners = []
        self.inputListeners = []
        self.currentEvent = None

        FocusWidget.__init__(self, element, **kwargs)
        self.sinkEvents(Event.ONCHANGE | Event.ONINPUT)
开发者ID:anandology,项目名称:pyjamas,代码行数:9,代码来源:TextBoxBase.py

示例3: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
 def __init__(self, **kwargs):
     if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-ListBox"
     self.changeListeners = []
     self.INSERT_AT_END = -1
     element = kwargs.pop('Element', None) or DOM.createSelect()
     FocusWidget.__init__(self, element, **kwargs)
     self.sinkEvents(Event.ONCHANGE)
开发者ID:anandology,项目名称:pyjamas,代码行数:9,代码来源:ListBox.py

示例4: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
 def __init__(self,i,j):
     self.i = i
     self.j = j
     self.light = True
     element = DOM.createDiv()
     #DOM.setInnerHTML(element,'<b>%i%i</b>' % (i,j))
     FocusWidget.__init__(self, element)
     self.redraw()
     self.addClickListener(self)
开发者ID:jaredly,项目名称:pyjamas,代码行数:11,代码来源:lightout.py

示例5: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, options=None, *args, **kwargs):
        element = DOM.createDiv()
        if not 'StyleName' in kwargs:
            kwargs['StyleName'] = 'leaflet-Map'
        FocusWidget.__init__(self, element, *args, **kwargs)

        map_element = DOM.createDiv()
        DOM.setStyleAttribute(map_element, 'width', '100%')
        DOM.setStyleAttribute(map_element, 'height', '100%')
        DOM.appendChild(element, map_element)
        JS('this._map = new $wnd.L.Map(map_element, pyjslib.toJSObjects(options));')

        self._layers = []
开发者ID:rjw57,项目名称:foldbeam,代码行数:15,代码来源:Map.py

示例6: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, coordX=None, coordY=None, pixelX=None, pixelY=None,
                       **kwargs):
        """
        Creates an SVGCanvas element. Element type is 'svg'

        @param coordX the size of the coordinate space in the x direction
        @param coordY the size of the coordinate space in the y direction
        @param pixelX the CSS width in pixels of the canvas element
        @param pixelY the CSS height in pixels of the canvas element
        """

        # init default coordinates/size
        self.pixelHeight = 150
        self.pixelWidth = 300
        self.coordHeight = self.pixelHeight
        self.coordWidth = self.pixelWidth
        focusable = Focus.createFocusable()
        self.canvas = self._createElementSVG("svg")

        # create an empty defs element
        self.defs = self._createElementSVG("defs")
        # and add it to the canvas
        DOM.appendChild(self.canvas, self.defs)
        # now add canvas to container
        DOM.appendChild(focusable, self.canvas)

        # init base widget (invokes settables)
        FocusWidget.__init__(self, focusable, **kwargs)

        # since the Applier class provides settable access,
        # we only override the dimensions if user actually
        # provided them as keyword args
        if pixelX is not None:
            self.setPixelWidth(pixelX)
        if pixelY is not None:
            self.setPixelHeight(pixelY)
        if coordX is not None:
            self.setCoordWidth(coordX)
        if coordY is not None:
            self.setCoordHeight(coordY)

        # init styles context stack
        self.ctx_stack = []
        # init current context
        self._init_context()

        # insure we clear/init the canvas
        self.clear()
开发者ID:Afey,项目名称:pyjs,代码行数:50,代码来源:SVGCanvas.py

示例7: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, Width=0, Height=0, **kwargs):
        if not kwargs.has_key('StyleName'):
            kwargs['StyleName'] = 'gwt-Canvas'
        kwargs['Width'] = Width
        kwargs['Height'] = Height

        self.context = None

        focusable = Focus.createFocusable()
        self.canvas = DOM.createElement("canvas")
        DOM.appendChild(focusable, self.canvas)
        FocusWidget.__init__(self, focusable, **kwargs)

        self.init()

        self.context.fillStyle = "black"
        self.context.strokeStyle = "black"
开发者ID:audreyr,项目名称:pyjs,代码行数:19,代码来源:Canvas2D.py

示例8: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, coordX=300, coordY=150, pixelX=300, pixelY=150,
                       **kwargs):

        """
        * Impl Instance. Compiler should statify all the methods, so we
        * do not end up with duplicate code for each canvas instance.
        """
        self.impl = self.getCanvasImpl()

        self.coordHeight = 0
        self.coordWidth = 0
        focusable = Focus.createFocusable()
        self.canvas = self.impl.createElement()
        DOM.appendChild(focusable, self.canvas)
        FocusWidget.__init__(self, focusable, **kwargs)

        self.setPixelWidth(pixelX)
        self.setPixelHeight(pixelY)
        self.setCoordSize(coordX, coordY)
开发者ID:Afey,项目名称:pyjs,代码行数:21,代码来源:GWTCanvas.py

示例9: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, element, min_value, max_value,
                       start_value=None, step=None,
                       **kwargs):

        self.min_value = min_value
        self.max_value = max_value
        if start_value is None:
            start_value = min_value
        if step is None:
            step = (self.max_value - self.min_value) / 20
        self.step = step
        self.value = start_value
        self.valuechange_listeners = []
        self.dragging = False
        self.drag_enabled = False

        kwargs['TabIndex'] = kwargs.get("TabIndex", 0)

        FocusWidget.__init__(self, element, **kwargs)
        MouseHandler.__init__(self)
        MouseWheelHandler.__init__(self, True)
        self.addMouseWheelListener(self)
开发者ID:Afey,项目名称:pyjs,代码行数:24,代码来源:Control.py

示例10: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
  def __init__(self, className=None):
    element = DOM.createIFrame()
    FocusWidget.__init__(self,element)

    self.floorplan_file = "floorplan.svg"


    #DOM.setStyleAttribute(element, "position", "relative")
    #DOM.setStyleAttribute(element, "overflow", "hidden")
    #DOM.setStyleAttribute(element, "border", "1px")
    #DOM.setStyleAttribute(element, "width", "100px")
    #DOM.setStyleAttribute(element, "height", "100px")
    #DOM.setStyleAttribute(element, "backgroundColor", "lightblue")

    self.svg_area = element
    self.rot_deg = 0.0
    self.scale = 1.0
    self.x_translate = 0.0
    self.y_translate = 0.0

    self.draw_elements()
    self.svg_area.setAttribute("class", className)
开发者ID:Afey,项目名称:pyjs,代码行数:24,代码来源:svgWindow.py

示例11: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
    def __init__(self, element, **kwargs):
        self.currentEvent = None

        FocusWidget.__init__(self, element, **kwargs)
        ChangeHandler.__init__(self)
        InputHandler.__init__(self)
开发者ID:nielsonsantana,项目名称:pyjs,代码行数:8,代码来源:TextBoxBase.py

示例12: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
 def __init__(self, **kwargs):
     if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-ListBox"
     self.INSERT_AT_END = -1
     element = kwargs.pop('Element', None) or DOM.createSelect()
     FocusWidget.__init__(self, element, **kwargs)
     ChangeHandler.__init__(self)
开发者ID:Afey,项目名称:pyjs,代码行数:8,代码来源:ListBox.py

示例13: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
 def __init__(self, element, **kwargs):
     FocusWidget.__init__(self, element, **kwargs)
开发者ID:Afey,项目名称:pyjs,代码行数:4,代码来源:ButtonBase.py

示例14: __init__

# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import __init__ [as 别名]
 def __init__(self, **kwargs):
     if not kwargs.has_key("StyleName"):
         kwargs["StyleName"] = "gwt-RichTextArea"
     self.impl = RichTextAreaImplStandard()
     FocusWidget.__init__(self, self.impl.getElement(), **kwargs)
开发者ID:anandology,项目名称:pyjamas,代码行数:7,代码来源:RichTextArea.py


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