Issue 128155 - I can not show a text in a draw document
Summary: I can not show a text in a draw document
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 4.1.6
Hardware: All All
: P5 (lowest) Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-16 23:29 UTC by silvano villarroel
Modified: 2019-07-19 08:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description silvano villarroel 2019-07-16 23:29:57 UTC
I can not show a text in a draw document.

I tried several ways and I feel the closer one is to show a TextShape or RectangleShape but I said close neighter of them works.

Please an example I am not an expert so an example will be great I believe.
here is my code:
--------------------------------------------------
	Dim drawDoc as object
	Dim thisDrawPage as object
	
	Dim centerX as double 
	Dim centerY as double
	Dim x1 as double
	Dim x2 as double
	Dim y1 as double
	Dim y2 as double
	Dim height as double
	Dim wide as double
	
	drawDoc = ThisComponent
	thisDrawPage = drawDoc.drawPages( 0 )
	
	' -- -- --
	
	centerX = (thisDrawPage.Width / 2)
	centerY = (thisDrawPage.Height / 2)
	
	height = 300
	wide = 600
	
	height = height * 10
	wide = wide * 10
	
	' -- --


	dotPosition = MakePoint( (centerX - (wide / 2)) , (centerY - (height / 2)) )
	
	dotShape = drawDoc.createInstance( "com.sun.star.drawing.RectangleShape" )
	'dotShape = drawDoc.createInstance( "com.sun.star.drawing.TextShape" )
	dotShape.Position = dotPosition 
	dotShape.Size = MakeSize( wide, height )
		
	'dotShape.RotateAngle = 2000  '20 degrees
	dotShape.FillStyle = com.sun.star.drawing.FillStyle.NONE	
	'dotShape.LineStyle = com.sun.star.drawing.LineStyle.NONE	
	dotShape.LineStyle = com.sun.star.drawing.LineStyle.DASH	
	
	dotShape.setString("Tex")
	dotShape.Text.Visible = True
	dotShape.setText("Tex")
		
	thisDrawPage.Add( dotShape  ) 
	' -- --

--------------------------------------------------

I have a button on the draw document. I press the button and then that code is executed. I see a sort of frame for the text on the document but the text does now show up.

Any help is welcomed.
Thanks a lot.
Comment 1 oooforum (fr) 2019-07-19 08:18:43 UTC
You are in wrong place here. This is a bug tracking system and not a help desk on macro programming.

For this kind of question, please refer to our community forum or users mailing list: http://www.openoffice.org/support/