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


Python AbsolutePanel.AbsolutePanel类代码示例

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


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

示例1: __init__

  def __init__(self):
    AbsolutePanel.__init__(self)

    StyleSheetCssText(margins) # initialize css...

    header = """<div><H2 align="center">Welcome to Unbeatable Tic-Tac-Toe!</H2><br>My <a href="https://github.com/chetweger/min-max-games/blob/master/ttt/ttt.py">implementation</a> uses the min-max search algorithm with alpha beta pruning and a transposition table!</div>"""
    header = HTML(header, StyleName='margins_both')
    self.add(header)

    self.ai_first = Button("AI first.", self, StyleName='margins_left')
    self.add(self.ai_first)

    self.new_game = Button("New game", self, StyleName='margins_left')
    self.add(self.new_game)

    self.g=Grid(StyleName='margins_left')
    self.g.resize(3, 3)
    self.g.setBorderWidth(2)
    self.g.setCellPadding(4)
    self.g.setCellSpacing(1)

    self.init()
    self.add(self.g)

    self.state = State()

    self.game_resolution=Label("", StyleName='margins_left')
    self.add(self.game_resolution)
开发者ID:chetweger,项目名称:min-max-games,代码行数:28,代码来源:TTT.py

示例2: remove

 def remove(self, widget):
     if self.getWidget(0) == widget:
         self._container1.remove(widget)
     elif self.getWidget(1) == widget:
         self._container2.remove(widget)
     else:
         AbsolutePanel.remove(self, widget)
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: __init__

    def __init__(self,parent):
        AbsolutePanel.__init__(self)

        self.roleList = ListBox()
        self.roleList.setWidth('300px')
        self.roleList.setVisibleItemCount(6)
        self.roleList.addChangeListener(self.onListChange)
        #self.roleList.addKeyboardListener(self)
        self.roleCombo = ListBox()
        self.roleCombo.addKeyboardListener(self)
        self.roleCombo.addChangeListener(self.onComboChange)
        self.addBtn = Button("Add")
        self.addBtn.setEnabled(False)
        self.removeBtn = Button("Remove")
        self.removeBtn.setEnabled(False)

        vpanel = VerticalPanel()
        vpanel.add(self.roleList)
        hpanel = HorizontalPanel()
        hpanel.add(self.roleCombo)
        hpanel.add(self.addBtn)
        hpanel.add(self.removeBtn)
        vpanel.add(hpanel)

        self.add(vpanel)
        self.clearForm()
        return
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:components.py

示例4: __init__

	def __init__(self):
		AbsolutePanel.__init__(self)
		
		self.app = CompaniesApp()
		
		self.history = []
		
		self.save = Button("save", self)
		self.selectDepartment = Button("select", self)
		self.selectEmployee = Button("select", self)
		self.edit = Button("edit", self)
		self.cut = Button("cut", self)
		self.back = Button("back", self)
		
		self.name = TextBox()
		self.address = TextBox()
		self.manager = TextBox()
		self.departments = ListBox(Size=("100%"), VisibleItemCount="5")
		self.employees = ListBox(Size=("100%"), VisibleItemCount="5")
		self.total = TextBox()

		self.errors = VerticalPanel()
		
		self.grid = Grid()
		self.allPanels = VerticalPanel()
		self.allPanels.add(self.grid)
		self.allPanels.add(self.errors)
		self.add(self.allPanels)
		
		self.initCompanyGUI()
开发者ID:101companies,项目名称:101repo,代码行数:30,代码来源:101Companies.py

示例5: __init__

 def __init__(self, key, title, content):
     AbsolutePanel.__init__(self)
     self.edit_header = Label("Edit a Post", StyleName="header_label")
     self.edit_title_label = Label("Title:")
     self.edit_title = TextBox()
     self.edit_title.setMaxLength(255)
     self.edit_content = TextArea()
     self.edit_content.setVisibleLines(2)
     self.edit_button = Button("Save")
     self.edit_cancel_button = Button("Cancel")
     self.edit_hidden_key = Hidden()
     self.error_message_label = Label("", StyleName="error_message_label")
     edit_contents = VerticalPanel(StyleName="Contents", Spacing=4)
     edit_contents.add(self.edit_header)
     edit_contents.add(self.edit_title_label)
     edit_contents.add(self.edit_title)
     edit_contents.add(self.edit_content)
     edit_contents.add(self.edit_button)
     edit_contents.add(self.edit_cancel_button)
     edit_contents.add(self.error_message_label)
     edit_contents.add(self.edit_hidden_key)
     self.edit_dialog = DialogBox(glass=True)
     self.edit_dialog.setHTML('<b>Blog Post Form</b>')
     self.edit_dialog.setWidget(edit_contents)
     left = (Window.getClientWidth() - 900) / 2 + Window.getScrollLeft()
     top = (Window.getClientHeight() - 600) / 2 + Window.getScrollTop()
     self.edit_dialog.setPopupPosition(left, top)
     self.edit_dialog.hide()
开发者ID:Afey,项目名称:pyjs,代码行数:28,代码来源:components.py

示例6: __init__

    def __init__(self, **kwargs):
        """ setMatchPattern - defaults to '' to match everything
            match pattern examples: '^[0-9]*$' is for digits only
                                    '^[0-9,A-Z]*$' is for digits and uppercase
            setMaxLength
            setText
OB        """

        kwargs['MatchPattern'] = kwargs.pop('MatchPattern', '')
        cs = kwargs.pop('CursorStyle', "inputbox-cursor")
        gs = kwargs.pop('StyleName', 'gwt-inputbox')

        ap = AbsolutePanel(StyleName="inputbox")
        self.tp = Grid(StyleName=gs, Width="100%", Height="100%",
                       CellPadding=0, CellSpacing=0)
        self.cursor = HTML(StyleName=cs)
        ap.add(self.tp)
        ap.add(self.cursor, 0, 0)
        self.cf = self.tp.getCellFormatter()

        FocusPanel.__init__(self, Widget=ap, **kwargs)

        self.addTableListener(self)
        self.addKeyboardListener(self)
        self.addFocusListener(self)

        self.word_selected_pos = 0
        self.ctimer = Timer(notify=self.cursorFlash)
        self.focusset = False
        self.cstate = False
        self._keypressListeners = []
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: setWidth

    def setWidth(self, width):

        self.fontsize = math.floor(width / self.cols)
        AbsolutePanel.setWidth(self, "%dpx" % (self.cols*self.fontsize))

        ratio = self.fontsize / self.fontheight 
        DOM.setStyleAttribute(self.getElement(), 'fontSizeAdjust', str(ratio))
开发者ID:brodybits,项目名称:pyjs,代码行数:7,代码来源:textconsole.py

示例8: __init__

    def __init__(self, width, height):

        AbsolutePanel.__init__(self)
        self.setWidth(width)
        self.setHeight(height)

        self.window = {}
        self.window_zindex = {}
开发者ID:anandology,项目名称:pyjamas,代码行数:8,代码来源:Screen.py

示例9: __init__

    def __init__(self,parent):
        AbsolutePanel.__init__(self)
        ftable = FlexTable()

        ftable.setWidget(0, 0, Label("First Name", wordWrap=False))
        ftableFormatter = ftable.getFlexCellFormatter()
        self.firstInput = TextBox()
        self.firstInput.addChangeListener(self.checkValid)
        self.firstInput.addKeyboardListener(self)
        ftable.setWidget(0, 1, self.firstInput)

        ftable.setWidget(1, 0, Label("Last Name", wordWrap=False))
        self.lastInput = TextBox()
        self.lastInput.addChangeListener(self.checkValid)
        self.lastInput.addKeyboardListener(self)
        ftable.setWidget(1, 1, self.lastInput)

        ftable.setWidget(2, 0, Label("Email", wordWrap=False))
        self.emailInput = TextBox()
        self.emailInput.addChangeListener(self.checkValid)
        self.emailInput.addKeyboardListener(self)
        ftable.setWidget(2, 1, self.emailInput)

        ftable.setWidget(3, 0, Label("Username", wordWrap=False))
        self.usernameInput = TextBox()
        self.usernameInput.addChangeListener(self.checkValid)
        self.usernameInput.addKeyboardListener(self)
        ftable.setWidget(3, 1, self.usernameInput)

        ftable.setWidget(4, 0, Label("Password", wordWrap=False))
        self.passwordInput = PasswordTextBox()
        self.passwordInput.addChangeListener(self.checkValid)
        self.passwordInput.addKeyboardListener(self)
        ftable.setWidget(4, 1, self.passwordInput)

        ftable.setWidget(5, 0, Label("Confirm", wordWrap=False))
        self.confirmInput = PasswordTextBox()
        self.confirmInput.addChangeListener(self.checkValid)
        self.confirmInput.addKeyboardListener(self)
        ftable.setWidget(5, 1, self.confirmInput)

        ftable.setWidget(6, 0, Label("Department", wordWrap=False))
        self.departmentCombo = ListBox()
        self.departmentCombo.addChangeListener(self.checkValid)
        self.departmentCombo.addKeyboardListener(self)
        ftable.setWidget(6, 1, self.departmentCombo)

        hpanel = HorizontalPanel()
        self.addBtn = Button("Add User", self.onAdd)
        self.addBtn.setEnabled(False)
        hpanel.add(self.addBtn)
        self.cancelBtn = Button("Cancel", self.onCancel)
        hpanel.add(self.cancelBtn)
        ftable.setWidget(7, 0, hpanel)
        ftableFormatter.setColSpan(7, 0, 2)

        self.add(ftable)
        return
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:58,代码来源:components.py

示例10: __init__

    def __init__(self):
        SimplePanel.__init__(self)

        panel = AbsolutePanel(Width="100%", Height="100px")

        panel.add(self.makeBox("Child 1"), 20, 10)
        panel.add(self.makeBox("Child 2"), 30, 30)

        self.add(panel)
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:absolutePanel.py

示例11: __init__

 def __init__(self, Element=None, **kwargs):
     if Element is not None:
         kwargs['Element'] = Element
     AbsolutePanel.__init__(self, **kwargs)
     if Element is None:
         # avoid having CSS styles position:relative and hidden set on body
         Element = self.getBodyElement()
         self.setElement(Element)
     self.onAttach()
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:RootPanel.py

示例12: __init__

    def __init__(self, dragController):

        Example.__init__(self, dragController)
        self.addStyleName(self.CSS_DEMO_ABSOLUTE_POSITION_EXAMPLE)
        
        # use the drop target as this composite's widget
        positioningDropTarget = AbsolutePanel()
        positioningDropTarget.setPixelSize(400, 200)
        self.setWidget(positioningDropTarget)
        
        # instantiate our drop controller
        self.absposdc = AbsolutePositionDropController(positioningDropTarget)
        dragController.registerDropController(self.absposdc)
开发者ID:anandology,项目名称:pyjamas,代码行数:13,代码来源:AbsolutePositionExample.py

示例13: __init__

    def __init__(self, cols, rows, width, height):

        AbsolutePanel.__init__(self)
        self.rows = rows
        self.cols = cols
        self.setStyleName("gwt-TextWindow")

        DOM.setStyleAttribute(self.getElement(), 'fontFamily', 'monospace')

        self.setHeight(height)
        self.setWidth(width)

        self.text = {}
        for x in range(self.cols):
            self.text[x] = {}
开发者ID:brodybits,项目名称:pyjs,代码行数:15,代码来源:textconsole.py

示例14: AppFrame

class AppFrame(object):

    edit_panel = None
    home_panel = None
    write_panel = None

    def __init__(self):
        self.panel = AbsolutePanel()
        self.edit_panel = EditPanel(self)
        self.home_panel = HomePanel(self)
        self.write_panel = WritePanel(self)
        self.panel.add(self.edit_panel)
        self.panel.add(self.home_panel)
        self.panel.add(self.write_panel)
        RootPanel().add(self.panel)
开发者ID:Afey,项目名称:pyjs,代码行数:15,代码来源:components.py

示例15: __init__

    def __init__(self):
        AbsolutePanel.__init__(self)

        self.page=0
        self.min_page=1
        self.max_page=10
        
        self.addb=Button("Next >", self)
        self.subb=Button("< Prev", self)
        
        self.g=Grid()
        self.g.resize(5, 5)
        self.g.setHTML(0, 0, "<b>Grid Test</b>")
        self.g.setBorderWidth(2)
        self.g.setCellPadding(4)
        self.g.setCellSpacing(1)
        
        self.updatePageDisplay()

        self.add(self.subb)
        self.add(self.addb)
        self.add(self.g)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:22,代码来源:GridTest.py


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