Exemple #1
0
 def edit_style(self, member, style):
     self.current_member = member
     style = str(style)
     tc = vcs.createtextcombined(Tt_source=style, To_source=style)
     self.style_editor.setTextObject(tc)
     self.style_editor.show()
     self.style_editor.raise_()
Exemple #2
0
def inside_label(label, t, x, y, screen_width, screen_height):
    tt = label.texttable
    to = label.textorientation

    tc = vcs.createtextcombined(Tt_source=tt, To_source=to)
    tc.string = [t]
    tc.x = [label.x]
    tc.y = [label.y]

    return text.inside_text(tc, x, y, screen_width, screen_height) is not None
Exemple #3
0
def inside_label(label, t, x, y, screen_width, screen_height):
    tt = label.texttable
    to = label.textorientation

    tc = vcs.createtextcombined(Tt_source=tt, To_source=to)
    tc.string = [t]
    tc.x = [label.x]
    tc.y = [label.y]

    return text.inside_text(tc, x, y, screen_width, screen_height) is not None
Exemple #4
0
    def get_el(self, name):
        tt = vcs.gettexttable(name)
        to = vcs.gettextorientation(name)

        for tc in vcs.listelements("textcombined"):
            tc = vcs.gettextcombined(tc)
            if tc.To_name == name and tc.Tt_name == name:
                return tc
        tc = vcs.createtextcombined()
        tc.Tt = tt
        tc.To = to
        return tc
Exemple #5
0
    def get_el(self, name):
        tt = vcs.gettexttable(name)
        to = vcs.gettextorientation(name)

        for tc in vcs.listelements("textcombined"):
            tc = vcs.gettextcombined(tc)
            if tc.To_name == name and tc.Tt_name == name:
                return tc
        tc = vcs.createtextcombined()
        tc.Tt = tt
        tc.To = to
        return tc
Exemple #6
0
    def testVCSreset1only(self):
        for gtype in vcs.listelements():
            b0 = vcs.listelements(gtype)
            if gtype == 'colormap':
                b = vcs.createcolormap()
                xtra = vcs.createisofill()
                untouched = vcs.listelements("isofill")
            elif gtype == "template":
                b = vcs.createtemplate()
            elif gtype == "textcombined":
                b = vcs.createtextcombined()
            elif gtype == "textorientation":
                b = vcs.createtextorientation()
            elif gtype == "texttable":
                b = vcs.createtexttable()
            elif gtype == "fillarea":
                b = vcs.createfillarea()
            elif gtype == "projection":
                b = vcs.createprojection()
            elif gtype == "marker":
                b = vcs.createmarker()
            elif gtype == "line":
                b = vcs.createline()
            elif gtype in ["display", "font", "fontNumber", "list", "format"]:
                vcs.manageElements.reset()
                continue
            else:
                b = vcs.creategraphicsmethod(gtype)
            if gtype != "colormap":
                xtra = vcs.createcolormap()
                untouched = vcs.listelements("colormap")
            b1 = vcs.listelements(gtype)
            self.assertNotEqual(b0, b1)
            vcs.manageElements.reset(gtype)
            b2 = vcs.listelements(gtype)
            self.assertEqual(b0, b2)
            if gtype == "colormap":
                self.assertEqual(untouched, vcs.listelements("isofill"))
            else:
                self.assertEqual(untouched, vcs.listelements("colormap"))
            vcs.manageElements.reset()
            if gtype == "colormap":
                self.assertNotEqual(untouched, vcs.listelements("isofill"))
            else:
                self.assertNotEqual(untouched, vcs.listelements("colormap"))

        # case for 1d weirdness
        sc = vcs.createscatter()
        vcs.manageElements.reset()