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


Python DockPanel.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import __init__ [as 别名]
    def __init__(self):
        DockPanel.__init__(self)
        self.setSize('100%', '100%')

        self.geocoder = Geocoder()

        # widgets

        topPanel = HorizontalPanel()
        self.add(topPanel, DockPanel.NORTH)

        self.address = TextBox()
        self.address.setText("Sydney, NSW")
        self.address.addChangeListener(self.codeAddress)

        topPanel.add(self.address)

        button = Button("Geocode")
        button.addClickListener(self.codeAddress)

        topPanel.add(button)

        # now, the map

        mapPanel = SimplePanel()
        mapPanel.setSize('600', '400')
        self.add(mapPanel, DockPanel.CENTER)

        options = MapOptions(zoom=8, center=LatLng(-34.397, 150.644),
                           mapTypeId=MapTypeId.ROADMAP)

        self.map = Map(mapPanel.getElement(), options)
开发者ID:Afey,项目名称:pyjs,代码行数:34,代码来源:GeocodingSimple.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import __init__ [as 别名]
    def __init__(self):
        DockPanel.__init__(self)
        self.setSize('100%', '100%')

        # widgets

        topPanel = HorizontalPanel()
        self.add(topPanel, DockPanel.NORTH)

        places = {
            "chicago, il": "Chicago",

            "st louis, mo": "St Louis",
            "joplin, mo": "Joplin, MO",
            "oklahoma city, ok": "Oklahoma City",
            "amarillo, tx": "Amarillo",
            "gallup, nm": "Gallup, NM",
            "flagstaff, az": "Flagstaff, AZ",

            "winona, az": "Winona",
            "kingman, az": "Kingman",
            "barstow, ca": "Barstow",
            "san bernardino, ca": "San Bernardino",
            "los angeles, ca": "Los Angeles"}

        self.start = ListBox()
        self.end = ListBox()

        for value in places:
            self.start.addItem(places[value], value)
            self.end.addItem(places[value], value)

        self.start.addChangeListener(self.calcRoute)
        self.end.addChangeListener(self.calcRoute)

        topPanel.add(self.start)
        topPanel.add(self.end)

        # now, the map

        mapPanel = SimplePanel()
        mapPanel.setSize('800', '500')
        self.add(mapPanel, DockPanel.CENTER)

        chigado = LatLng(41.850033, -87.6500523)
        options = MapOptions(zoom=7, center=chigado,
                           mapTypeId=MapTypeId.ROADMAP)

        self.map = Map(mapPanel.getElement(), options)

        # initialize the renderer
        self.directionsDisplay = DirectionsRenderer()
        self.directionsDisplay.setMap(self.map)

        self.directionsService = DirectionsService()
开发者ID:certik,项目名称:pyjamas,代码行数:57,代码来源:DirectionsSimple.py

示例3: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import __init__ [as 别名]
    def __init__(self, **kwargs):
        DockPanel.__init__(self, **kwargs)
        self.grid = Grid(StyleName="datagrid")
        self.sp = ScrollPanel(self.grid, Width="100%", Height="100%")
        self.header = Grid(Height="50px")
        self.add(self.header, DockPanel.NORTH)
        self.add(self.sp, DockPanel.CENTER)
        cf = self.setCellHeight(self.header, "50px")
        cf = self.setCellHeight(self.sp, "100%")

        self.sortcol = 0
开发者ID:Afey,项目名称:pyjs,代码行数:13,代码来源:SortedGridThing.py

示例4: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import __init__ [as 别名]
 def __init__(self):
     DockPanel.__init__(self)
     self.grids = {}
     self.g = Grid()
     self.g.setCellSpacing("0px")
     self.g.setCellPadding("8px")
     self.title = HTML(" ")
     self.title.setStyleName("rightpanel-title")
     self.add(self.title, DockPanel.NORTH)
     self.setCellWidth(self.title, "100%")
     self.setCellHorizontalAlignment(self.title,
                                     HasHorizontalAlignment.ALIGN_LEFT)
     self.add(self.g, DockPanel.CENTER)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:15,代码来源:InfoDirectory.py

示例5: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import __init__ [as 别名]
 def __init__(self):
     DockPanel.__init__(self,
                       #BorderWidth=1,Padding=8,
                       HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                       VerticalAlignment=HasAlignment.ALIGN_MIDDLE)
开发者ID:Afey,项目名称:pyjs,代码行数:7,代码来源:raphael_showcase.py


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