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


Python VerticalPanel.setSpacing方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
 def __init__(self, chart):
     self.chart = chart
     self.canvas = chart.canvas
     
     self.b2 = Button("Compositing", self)
     self.b3 = Button("Paths & shapes", self)
     self.b4 = Button("Arcs & circles", self)
     self.b1 = Button("Bezier curves", self)
     self.b6 = Button("Colors", self)
     self.b7 = Button("Translating", self)
     self.b8 = Button("Scaling", self)
     self.b5 = Button("Rotating", self)
     self.b10 = Button("Transparency", self)
     self.b11 = Button("Lines", self)
     self.b9 = Button("Animations", self)
     
     hp = HorizontalPanel()
     vp = VerticalPanel()
     vp.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
     vp.add(Label("MENU"))
     vp.setSpacing(6)
     vp.add(self.b2)
     vp.add(self.b3)
     vp.add(self.b4)
     vp.add(self.b1)
     vp.add(self.b6)
     vp.add(self.b7)
     vp.add(self.b8)
     vp.add(self.b5)
     vp.add(self.b10)
     vp.add(self.b11)
     vp.add(self.b9)
     hp.add(vp)
     
     Composite.__init__(self, hp)
开发者ID:anandology,项目名称:pyjamas,代码行数:37,代码来源:SuiteDemo.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.fPasswordText = PasswordTextBox()
        self.fTextArea = TextArea()
        self.fTextBox = TextBox()

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.add(HTML("Normal text box:"))
        panel.add(self.createTextThing(self.fTextBox))
        panel.add(HTML("Password text box:"))
        panel.add(self.createTextThing(self.fPasswordText))
        panel.add(HTML("Text area:"))
        panel.add(self.createTextThing(self.fTextArea))

        panel.add(HTML("""Textarea below demos oninput event. oninput allows
to detect when the content of an element has changed. This is different
from examples above, where changes are detected only if they are made with
keyboard. oninput occurs when the content is changed through any user
interface(keyboard, mouse, etc.). For example, at first type few chars, but
then paste some text to the text areas above and below by selecting 'Paste'
command from context menu or by dragging&dropping and see the difference.
oninput is similar to onchange event, but onchange event fires only when a
text-entry widget loses focus."""))
        vp = VerticalPanel()
        self.echo = HTML()
        textArea = TextArea()
        vp.add(textArea)
        vp.add(self.echo)
        textArea.addInputListener(self)
        panel.add(vp)

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

示例3: Dashboard

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
class Dashboard(Composite):
    def __init__(self):
        Composite.__init__(self)

        self.outer = VerticalPanel()
        self.outer.setSpacing("20px")
        self.outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER)
        
        self.display_panel = DisplayPanel()
        self.screen = Screen()
        self.screen.base = self
        self.screen.display_panel = self.display_panel
        self.control_panel = ControlPanel()
        self.control_panel.base = self
        
        self.initWidget(self.outer)
        self.outer.add(self.display_panel)
        self.outer.add(self.screen)
        self.outer.add(self.control_panel)

        self.initDashboard()

    def initDashboard(self):
        self.screen.resize(4,4)
        self.screen.shuffle()

    def incrCount(self):
        self.display_panel.incrCount()
开发者ID:vijayendra,项目名称:Puzzle-Game,代码行数:30,代码来源:Puzzle.py

示例4: drawFull

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def drawFull(self, month, year):
        # should be called only once when we draw the calendar for
        # the first time
        self.vp = VerticalPanel()
        self.vp.setSpacing(2)
        self.vp.addStyleName("calendarbox calendar-module calendar")
        self.setWidget(self.vp)
        self.setVisible(False)
        #
        mth = int(month)
        yr = int(year)

        tp = HorizontalPanel()
        tp.addStyleName("calendar-top-panel")
        tp.setSpacing(5)

        h1 = Hyperlink('<<')
        h1.addClickListener(getattr(self, 'onPreviousYear'))
        h2 = Hyperlink('<')
        h2.addClickListener(getattr(self, 'onPreviousMonth'))
        h4 = Hyperlink('>')
        h4.addClickListener(getattr(self, 'onNextMonth'))
        h5 = Hyperlink('>>')
        h5.addClickListener(getattr(self, 'onNextYear'))

        tp.add(h1)
        tp.add(h2)

        # titlePanel can be changed, whenever we draw, so keep the reference
        txt = "<b>"
        txt += self.getMonthsOfYear()[mth-1] + " " + str(yr)
        txt += "</b>"
        self.titlePanel = SimplePanel()
        self.titlePanel.setWidget(HTML(txt))
        self.titlePanel.setStyleName("calendar-center")

        tp.add(self.titlePanel)
        tp.add(h4)
        tp.add(h5)
        tvp = VerticalPanel()
        tvp.setSpacing(10)
        tvp.add(tp)

        self.vp.add(tvp)

        # done with top panel

        self.middlePanel = SimplePanel()
        grid = self.drawGrid(mth, yr)
        self.middlePanel.setWidget(grid)
        self.vp.add(self.middlePanel)
        self.defaultGrid = grid

        self._gridShortcutsLinks()
        self._gridCancelLink()
        #
        # add code to test another way of doing the layout
        #
        self.setVisible(True)
        return
开发者ID:jwashin,项目名称:pyjs,代码行数:62,代码来源:Calendar.py

示例5: make_panel

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def make_panel(self):
        message = Label(
            'The configuration has been changed.\n'
            'You must apply the changes in order for them to take effect.')
        DOM.setStyleAttribute(message.getElement(), "whiteSpace", 'pre')

        msgbox = Grid(1, 2, StyleName='changes')
        msgbox.setWidget(0, 0, Image('icons/exclam.png'))
        msgbox.setWidget(0, 1, message)
        msgbox.getCellFormatter().setStyleName(0, 0, 'changes-image')
        msgbox.getCellFormatter().setStyleName(0, 1, 'changes-text')

        button = Button('apply changes')
        button.addClickListener(self.apply_clicked)

        self.changes = VerticalPanel()
        self.changes.setHorizontalAlignment('right')
        self.changes.setVisible(False)
        self.changes.add(msgbox)
        self.changes.add(button)

        panel = VerticalPanel()
        panel.setSpacing(10)
        panel.add(self.table)
        panel.add(self.status)
        panel.add(self.changes)

        return panel
开发者ID:christophgysin,项目名称:schoolbell,代码行数:30,代码来源:alarmwidget.py

示例6: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def __init__(self):
        SimplePanel.__init__(self)

        vPanel = VerticalPanel()
        vPanel.setSpacing(4)

        self._btn = Button("Click Me", getattr(self, "showPopup"))

        vPanel.add(HTML("Click on the button below to display the popup."))
        vPanel.add(self._btn)

        self.add(vPanel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:14,代码来源:popupPanel.py

示例7: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.fPasswordText = PasswordTextBox()
        self.fTextArea = TextArea()
        self.fTextBox = TextBox()

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.add(HTML("Normal text box:"))
        panel.add(self.createTextThing(self.fTextBox))
        panel.add(HTML("Password text box:"))
        panel.add(self.createTextThing(self.fPasswordText))
        panel.add(HTML("Text area:"))
        panel.add(self.createTextThing(self.fTextArea))
        self.initWidget(panel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:17,代码来源:Text.py

示例8: onModuleLoad

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def onModuleLoad(self):

        text = TextBox()
        df1 = DateField()
        df2 = DateField(format='%Y/%m/%d')
        b = Button("Show Calendar", self)
        self.cal = Calendar()

        vp = VerticalPanel()
        vp.setSpacing(10)
        vp.add(df1)
        vp.add(b)
        vp.add(df2)

        RootPanel().add(vp)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:17,代码来源:DateField.py

示例9: showDialog

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def showDialog(self, event):
        contents = VerticalPanel()
        contents.setSpacing(4)
        contents.add(HTML('You can place any contents you like in a dialog box.'))
        contents.add(Button("Close", getattr(self, "onClose")))
        contents.setStyleName("Contents")

        self._dialog = DialogBox()
        self._dialog.setHTML('<b>Welcome to the dialog box</b>')
        self._dialog.setWidget(contents)

        left = (Window.getClientWidth() - 200) / 2
        top = (Window.getClientHeight() - 100) / 2
        self._dialog.setPopupPosition(left, top)
        self._dialog.show()
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:17,代码来源:dialogBox.py

示例10: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def __init__(self):
        Sink.__init__(self)

        self.fDialogButton = Button("Show Dialog", self)
        self.fPopupButton = Button("Show Popup", self)
        
        panel = VerticalPanel()
        panel.add(self.fPopupButton)
        panel.add(self.fDialogButton)
        
        list = ListBox()
        list.setVisibleItemCount(5)
        for i in range(10):
            list.addItem("list item %d" % i)
        panel.add(list)
        
        panel.setSpacing(8)
        self.initWidget(panel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:20,代码来源:Popups.py

示例11: get_upload_panel

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def get_upload_panel(self):
        # Create a FormPanel and point it at a service.
        self.form = FormPanel()
        self.form.setAction("/upload")

        # Add an event handler to the form.
        handler = UploadFormHandler()
        handler.form = self.form
        self.form.addFormHandler(handler)

        # Because we're going to add a FileUpload widget, we'll need to set the
        # form to use the POST method, and multipart MIME encoding.
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.setStyleName("panel") # same name as in OpenPowerSystem.css.
        self.form.setWidget(panel)

        info = HTML(r'Upload CIM RDF/XML instance file.')
        panel.add(info)

        # Create a list box for choice of profile.
        self.profiles = [("UCTE (CIM 14)", "ucte"),
                         ("CPSM (CIM13)", "cpsm"),
                         ("CDPSM (CIM 14)", "cdpsm"),
                         ("Dynamics (CIM 14)", "dynamics")]
        self.profile = ListBox(VisibleItemCount=1)
        self.profile.setName("profileType")
        for n, v in self.profiles:
            self.profile.addItem(n, v)
        panel.add(self.profile)

        # Create a FileUpload widget.
        rdfxml_file = FileUpload()
        rdfxml_file.setName("uploadFormElement")
        panel.add(rdfxml_file)

        # Add a 'submit' button.
        upload = Button("Upload", handler)
        panel.add(upload)

        return self.form
开发者ID:ResearchEngr,项目名称:openpowersystem,代码行数:46,代码来源:OpenPowerSystem.py

示例12: createStatesPanel

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
	def createStatesPanel(self):
		vertPanel=VerticalPanel()
		vertPanel.setSpacing(10)
		
		selectionNames = (["Main Control", "Masks", "Trims"])	
		registerSelection = VerticalPanel()
		
		for name in selectionNames :
			checkBox = CheckBox(name)
			checkBox.setTitle(name)
			self.stateValueEntries[name]=checkBox
			registerSelection.add(checkBox)
		
		#Tidy up 
		loadPanel = HorizontalPanel()
		loadFileTextBox = TextBox()
		loadFileTextBox.setText("MyI2cCfg")
		loadFileTextBox.setWidth(80)
		self.loadFileName = loadFileTextBox
		loadPanel.add(loadFileTextBox)
		self.load = Button("Load",getattr(self,"onChange")) #overrides default and sends it to onChange
		loadPanel.add(self.load)
		self.load.setEnabled(False)
		
		savePanel = HorizontalPanel()
		saveFileTextBox = TextBox()
		saveFileTextBox.setText("MyI2cCfg")
		saveFileTextBox.setWidth(80)
		self.saveFileName = saveFileTextBox
		savePanel.add(saveFileTextBox)
		self.save = Button("Save", getattr(self,"onChange"))
		savePanel.add(self.save)
		self.save.setEnabled(False)
		
		self.returnStatement = Label()
		
		vertPanel.add(registerSelection)
		vertPanel.add(loadPanel)
		vertPanel.add(savePanel)
		vertPanel.add(self.returnStatement)
		
		return vertPanel
开发者ID:BristolHEP-CBC-Testing,项目名称:cbcanalysis,代码行数:44,代码来源:I2CPanel.py

示例13: onModuleLoad

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def onModuleLoad(self):

        text = TextBox()
        df1 = DateField()
        df2 = DateField(format="%Y/%m/%d")
        b = Button("Show Calendar", self)
        self.cal = Calendar()
        df3 = MonthField()

        vp = VerticalPanel()
        vp.setSpacing(10)
        vp.add(df1)
        vp.add(b)
        vp.add(df2)
        vp.add(df3)

        RootPanel().add(vp)

        for obj in [self.cal, df1, df2, df3]:
            obj.addSelectedDateListener(self, dobj=True)
            obj.addSelectedDateListener(getattr(self, "onYMDSelected"))
开发者ID:janjaapbos,项目名称:pyjs,代码行数:23,代码来源:DateField.py

示例14: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def __init__(self):

        Sink.__init__(self)

        disabledButton = Button("Disabled Button")
        disabledCheck = CheckBox("Disabled Check")
        normalButton = Button("Normal Button")
        normalCheck = CheckBox("Normal Check")
        panel = VerticalPanel()
        radio0 = RadioButton("group0", "Choice 0")
        radio1 = RadioButton("group0", "Choice 1")
        radio2 = RadioButton("group0", "Choice 2 (Disabled)")
        radio3 = RadioButton("group0", "Choice 3")

        hp = HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(normalButton)
        hp.add(disabledButton)

        hp = HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(normalCheck)
        hp.add(disabledCheck)

        hp = HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(radio0)
        hp.add(radio1)
        hp.add(radio2)
        hp.add(radio3)

        disabledButton.setEnabled(False)
        disabledCheck.setEnabled(False)
        radio2.setEnabled(False)

        panel.setSpacing(8)
        self.initWidget(panel)
开发者ID:,项目名称:,代码行数:42,代码来源:

示例15: onModuleLoad

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setSpacing [as 别名]
    def onModuleLoad(self):
        self.popupsubtraca = PopupSub(id="sub",datasrc="fsubtracao.pjs")
        self.popupsoma = PopupSoma(id="soma",datasrc="fsoma.pjs")
        self.popupmultescalar = PopupEscalar(id="escalar",datasrc="fmultescalar.pjs")
        self.popupmult = PopupProduto(id="mult",datasrc="fmult.pjs")
        self.popupsoma.iniciado = False;

        tabpanel = TabPanel()
        grid = Grid(4,2)
        imgbtnSoma =  Image("images/Soma_Matriz_sum_matrix.png",StyleName="gwt-ImageButton")
        imgbtnSubtracao =  Image("images/subtracao_Matriz_subtract_matrix.png",StyleName="gwt-ImageButton")
        imgbtnMultiplicacao =  Image("images/multiplicacao_Matriz_product_matrix.png",StyleName="gwt-ImageButton")
        imgbtnMultiplicacaoPorEscalar =  Image("images/multiplicacao_por_escalar.png",StyleName="gwt-ImageButton")
        
        #eventos
        imgbtnSoma.addClickListener(self.onSomaButtonClick)
        imgbtnSubtracao.addClickListener(self.onSubtracaoButtonClick)
        imgbtnMultiplicacao.addClickListener(self.onMultiplicacaoButtonClick)
        imgbtnMultiplicacaoPorEscalar.addClickListener(self.onMulPorEscalarButtonClick)
        
        contents = VerticalPanel()
        contents.setSpacing(4)
        contents.add(HTML('You can place any contents you like in a dialog box.'))
        
        grid.setWidget(0,0,imgbtnSoma)
        grid.setWidget(0,1,imgbtnSubtracao)
        grid.setWidget(2,0,imgbtnMultiplicacao)
        grid.setWidget(2,1,imgbtnMultiplicacaoPorEscalar)
        
        grid.setStyleName(element)
        tabpanel.add(HTML("Modulo de introducao a matrizes"),"<h2>Modulo de introducao a Matrizes</h2>", True)
        tabpanel.add(grid,"<h2>  Matrizes  </h2>", True)
        tabpanel.add(HTML("Modulo de introducao a matrizes"),"<h2>Ajuda para usar a ferramenta</h2>", True)
        tabpanel.setSize("90%"," 70%")
        
        tabpanel.selectTab(1)
        #self.popupsoma.show()
        
        RootPanel("conteudo").add(tabpanel)
开发者ID:nielsonsantana,项目名称:emath,代码行数:41,代码来源:PaginaPrincipal.py


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