Writer add shapes. Change zoom
This commit is contained in:
parent
f597411d3e
commit
9b7fe665cc
|
@ -1,3 +1,7 @@
|
|||
v 0.19.0 [25-sep-2021]
|
||||
- Writer. Insert shapes. Set zoom.
|
||||
|
||||
|
||||
v 0.18.0 [29-aug-2021]
|
||||
- Writer. Move cursor: start, end, left, right
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ SWIFT / BIC: TRWIBEB1XXX
|
|||
```
|
||||
|
||||
* BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d`
|
||||
* FairCoin: `fJ7emvtyGfvcMuxk1nHSnS7gmeScdcZXL5`
|
||||
* Monero: `43H43TpQKYdYcw2ZCnn2nbjDh3imNQg8RGYS4oP4p7Z8aeBHg6VpeaFfBoMzDTUUDdQBiGkiQUSydJB96m6MqiEuEeyoopQ`
|
||||
|
||||
* ETH: `0x61a4f614a30ff686445751ed8328b82b77ecfc69`
|
||||
* XRP: `rLSn6Z3T8uCxbcd1oxwfGQN1Fdn5CyGujK` Tag: `6643162`
|
||||
|
|
|
@ -3398,6 +3398,15 @@ class LOWriterTextRange(object):
|
|||
table = LOWriterTextTable(self._doc.tables[name], self._doc)
|
||||
return table
|
||||
|
||||
def insert_shape(self, tipo, args={}):
|
||||
# ~ args['Width'] = args.get('Width', 1000)
|
||||
# ~ args['Height'] = args.get('Height', 1000)
|
||||
# ~ args['X'] = args.get('X', 0)
|
||||
# ~ args['Y'] = args.get('Y', 0)
|
||||
shape = self._doc.dp.add(tipo, args)
|
||||
# ~ shape.anchor = self.obj
|
||||
return shape
|
||||
|
||||
def insert_image(self, path, args={}):
|
||||
w = args.get('Width', 1000)
|
||||
h = args.get('Height', 1000)
|
||||
|
@ -3535,6 +3544,9 @@ class LOWriter(LODocument):
|
|||
def dp(self):
|
||||
return self.draw_page
|
||||
@property
|
||||
def shapes(self):
|
||||
return self.draw_page
|
||||
@property
|
||||
def draw_page(self):
|
||||
return LODrawPage(self.obj.DrawPage)
|
||||
|
||||
|
@ -3546,6 +3558,10 @@ class LOWriter(LODocument):
|
|||
def cursor(self):
|
||||
return self.obj.Text.createTextCursor()
|
||||
|
||||
@property
|
||||
def view_cursor(self):
|
||||
return self._cc.ViewCursor
|
||||
|
||||
@property
|
||||
def page_styles(self):
|
||||
ps = self.obj.StyleFamilies['PageStyles']
|
||||
|
@ -3563,6 +3579,13 @@ class LOWriter(LODocument):
|
|||
def replace_descriptor(self):
|
||||
return self.obj.createReplaceDescriptor()
|
||||
|
||||
@property
|
||||
def zoom(self):
|
||||
return self._cc.ViewSettings.ZoomValue
|
||||
@zoom.setter
|
||||
def zoom(self, value):
|
||||
self._cc.ViewSettings.ZoomValue = value
|
||||
|
||||
def goto_start(self):
|
||||
self.view_cursor.gotoStart(False)
|
||||
return self.selection
|
||||
|
@ -3665,6 +3688,16 @@ class LOShape(LOBaseObject):
|
|||
a = dict(Width=s.Width, Height=s.Height)
|
||||
return a
|
||||
|
||||
@property
|
||||
def position(self):
|
||||
return self.obj.Position
|
||||
@property
|
||||
def x(self):
|
||||
return self.position.X
|
||||
@property
|
||||
def y(self):
|
||||
return self.position.Y
|
||||
|
||||
@property
|
||||
def string(self):
|
||||
return self.obj.String
|
||||
|
@ -3697,7 +3730,10 @@ class LOShape(LOBaseObject):
|
|||
def anchor(self, value):
|
||||
if hasattr(value, 'obj'):
|
||||
value = value.obj
|
||||
try:
|
||||
self.obj.Anchor = value
|
||||
except Exception as e:
|
||||
self.obj.AnchorType = value
|
||||
|
||||
@property
|
||||
def visible(self):
|
||||
|
@ -3831,8 +3867,11 @@ class LODrawPage(LOBaseObject):
|
|||
Connector
|
||||
"""
|
||||
index = self.count
|
||||
default_height = 3000
|
||||
if type_shape == 'Line':
|
||||
default_height = 0
|
||||
w = args.pop('Width', 3000)
|
||||
h = args.pop('Height', 3000)
|
||||
h = args.pop('Height', default_height)
|
||||
x = args.pop('X', 1000)
|
||||
y = args.pop('Y', 1000)
|
||||
name = args.pop('Name', f'{type_shape.lower()}{index}')
|
||||
|
|
Loading…
Reference in a new issue