def createKeyRegisterClickableLayout(self): # Create a vertical layout with click events layout = VerticalLayout() layout.setWidth('90%') layout.setSpacing(True) layout.addStyleName('border') layout.setMargin(True) # Add some components inside the layout layout.addComponent(Label('<b>Layout click events register if ' 'control keys are pressed during the click and double ' 'clicks. Try clicking anywhere inside this layout while ' 'holding CTRL, ALT, SHIFT or META key down.</b>', Label.CONTENT_RAW)) # Listen for layout click events layout.addListener(VerticalListener(self), ILayoutClickListener) return layout
def createVerticalClickableLayout(self): # Create a vertical layout with click events layout = VerticalLayout() layout.setWidth('90%') layout.setSpacing(True) layout.addStyleName('border') layout.setMargin(True) # Add some components inside the layout layout.addComponent( Label( '<b>This is a vertical layout with a ' 'click listener attached. Try clicking anywhere inside ' 'this layout.</b>', Label.CONTENT_RAW)) clickX = Label('X-coordinate: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickX) clickY = Label('Y-coordinate: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickY) clickRelativeX = Label( 'X-coordinate relative to the layout: ' '<i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickRelativeX) clickRelativeY = Label( 'Y-coordinate relative to the layout: ' '<i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickRelativeY) button = Label('Mouse button: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(button) # Listen for layout click events layout.addListener( LayoutListener(self, button, clickX, clickY, clickRelativeX, clickRelativeY), ILayoutClickListener) return layout
def createKeyRegisterClickableLayout(self): # Create a vertical layout with click events layout = VerticalLayout() layout.setWidth('90%') layout.setSpacing(True) layout.addStyleName('border') layout.setMargin(True) # Add some components inside the layout layout.addComponent( Label( '<b>Layout click events register if ' 'control keys are pressed during the click and double ' 'clicks. Try clicking anywhere inside this layout while ' 'holding CTRL, ALT, SHIFT or META key down.</b>', Label.CONTENT_RAW)) # Listen for layout click events layout.addListener(VerticalListener(self), ILayoutClickListener) return layout
def createVerticalClickableLayout(self): # Create a vertical layout with click events layout = VerticalLayout() layout.setWidth('90%') layout.setSpacing(True) layout.addStyleName('border') layout.setMargin(True) # Add some components inside the layout layout.addComponent(Label('<b>This is a vertical layout with a ' 'click listener attached. Try clicking anywhere inside ' 'this layout.</b>', Label.CONTENT_RAW)) clickX = Label('X-coordinate: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickX) clickY = Label('Y-coordinate: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickY) clickRelativeX = Label('X-coordinate relative to the layout: ' '<i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickRelativeX) clickRelativeY = Label('Y-coordinate relative to the layout: ' '<i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(clickRelativeY) button = Label('Mouse button: <i>Not available.</i>', Label.CONTENT_RAW) layout.addComponent(button) # Listen for layout click events layout.addListener(LayoutListener(self, button, clickX, clickY, clickRelativeX, clickRelativeY), ILayoutClickListener) return layout