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

Add text in rectangleshape

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


Joined: 03 Sep 2006
Posts: 5

PostPosted: Sun Sep 03, 2006 12:34 pm    Post subject: Add text in rectangleshape Reply with quote

Dear All, I'm starting to learn OOo.Draw and macro programming. The first thing I'm trying is drawing a rectangle (I can do that), but now I need to add a text (say "abcd") into that rectangle shape.

I can't get it to work. Any example code would do fine (in OOo Basic).
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Mon Sep 04, 2006 6:16 am    Post subject: Reply with quote

http://www.oooforum.org/forum/search.phtml
Search for "Draw" in forum "Code Snippets"
DannyB has written one of his most comprehending threads here:
Draw: Introduction to draw and basic shapes
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon Sep 04, 2006 8:23 am    Post subject: Reply with quote

Something like :
Code:

oPage.add(oRectShape)
oRectShape.String="abc"


The point is you add first your shape to the page and after gives a name.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
zymo
General User
General User


Joined: 03 Sep 2006
Posts: 5

PostPosted: Mon Sep 04, 2006 12:43 pm    Post subject: Reply with quote

Thank's, that was it,

The correct function is: oRectShape.SetString="abc"

after the shape is placed on the page
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Sep 04, 2006 8:03 pm    Post subject: Reply with quote

The draw and Impress chapters from my book are available as a free download from my publisher. If you have trouble finding them let me know...
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Sep 05, 2006 8:34 am    Post subject: Reply with quote

Quote:
The correct function is: oRectShape.SetString="abc"


Are you sure ?
I think it is :
Code:

oRectShape.String="abc"

or
Code:

oRectShape.SetString("abc")

_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
zymo
General User
General User


Joined: 03 Sep 2006
Posts: 5

PostPosted: Thu Sep 21, 2006 9:33 am    Post subject: Reply with quote

It did work for me. The result after some evenings of my first OOo macro coding is a tool that generates ERDs (entities and relationships with symbols indicating entity types and relationship types) from an Oracle database based system, fully automatically.

OOo Macro = great stuff!
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Thu Sep 21, 2006 12:17 pm    Post subject: Reply with quote

Very interesting... can it also probe a Base document?
I would love to see an example of the file that it generates; even if you have to email it to me directly (andrew@pitonyak.org).
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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