Commits

Hiroki MIZUNO committed a2d53d8

support rackdiag

Comments (0)

Files changed (1)

blockdiagcontrib_excelshape/excelshape.py

     MSO_SHAPE_ARC      = 25
     MSO_LINE_DASH      = 4
     XL_CENTER = -4108
+    XL_RIGHT  = -4152
 
     def __init__(self, filename, **kwargs):
         self.excel         = win32com.client.Dispatch("Excel.Application") 
         chars.Font.Size = font.size
         if kwargs.get('halign') == 'center':
             shape.TextFrame.HorizontalAlignment = self.XL_CENTER
+        elif kwargs.get('halign') == 'right':
+            shape.TextFrame.HorizontalAlignment = self.XL_RIGHT
         shape.TextFrame.VerticalAlignment = self.XL_CENTER
 
     def line(self, xy, **kwargs):
         h = self.height(xy)
         pt = XY(xy[0], xy[1])
 
-        shape = self.book.ActiveSheet.Shapes.AddShape(MSO_SHAPE_OVAL, pt.x, pt.y, w, h)
+        shape = self.book.ActiveSheet.Shapes.AddShape(self.MSO_SHAPE_OVAL, pt.x, pt.y, w, h)
         self.set_style(shape, kwargs)
 
     def polygon(self, xy, **kwargs):