<Id data="Python"/> <Description data="Basic flowcharting card shape"/> <Version data="0.1"/> <Web data="www.thekompany.com"/> <Email data="dima@kde.org"/> <AutoUpdate data="off"/> </KivioPyStencilSpawnerInfo> <init code="Python"> <![CDATA[ # defined variables : x, y, w, h, x2=x+w, y2=y+h x=70 y=40 w=100 h=100 x2=x+w y2=y+w style = { "color" : "blue", "bgcolor" : "white", "linewidth" : 1, } connections = [] connector_targets = [ { "x":x+2, "y":y-2 }, { "x":x+2, "y":y2-2 }, { "x":x2-2, "y":y+2 }, { "x":x2-2, "y":y2-2 }, { "x": x+w/2, "y":y } ] shapes = { "rect" :{ "type" : "Rectangle", "fillstyle" : "solid", "x" : x+2, "y" : y+2, "w" : w-4, "h" : w-4 }, "rect2" :{ "type" : "Rectangle", "color" : [250,40,40], "bgcolor" : "darkgreen", "selected" : { "bgcolor" : "blue", "fillstyle":"solid" }, "fillstyle" : "solid", "x" : x+w-35, "y" : y+h-35, "w" : 20, "h" : 20 }, "rect3" :{ "type" : "Ellipse", "color" : [250,40,40], "selected" : { "color":[40,200,40] }, "x" : x+15, "y" : y+15, "w" : 20, "h" : 20, "rx": 15, "ry": 15 }, "text" : { "type" : "TextBox", "x" : x+5, "y" : y+5, "w" : w-10, "h" : h-10, "text" : "2" } } ]]> </init> <resize> <![CDATA[ # as default all coords are scalled, and this code will be runned # defined variables : x, y, w, h, x2=x+w, y2=y+h and all variables , defined in <init> connector_targets = [ { "x":x+2, "y":y-2 }, { "x":x+2, "y":y2-2 }, { "x":x2-2, "y":y+2 }, { "x":x2-2, "y":y2-2 }, { "x":(x+x2)/2, "y":y } ] shapes["rect2"]["x"] = x+w-35 shapes["rect2"]["y"] = y+h-35 shapes["rect2"]["w"] = 20 shapes["rect2"]["h"] = 20 if ( shapes["text"]["text"] == "1" ): stencil = curLayer().firstStencil() stencil.setText( "x:"+str(x)+" y:"+str(y) ) ]]> </resize> </KivioPyStencil>