Esempio n. 1
0
        except:
            self.layerinfo.setText("No layer selected")

    def getLayerList(self):
        if str(self.layertypeComboBox.currentText()) == 'raster':
            layerlist = getRasterList()
            layer = WStandardItemModel(0, 1, self)
            for i in layerlist:
                addEntry(layer, i)
            self.layerComboBox.setModel(layer)
        if str(self.layertypeComboBox.currentText()) == 'vector':
            layerlist = getVectorList()
            layer = WStandardItemModel(0, 1, self)
            for i in layerlist:
                addEntry(layer, i)
            self.layerComboBox.setModel(layer)

    def connectSignals(self, w):
        w.changed().connect(self.update)
        if isinstance(w, WLineEdit):
            w.enterPressed().connect(self.update)


def createApplication(env):
    return MyApplication(env)


if __name__ == "__main__":
    import WtHttp
    WtHttp.WRun(sys.argv, createApplication)
Esempio n. 2
0
        "<p>Help these people with their decision by dragging one of the pills.</p>",
        Wt.XHTMLText, app.root())

    if not env.javaScript():
        Wt.WText(
            "<i>This examples requires that javascript support is enabled.</i>",
            Wt.XHTMLText, app.root())

    pills = Wt.WContainerWidget(app.root())
    pills.setContentAlignment(Wt.AlignCenter)

    createDragImage("icons/blue-pill.jpg", "icons/blue-pill-small.png",
                    "blue-pill", pills)
    createDragImage("icons/red-pill.jpg", "icons/red-pill-small.png",
                    "red-pill", pills)

    dropSites = Wt.WContainerWidget(app.root())

    Character("Neo", dropSites)
    Character("Morpheus", dropSites)
    Character("Trinity", dropSites)

    app.useStyleSheet(Wt.WLink("dragdrop.css"))

    return app


if __name__ == "__main__":
    import WtHttp
    WtHttp.WRun(sys.argv, createApp)