Esempio n. 1
0
    def __init__(self):
        Sink.__init__(self)
        self.frame = Frame(self.baseURL() + "rembrandt/LaMarcheNocturne.html")

        self.frame.setWidth("100%")
        self.frame.setHeight("48em")
        self.initWidget(self.frame)
Esempio n. 2
0
class Frames(Sink):
    def __init__(self):
        Sink.__init__(self)
        self.frame=Frame(self.baseURL() + "rembrandt/LaMarcheNocturne.html")
        
        self.frame.setWidth("100%")
        self.frame.setHeight("48em")
        self.initWidget(self.frame)
Esempio n. 3
0
class FITSStore(Sink):
    def __init__(self, parent=None):

        Sink.__init__(self, parent)

        self.frame = Frame("/summary", Size=("100%",rccutil.getHeight()))
        self.initWidget(self.frame)
        Window.addWindowResizeListener(self)
        
    def onWindowResized(self, width, height):
        self.frame.setSize("100%", rccutil.getHeight())
        
    def onShow(self):
        pass
Esempio n. 4
0
    def __init__(self, parent=None):

        Sink.__init__(self, parent)

        self.frame = Frame("/summary", Size=("100%",rccutil.getHeight()))
        self.initWidget(self.frame)
        Window.addWindowResizeListener(self)
Esempio n. 5
0
    def __init__(self):
        SimplePanel.__init__(self)

        frame = Frame("http://pyjs.org",
                      Width="100%",
                      Height="200px")
        self.add(frame)
Esempio n. 6
0
    def __init__(self, baseURL):
        DialogBox.__init__(self, glass=True)
        self.setText("Sample DialogBox with embedded Frame")

        iframe = Frame(baseURL + "rembrandt/LaMarcheNocturne.html")
        closeButton = Button("Close", self)
        msg = HTML(
            "<center>This is an example of a standard dialog box component.<br>  You can put pretty much anything you like into it,<br>such as the following IFRAME:</center>",
            True)

        dock = DockPanel()
        dock.setSpacing(4)

        dock.add(closeButton, DockPanel.SOUTH)
        dock.add(msg, DockPanel.NORTH)
        dock.add(iframe, DockPanel.CENTER)

        dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
        dock.setCellWidth(iframe, "100%")
        dock.setWidth("100%")
        iframe.setWidth("36em")
        iframe.setHeight("20em")
        self.setWidget(dock)

        # Work around for IE/MSHTML Issue 511
        self.initURL = iframe.getUrl()
        self.iframe = iframe
Esempio n. 7
0
    def __init__(self, url):
        DialogBox.__init__(self)
        self.setText("Upload Files")
        
        iframe = Frame(url)
        closeButton = Button("Close", self)
        msg = HTML("<center>Upload files, here.  Please avoid spaces in file names.<br />(rename the file before uploading)</center>", True)

        dock = DockPanel()
        dock.setSpacing(4)
        
        dock.add(closeButton, DockPanel.SOUTH)
        dock.add(msg, DockPanel.NORTH)
        dock.add(iframe, DockPanel.CENTER)
        
        dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
        dock.setCellWidth(iframe, "100%")
        dock.setWidth("100%")
        iframe.setWidth("800px")
        iframe.setHeight("600px")
        self.setWidget(dock)
Esempio n. 8
0
 def __init__(self, baseURL):
     DialogBox.__init__(self, glass=True)
     self.setText("Sample DialogBox with embedded Frame")
     
     iframe = Frame(baseURL + "rembrandt/LaMarcheNocturne.html")
     closeButton = Button("Close", self)
     msg = HTML("<center>This is an example of a standard dialog box component.<br>  You can put pretty much anything you like into it,<br>such as the following IFRAME:</center>", True)
     
     dock = DockPanel()
     dock.setSpacing(4)
     
     dock.add(closeButton, DockPanel.SOUTH)
     dock.add(msg, DockPanel.NORTH)
     dock.add(iframe, DockPanel.CENTER)
     
     dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
     dock.setCellWidth(iframe, "100%")
     dock.setWidth("100%")
     iframe.setWidth("36em")
     iframe.setHeight("20em")
     self.setWidget(dock)
Esempio n. 9
0
    def __init__(self, url):
        DialogBox.__init__(self)
        self.setText("Upload Files")

        iframe = Frame(url)
        closeButton = Button("Close", self)
        msg = HTML(
            "<center>Upload files, here.  Please avoid spaces in file names.<br />(rename the file before uploading)</center>",
            True)

        dock = DockPanel()
        dock.setSpacing(4)

        dock.add(closeButton, DockPanel.SOUTH)
        dock.add(msg, DockPanel.NORTH)
        dock.add(iframe, DockPanel.CENTER)

        dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
        dock.setCellWidth(iframe, "100%")
        dock.setWidth("100%")
        iframe.setWidth("800px")
        iframe.setHeight("600px")
        self.setWidget(dock)
Esempio n. 10
0
 def __init__(self, identifier, title, frame_page=""):
     PopupFrame.__init__(self, identifier, title, Frame(frame_page))
Esempio n. 11
0
class FileOpenDlg(DialogBox):

    files = None

    def __init__(self, left=50, top=50, fileLocation=None):
        global has_getAsText
        try:
            DialogBox.__init__(self, modal=False)

            self.setPopupPosition(left, top)
            self.dockPanel = DockPanel()
            self.dockPanel.setSpacing(4)
            self.setText("File Open")

            if not fileLocation is None:
                msg = HTML("Loading file...", True)
                self.dockPanel.add(msg, DockPanel.NORTH)
                location = fileLocation
                if fileLocation.find("://") < 0:
                    base = Window.getLocation().getHref()
                    print base
                    if base.find("/") >= 0:
                        sep = "/"
                    else:
                        sep = "\\"
                    base = sep.join(base.split(sep)[:-1]) + sep
                    location = base + fileLocation
                self.iframe = Frame(location)
                self.dockPanel.add(self.iframe, DockPanel.CENTER)
            else:
                msg = HTML("Choose a file", True)

                self.browseFile = FileUpload()
                elem = self.browseFile.getElement()
                if False and has_getAsText and hasattr(elem, "files"):
                    self.iframe = None
                    self.files = elem.files
                    self.dockPanel.add(self.browseFile, DockPanel.CENTER)
                else:
                    self.browseFile = None
                    self.files = None
                    base = "" + doc().location
                    if base.find("/") >= 0:
                        sep = "/"
                    else:
                        sep = "\\"
                    if not base.lower()[:5] == "file:":
                        base = "file:///C:/"
                        msg = HTML(
                            "You'll have to place the application on a local file system, otherwise the browser forbids access.",
                            True,
                        )
                    else:
                        base = sep.join(base.split(sep)[:-1]) + sep
                    self.iframe = Frame(base)
                    self.dockPanel.add(self.iframe, DockPanel.CENTER)
                self.dockPanel.add(msg, DockPanel.NORTH)

            if self.iframe:
                self.iframe.setWidth("36em")
            hpanel = HorizontalPanel()
            self.openBtn = Button("Open", self)
            hpanel.add(self.openBtn)
            self.cancelBtn = Button("Cancel", self)
            hpanel.add(self.cancelBtn)
            self.dockPanel.add(hpanel, DockPanel.SOUTH)

            self.setWidget(self.dockPanel)
        except:
            raise

    def onClick(self, sender):
        global has_getAsText
        if sender == self.cancelBtn:
            self.hide()
        elif sender == self.openBtn:
            data = None
            filename = None
            if self.files:
                if self.files.length == 0:
                    return
                if self.files.length > 1:
                    alert("Cannot open more than one file")
                    return
                file = self.files.item(0)
                filename = file.fileName
                try:
                    data = file.getAsText("")
                except AttributeError, e:
                    has_getAsText = False
                    alert("Sorry. cannot retrieve file in this browser.\nTry again.")
            else:
                elem = self.iframe.getElement()
                # On firefox, this runs into:
                #   Permission denied to get property Window.document
                # when the file is not in the current domain
                body = elem.contentWindow.document.body
                try:
                    filename = "" + elem.contentWindow.location
                except:
                    filename = None
                if body.childNodes.length == 1:
                    data = "" + body.childNodes.item(0).innerHTML
                else:
                    data = "" + body.innerHTML
            self.hide()
            if data:
                self.mediator.sendNotification(Notification.FILE_LOADED, (filename, data))
    def __init__(self, name, **kwargs):
        div = kwargs.pop('Element', None) or DOM.createDiv()
        DOM.setInnerHTML(div, "<iframe name='" + name + "'>")

        iframe = DOM.getFirstChild(div)
        Frame.__init__(self, None, iframe, **kwargs)
Esempio n. 13
0
    def __init__(self, left=50, top=50, fileLocation=None):
        global has_getAsText
        try:
            DialogBox.__init__(self, modal=False)
            self.filename = None
            self.data = None

            self.setPopupPosition(left, top)
            self.dockPanel = DockPanel()
            self.dockPanel.setSpacing(4)
            self.setText("File Open")

            if not fileLocation is None:
                msg = HTML("Loading file...", True)
                self.dockPanel.add(msg, DockPanel.NORTH)
                location = fileLocation
                if fileLocation.find("://") < 0:
                    base = Window.getLocation().getHref()
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    base = sep.join(base.split(sep)[:-1]) + sep
                    location = base + fileLocation
                self.iframe = Frame(location)
                self.dockPanel.add(self.iframe, DockPanel.CENTER)
            else:
                msg = HTML("Choose a file", True)

                self.browseFile = FileUpload()
                elem = self.browseFile.getElement()
                if False and has_getAsText and hasattr(elem, 'files'):
                    self.iframe = None
                    self.files = elem.files
                    self.dockPanel.add(self.browseFile, DockPanel.CENTER)
                else:
                    self.browseFile = None
                    self.files = None
                    base = '' + doc().location
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    if not base.lower()[:5] == "file:":
                        base = "file:///C:/"
                        msg = HTML(
                            "You'll have to place the application on a local file system, otherwise the browser forbids access.",
                            True)
                    else:
                        base = sep.join(base.split(sep)[:-1]) + sep
                    self.iframe = Frame(base)
                    self.dockPanel.add(self.iframe, DockPanel.CENTER)
                self.dockPanel.add(msg, DockPanel.NORTH)

            if self.iframe:
                self.iframe.setWidth("36em")
            hpanel = HorizontalPanel()
            self.openBtn = Button("Open", self.onClickOpen)
            hpanel.add(self.openBtn)
            self.cancelBtn = Button("Cancel", self.onClickCancel)
            hpanel.add(self.cancelBtn)
            self.dockPanel.add(hpanel, DockPanel.SOUTH)

            self.setWidget(self.dockPanel)
        except:
            raise
Esempio n. 14
0
class FileOpenDlg(DialogBox):

    files = None

    def __init__(self, left=50, top=50, fileLocation=None):
        global has_getAsText
        try:
            DialogBox.__init__(self, modal=False)
            self.filename = None
            self.data = None

            self.setPopupPosition(left, top)
            self.dockPanel = DockPanel()
            self.dockPanel.setSpacing(4)
            self.setText("File Open")

            if not fileLocation is None:
                msg = HTML("Loading file...", True)
                self.dockPanel.add(msg, DockPanel.NORTH)
                location = fileLocation
                if fileLocation.find("://") < 0:
                    base = Window.getLocation().getHref()
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    base = sep.join(base.split(sep)[:-1]) + sep
                    location = base + fileLocation
                self.iframe = Frame(location)
                self.dockPanel.add(self.iframe, DockPanel.CENTER)
            else:
                msg = HTML("Choose a file", True)

                self.browseFile = FileUpload()
                elem = self.browseFile.getElement()
                if False and has_getAsText and hasattr(elem, 'files'):
                    self.iframe = None
                    self.files = elem.files
                    self.dockPanel.add(self.browseFile, DockPanel.CENTER)
                else:
                    self.browseFile = None
                    self.files = None
                    base = '' + doc().location
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    if not base.lower()[:5] == "file:":
                        base = "file:///C:/"
                        msg = HTML(
                            "You'll have to place the application on a local file system, otherwise the browser forbids access.",
                            True)
                    else:
                        base = sep.join(base.split(sep)[:-1]) + sep
                    self.iframe = Frame(base)
                    self.dockPanel.add(self.iframe, DockPanel.CENTER)
                self.dockPanel.add(msg, DockPanel.NORTH)

            if self.iframe:
                self.iframe.setWidth("36em")
            hpanel = HorizontalPanel()
            self.openBtn = Button("Open", self.onClickOpen)
            hpanel.add(self.openBtn)
            self.cancelBtn = Button("Cancel", self.onClickCancel)
            hpanel.add(self.cancelBtn)
            self.dockPanel.add(hpanel, DockPanel.SOUTH)

            self.setWidget(self.dockPanel)
        except:
            raise

    def onClickCancel(self, sender):
        self.hide()

    def onClickOpen(self, sender):
        global has_getAsText
        data = None
        filename = None
        if self.files:
            if self.files.length == 0:
                return
            if self.files.length > 1:
                alert("Cannot open more than one file")
                return
            file = self.files.item(0)
            filename = file.fileName
            try:
                data = file.getAsText("")
            except AttributeError, e:
                has_getAsText = False
                alert(
                    "Sorry. cannot retrieve file in this browser.\nTry again.")
        else:
Esempio n. 15
0
    def __init__(self):
        SimplePanel.__init__(self)

        frame = Frame("http://google.com", Width="100%", Height="200px")
        self.add(frame)
Esempio n. 16
0
class FileOpenDlg(DialogBox):

    files = None

    def __init__(self, left = 50, top = 50, fileLocation = None):
        global has_getAsText
        try:
            DialogBox.__init__(self, modal = False)
            self.filename = None
            self.data = None

            self.setPopupPosition(left, top)
            self.dockPanel = DockPanel()
            self.dockPanel.setSpacing(4)
            self.setText("File Open")

            if not fileLocation is None:
                msg = HTML("Loading file...", True)
                self.dockPanel.add(msg, DockPanel.NORTH)
                location =  fileLocation
                if fileLocation.find("://") < 0:
                    base = Window.getLocation().getHref()
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    base = sep.join(base.split(sep)[:-1]) + sep
                    location = base + fileLocation
                self.iframe = Frame(location)
                self.dockPanel.add(self.iframe, DockPanel.CENTER)
            else:
                msg = HTML("Choose a file", True)

                self.browseFile = FileUpload()
                elem = self.browseFile.getElement()
                if False and has_getAsText and hasattr(elem, 'files'):
                    self.iframe = None
                    self.files = elem.files
                    self.dockPanel.add(self.browseFile, DockPanel.CENTER)
                else:
                    self.browseFile = None
                    self.files = None
                    base = '' + doc().location
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    if not base.lower()[:5] == "file:":
                        base = "file:///C:/"
                        msg = HTML("You'll have to place the application on a local file system, otherwise the browser forbids access.", True)
                    else:
                        base = sep.join(base.split(sep)[:-1]) + sep
                    self.iframe = Frame(base)
                    self.dockPanel.add(self.iframe, DockPanel.CENTER)
                self.dockPanel.add(msg, DockPanel.NORTH)

            if self.iframe:
                self.iframe.setWidth("36em")
            hpanel = HorizontalPanel()
            self.openBtn = Button("Open", self.onClickOpen)
            hpanel.add(self.openBtn)
            self.cancelBtn = Button("Cancel", self.onClickCancel)
            hpanel.add(self.cancelBtn)
            self.dockPanel.add(hpanel, DockPanel.SOUTH)

            self.setWidget(self.dockPanel)
        except:
            raise

    def onClickCancel(self, sender):
        self.hide()

    def onClickOpen(self, sender):
        global has_getAsText
        data = None
        filename = None
        if self.files:
            if self.files.length == 0:
                return
            if self.files.length > 1:
                alert("Cannot open more than one file")
                return
            file = self.files.item(0)
            filename = file.fileName
            try:
                data = file.getAsText("")
            except AttributeError, e:
                has_getAsText = False
                alert("Sorry. cannot retrieve file in this browser.\nTry again.")
        else:
Esempio n. 17
0
    def __init__(self, left = 50, top = 50, fileLocation = None):
        global has_getAsText
        try:
            DialogBox.__init__(self, modal = False)
            self.filename = None
            self.data = None

            self.setPopupPosition(left, top)
            self.dockPanel = DockPanel()
            self.dockPanel.setSpacing(4)
            self.setText("File Open")

            if not fileLocation is None:
                msg = HTML("Loading file...", True)
                self.dockPanel.add(msg, DockPanel.NORTH)
                location =  fileLocation
                if fileLocation.find("://") < 0:
                    base = Window.getLocation().getHref()
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    base = sep.join(base.split(sep)[:-1]) + sep
                    location = base + fileLocation
                self.iframe = Frame(location)
                self.dockPanel.add(self.iframe, DockPanel.CENTER)
            else:
                msg = HTML("Choose a file", True)

                self.browseFile = FileUpload()
                elem = self.browseFile.getElement()
                if False and has_getAsText and hasattr(elem, 'files'):
                    self.iframe = None
                    self.files = elem.files
                    self.dockPanel.add(self.browseFile, DockPanel.CENTER)
                else:
                    self.browseFile = None
                    self.files = None
                    base = '' + doc().location
                    if base.find('/') >= 0:
                        sep = '/'
                    else:
                        sep = '\\'
                    if not base.lower()[:5] == "file:":
                        base = "file:///C:/"
                        msg = HTML("You'll have to place the application on a local file system, otherwise the browser forbids access.", True)
                    else:
                        base = sep.join(base.split(sep)[:-1]) + sep
                    self.iframe = Frame(base)
                    self.dockPanel.add(self.iframe, DockPanel.CENTER)
                self.dockPanel.add(msg, DockPanel.NORTH)

            if self.iframe:
                self.iframe.setWidth("36em")
            hpanel = HorizontalPanel()
            self.openBtn = Button("Open", self.onClickOpen)
            hpanel.add(self.openBtn)
            self.cancelBtn = Button("Cancel", self.onClickCancel)
            hpanel.add(self.cancelBtn)
            self.dockPanel.add(hpanel, DockPanel.SOUTH)

            self.setWidget(self.dockPanel)
        except:
            raise
 def _getProps(self):
     return Frame._getProps() + self._props