21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Structure of Drawings 165<br />

left-hand distance between drawing element and text in hundredths of a millimeter<br />

TextRightDistance (Long)<br />

right-hand distance between drawing element and text in hundredths of a millimeter<br />

TextUpperDistance (Long)<br />

upper distance between drawing element and text in hundredths of a millimeter<br />

TextLowerDistance (Long)<br />

lower distance between drawing element and text in hundredths of a millimeter<br />

The following example demonstrates use of the named properties.<br />

Dim Doc As Object<br />

Dim Page As Object<br />

Dim RectangleShape As Object<br />

Dim Point As New com.sun.star.awt.Point<br />

Dim Size As New com.sun.star.awt.Size<br />

Point.x = 1000<br />

Point.y = 1000<br />

Size.Width = 10000<br />

Size.Height = 10000<br />

Doc = StarDesktop.CurrentComponent<br />

Page = Doc.drawPages(0)<br />

RectangleShape =<br />

Doc.createInstance("com.sun.star.drawing.RectangleShape")<br />

RectangleShape.Size = Size<br />

RectangleShape.Position = Point<br />

Page.add(RectangleShape)<br />

RectangleShape.String = "This is a test" ' May only take place after<br />

Page.add!<br />

RectangleShape.TextVerticalAdjust =<br />

com.sun.star.drawing.TextVerticalAdjust.TOP<br />

RectangleShape.TextHorizontalAdjust =<br />

com.sun.star.drawing.TextHorizontalAdjust.LEFT<br />

RectangleShape.TextLeftDistance = 300<br />

RectangleShape.TextRightDistance = 300<br />

RectangleShape.TextUpperDistance = 300<br />

RectangleShape.TextLowerDistance = 300

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!