| View previous topic :: View next topic |
| Author |
Message |
plagil Newbie

Joined: 23 May 2006 Posts: 1
|
Posted: Tue May 23, 2006 3:05 am Post subject: Flowchart Macro |
|
|
Hi I am trying to do a "Flowchart" Macro. It is easy enough to get draw to create a rectangle or elipse . | Code: |
Sub Rechteck
Dim oDoc as Object, oPage as Object, oRechteck as Object
oDoc = thisComponent
oPage = oDoc.drawPages(0)
Dim oPos as new com.sun.star.awt.Point
oPos.X = 4000
oPos.Y = 5000
Dim oSize as new com.sun.star.awt.Size
oSize.Width= 8000
oSize.Height = 4000
oRechteck = oDoc.createInstance("com.sun.star.drawing.RectangleShape")
With oRechteck
.Position = oPos
.Size = oSize
.Name = "Rechteck_01"
End with
oPage.add(oRechteck)
End Sub
|
But how can I add a flowchart element ? Cant find anything at
http://api.openoffice.org/
So I unzip a drawing file and found this in the content.xml :
| Code: |
<draw:custom-shape draw:style-name="gr2" draw:text-style-name="P1" draw:layer="layout" svg:width="12.5cm" svg:height="7.5cm" svg:x="3.135cm" svg:y="13.635cm"><text:p/><draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:text-areas="4230 4230 21600 21600" draw:type="flowchart-internal-storage" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 Z N M 4230 0 L 4230 21600 N M 0 4230 L 21600 4230 N"/></draw:custom-shape> |
So I am looking for something like this :
| Code: | | oDoc.createInstance("com.sun.star.drawing.flowchart-internal-storage") |
Any help on that mater is welcome |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue May 23, 2006 5:01 am Post subject: |
|
|
This is the ultimate must-have-basic-tool for every coder of OOo-macros (some call it even from other languages)
http://sourceforge.net/project/showfiles.php?group_id=87718&package_id=101416
this is copied from API-doc on com.sun.star.drawing.GenericDrawPage:
| Code: |
xPage = xDoc.DrawPages(0)
for x% = 0 to 200
xShape = xProv.createInstance( "com::sun::star::drawing::LineShape" )
xShape.LineColor = rgb( 255, 0, n%+20 )
xShape.LineWidth = 20
xShape.Position = Point( x%, 2 * x% )
xShape.Size = Size( 300-x%, 20 )
xPage.add( xShape )
next x%
|
|
|
| Back to top |
|
 |
|