OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Flowchart Macro

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
plagil
Newbie
Newbie


Joined: 23 May 2006
Posts: 1

PostPosted: Tue May 23, 2006 3:05 am    Post subject: Flowchart Macro Reply with quote

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
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Tue May 23, 2006 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group