コード例 #1
0
ファイル: art.py プロジェクト: liranal/wxnodebox
    def getsmBitmap(self, artid, client, size):
        global ImageData

        imageData = ImageData
        if not self.bitmaps.has_key(artid):
            if not imageData.has_key(artid): return None

            stream = cStringIO.StringIO(ImageData[artid])
            img = wxImageFromStream(stream)
            self.bitmaps[artid] = wxBitmapFromImage(img)
            stream.close()

        return self.bitmaps[artid]
コード例 #2
0
ファイル: art.py プロジェクト: liranal/wxnodebox
    def getsmBitmap(self, artid, client, size):
        global ImageData

        imageData = ImageData
        if not self.bitmaps.has_key(artid):
            if not imageData.has_key(artid): return None

            stream = cStringIO.StringIO(ImageData[artid])
            img = wxImageFromStream(stream)
            self.bitmaps[artid] = wxBitmapFromImage(img)
            stream.close()

        return self.bitmaps[artid]
コード例 #3
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getCollectionEditorBitmap():
    return wxBitmapFromImage(getCollectionEditorImage())
コード例 #4
0
def getToolBitmap():
    return wxBitmapFromImage(getToolImage())
コード例 #5
0
def getSaveBitmap():
    return wxBitmapFromImage(getSaveImage())
コード例 #6
0
def getNewBitmap():
    return wxBitmapFromImage(getNewImage())
コード例 #7
0
ファイル: images.py プロジェクト: larygwil/glGo
def getSmilesBitmap():
    return wxBitmapFromImage(getSmilesImage())
コード例 #8
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getPublishBitmap():
    return wxBitmapFromImage(getPublishImage())
コード例 #9
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getHelpBitmap():
    return wxBitmapFromImage(getHelpImage())
コード例 #10
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getOutputErrorBitmap():
    return wxBitmapFromImage(getOutputErrorImage())
コード例 #11
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getClassBrowserBitmap():
    return wxBitmapFromImage(getClassBrowserImage())
コード例 #12
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getEditorBitmap():
    return wxBitmapFromImage(getEditorImage())
コード例 #13
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getInspectorBitmap():
    return wxBitmapFromImage(getInspectorImage())
コード例 #14
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getDesignerBitmap():
    return wxBitmapFromImage(getDesignerImage())
コード例 #15
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getBoldBitmap():
    return wxBitmapFromImage(getBoldImage())
コード例 #16
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getPreBitmap():
    return wxBitmapFromImage(getPreImage())
コード例 #17
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getShellBitmap():
    return wxBitmapFromImage(getShellImage())
コード例 #18
0
ファイル: images.py プロジェクト: RupertTheSlim/Programming
def getPyCrustBitmap():
    return wxBitmapFromImage(getPyCrustImage())
コード例 #19
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getExplorerBitmap():
    return wxBitmapFromImage(getExplorerImage())
コード例 #20
0
def getHVSplitBitmap():
    return wxBitmapFromImage(getHVSplitImage())
コード例 #21
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getZopeBitmap():
    return wxBitmapFromImage(getZopeImage())
コード例 #22
0
def getCopyBitmap():
    return wxBitmapFromImage(getCopyImage())
コード例 #23
0
ファイル: viewers.py プロジェクト: liranal/wxnodebox
def OpenFile(parent, path):
    #FIXME: support: svg, sgvz, svg.gz with rsvg or batik (render to temporary
    #file /tmp/<PID><time()><atime(f.svg>.png and then open a frame)

    if not os.path.exists(path) or os.path.isdir(path): return
    frame = wxFrame(parent, -1, "File view: " + path, wxDefaultPosition, wxSize(500, 400))

    handled = 0
    needFrame = 1
    lowerPath = string.lower(path)
    #for animations or to see if count is > 0:
    #wxImage_GetImageCount(path)
    if lowerPath[-3:] in ("ani", "bmp", "cur", "gif", "ico", "iff", "jpg", "pcx", "png", "pnm", \
                          "tif", "xpm") or lowerPath[-4:] in ("jpeg", "tiff"):
        #f = open(path, "rb"); data = f.read(); f.close()
        #stream = StringIO(data)
        #img = wxImageFromStream(stream)
        img = wxEmptyImage()
        img.LoadFile(path)
        bmp = wxBitmapFromImage(img)
        #wxStaticBitmap(frame, -1, bmp) #, (15, 45))

        width, height = img.GetWidth(), img.GetHeight()
        if width and height:
            sw = wxScrolledWindow(frame, -1, wxDefaultPosition, wxDefaultSize,
                                  wxHSCROLL | wxVSCROLL)
            #sw.SetScrollbars(20, 20, img.GetWidth()/20, img.GetHeight()/20)
            sw.SetVirtualSize(wxSize(width, height))
            sw.SetScrollRate(20, 20)
            wxStaticBitmap(sw, -1, bmp) #, (15, 45))
            w, h = 800, 600 #frame.GetSize()
            w, h = min(w, width), min(h, height)
            minSize, b = 100, 10
            if w < minSize: w = minSize
            if h < minSize: h = minSize
            frame.SetSize(wxSize(w+b, h+b))
            handled = 1
    elif "html" == lowerPath[-4:] or "htm" == path[-3:]:
        htmlWin = wxHtmlWindow(frame)
        htmlWin.LoadPage(path)
        handled = 1
    elif "pdf" == lowerPath[-3:]:
        for cmd in ("xpdf", "acroread"):
            #FIXME: handle names that contain spaces etc.
            status, output = commands.getstatusoutput(cmd + " " + path)
            if 0 == status:
                handled = 1
                needFrame = 0
                break
    #FIXME: mplayer cannot run in background; same goes for Python calling mplayer externally - probably stdin dependence
    elif "mpeg" == lowerPath[-4:] or \
         lowerPath[-3:] in ("asf", "avi", "mov", "mpa", "mpg", "wmv"):
        for cmd in ("mplayer -quiet",):
            #FIXME: handle names that contain spaces etc.
            status, output = commands.getstatusoutput(cmd + " " + path)
            if 0 == status:
                handled = 1
                needFrame = 0
                break

    elif "ps" == lowerPath[-2:] or "ps.gz" == lowerPath[-5:]:
        pid = os.fork()
        if 0 == pid:
            for cmd in ("ggv", "gv"):
                try:
                    os.execlp(cmd, cmd, path)
                except OSError:
                    pass
            os.exit(1)
        handled = 1
        needFrame = 0

    if not handled:
        minSize = 65536
        try:
            f = open(path, "rb"); data = f.read(minSize); f.close()
        except IOError, ex:
            MsgOS(ex)
            return None
        txt = wxTextCtrl(frame, -1, data,
                         style=wxTE_READONLY|wxTE_MULTILINE|wxTE_DONTWRAP|wxHSCROLL)
        if len(data) == minSize:
            sizer = wxBoxSizer(wxVERTICAL)
            frame.SetAutoLayout(true)
            frame.SetSizer(sizer)
            frame.sizer = sizer
            b = wxButton(frame, -1, "Show entire file")
            sizer.Add(txt, 1, wxEXPAND|wxALL, 0)
            sizer.Add(b, 0, wxALIGN_CENTRE, 0)
            sizer.Layout()
コード例 #24
0
def getItalicBitmap():
    return wxBitmapFromImage(getItalicImage())
コード例 #25
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getBoaButtonBitmap():
    return wxBitmapFromImage(getBoaButtonImage())
コード例 #26
0
def getPenBitmap():
    return wxBitmapFromImage(getPenImage())
コード例 #27
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getDebuggerBitmap():
    return wxBitmapFromImage(getDebuggerImage())
コード例 #28
0
ファイル: run.py プロジェクト: linuxlizard/pytools
def getBitmap():
    return wxBitmapFromImage(getImage())
コード例 #29
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getCollectionEditorBitmap():
    return wxBitmapFromImage(getCollectionEditorImage())
コード例 #30
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getSaveBitmap():
    return wxBitmapFromImage(getSaveImage())
コード例 #31
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getDesignerBitmap():
    return wxBitmapFromImage(getDesignerImage())
コード例 #32
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getItalicBitmap():
    return wxBitmapFromImage(getItalicImage())
コード例 #33
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getInspectorBitmap():
    return wxBitmapFromImage(getInspectorImage())
コード例 #34
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getToolBitmap():
    return wxBitmapFromImage(getToolImage())
コード例 #35
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getEditorBitmap():
    return wxBitmapFromImage(getEditorImage())
コード例 #36
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getPenBitmap():
    return wxBitmapFromImage(getPenImage())
コード例 #37
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getClassBrowserBitmap():
    return wxBitmapFromImage(getClassBrowserImage())
コード例 #38
0
ファイル: images.py プロジェクト: larygwil/glGo
def getMondrianBitmap():
    return wxBitmapFromImage(getMondrianImage())
コード例 #39
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getOutputErrorBitmap():
    return wxBitmapFromImage(getOutputErrorImage())
コード例 #40
0
ファイル: images.py プロジェクト: larygwil/glGo
def getBozoBitmap():
    return wxBitmapFromImage(getBozoImage())
コード例 #41
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getHelpBitmap():
    return wxBitmapFromImage(getHelpImage())
コード例 #42
0
def getLinkBitmap():
    return wxBitmapFromImage(getLinkImage())
コード例 #43
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getShellBitmap():
    return wxBitmapFromImage(getShellImage())
コード例 #44
0
def getPasteBitmap():
    return wxBitmapFromImage(getPasteImage())
コード例 #45
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getExplorerBitmap():
    return wxBitmapFromImage(getExplorerImage())
コード例 #46
0
def getUndoBitmap():
    return wxBitmapFromImage(getUndoImage())
コード例 #47
0
ファイル: Boa_img.py プロジェクト: cbaeseman/boa-constructor
def getZopeBitmap():
    return wxBitmapFromImage(getZopeImage())
コード例 #48
0
def getBoldBitmap():
    return wxBitmapFromImage(getBoldImage())
コード例 #49
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getLinkBitmap():
    return wxBitmapFromImage(getLinkImage())
コード例 #50
0
def getPreBitmap():
    return wxBitmapFromImage(getPreImage())
コード例 #51
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getNewBitmap():
    return wxBitmapFromImage(getNewImage())
コード例 #52
0
def getPublishBitmap():
    return wxBitmapFromImage(getPublishImage())
コード例 #53
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getPasteBitmap():
    return wxBitmapFromImage(getPasteImage())
コード例 #54
0
ファイル: viewers.py プロジェクト: liranal/wxnodebox
def OpenFile(parent, path):
    #FIXME: support: svg, sgvz, svg.gz with rsvg or batik (render to temporary
    #file /tmp/<PID><time()><atime(f.svg>.png and then open a frame)

    if not os.path.exists(path) or os.path.isdir(path): return
    frame = wxFrame(parent, -1, "File view: " + path, wxDefaultPosition,
                    wxSize(500, 400))

    handled = 0
    needFrame = 1
    lowerPath = string.lower(path)
    #for animations or to see if count is > 0:
    #wxImage_GetImageCount(path)
    if lowerPath[-3:] in ("ani", "bmp", "cur", "gif", "ico", "iff", "jpg", "pcx", "png", "pnm", \
                          "tif", "xpm") or lowerPath[-4:] in ("jpeg", "tiff"):
        #f = open(path, "rb"); data = f.read(); f.close()
        #stream = StringIO(data)
        #img = wxImageFromStream(stream)
        img = wxEmptyImage()
        img.LoadFile(path)
        bmp = wxBitmapFromImage(img)
        #wxStaticBitmap(frame, -1, bmp) #, (15, 45))

        width, height = img.GetWidth(), img.GetHeight()
        if width and height:
            sw = wxScrolledWindow(frame, -1, wxDefaultPosition, wxDefaultSize,
                                  wxHSCROLL | wxVSCROLL)
            #sw.SetScrollbars(20, 20, img.GetWidth()/20, img.GetHeight()/20)
            sw.SetVirtualSize(wxSize(width, height))
            sw.SetScrollRate(20, 20)
            wxStaticBitmap(sw, -1, bmp)  #, (15, 45))
            w, h = 800, 600  #frame.GetSize()
            w, h = min(w, width), min(h, height)
            minSize, b = 100, 10
            if w < minSize: w = minSize
            if h < minSize: h = minSize
            frame.SetSize(wxSize(w + b, h + b))
            handled = 1
    elif "html" == lowerPath[-4:] or "htm" == path[-3:]:
        htmlWin = wxHtmlWindow(frame)
        htmlWin.LoadPage(path)
        handled = 1
    elif "pdf" == lowerPath[-3:]:
        for cmd in ("xpdf", "acroread"):
            #FIXME: handle names that contain spaces etc.
            status, output = commands.getstatusoutput(cmd + " " + path)
            if 0 == status:
                handled = 1
                needFrame = 0
                break
    #FIXME: mplayer cannot run in background; same goes for Python calling mplayer externally - probably stdin dependence
    elif "mpeg" == lowerPath[-4:] or \
         lowerPath[-3:] in ("asf", "avi", "mov", "mpa", "mpg", "wmv"):
        for cmd in ("mplayer -quiet", ):
            #FIXME: handle names that contain spaces etc.
            status, output = commands.getstatusoutput(cmd + " " + path)
            if 0 == status:
                handled = 1
                needFrame = 0
                break

    elif "ps" == lowerPath[-2:] or "ps.gz" == lowerPath[-5:]:
        pid = os.fork()
        if 0 == pid:
            for cmd in ("ggv", "gv"):
                try:
                    os.execlp(cmd, cmd, path)
                except OSError:
                    pass
            os.exit(1)
        handled = 1
        needFrame = 0

    if not handled:
        minSize = 65536
        try:
            f = open(path, "rb")
            data = f.read(minSize)
            f.close()
        except IOError, ex:
            MsgOS(ex)
            return None
        txt = wxTextCtrl(frame,
                         -1,
                         data,
                         style=wxTE_READONLY | wxTE_MULTILINE | wxTE_DONTWRAP
                         | wxHSCROLL)
        if len(data) == minSize:
            sizer = wxBoxSizer(wxVERTICAL)
            frame.SetAutoLayout(true)
            frame.SetSizer(sizer)
            frame.sizer = sizer
            b = wxButton(frame, -1, "Show entire file")
            sizer.Add(txt, 1, wxEXPAND | wxALL, 0)
            sizer.Add(b, 0, wxALIGN_CENTRE, 0)
            sizer.Layout()
コード例 #55
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getCopyBitmap():
    return wxBitmapFromImage(getCopyImage())
コード例 #56
0
ファイル: image.py プロジェクト: likwoka/old_py_stuffs
def getBitmap():
    return wxBitmapFromImage(getImage())
コード例 #57
0
ファイル: images.py プロジェクト: Distrotech/docutils
def getUndoBitmap():
    return wxBitmapFromImage(getUndoImage())
コード例 #58
0
ファイル: panelicons.py プロジェクト: behnam/cgkit
def getHVSplitBitmap():
    return wxBitmapFromImage(getHVSplitImage())
コード例 #59
0
ファイル: Boa_img.py プロジェクト: aricsanders/boa
def getDebuggerBitmap():
    return wxBitmapFromImage(getDebuggerImage())