Topic Options
#18151 - 05/16/05 05:48 AM Centering in a box
Neil Simms Offline
Junior Member

Registered: 10/11/04
Posts: 9
Loc: North Yorkshire, UK
This question is almost the same as one posted by Mason, but the answer provided is not acceptable. See this post for details:

http://www.objectiflune.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=35;t=000008#000000

I need to display some text centred (horizontally and vertically) in a statically sized box. The text is a mixture of constant text and data selections. One of the data selections can be rather long and within the confines of the box, may require one, two or three lines to be displayed.

My initial attempt was to do this as two objects (a fixed box and a text object with dynamic height) and use the snapping points it align them. This appears to work correctly in the design tool. As I change pages the text wraps to a different number of lines and remains centred within the box.

However, when I send this to Watch, the text on output (either by printer or PlanetImage) is always placed at the same top left position. The exact placement appears to be based on the position in the design tool depending on the page I was viewing when I sent the form. (Not when it was last saved - changing data pages in the design tool does not require the form to be saved.)

Having read the other post, I have tried doing this without snapping points. I created a text box of fixed height and set its border. To enable the 'Text in Box' option, I have to turn word-wrap off. This means that the long data selection now extends horizontally beyond the box. Also, one of the lines consists of 'Text, variable, text'. This works correctly with centre justification. With the 'Text in Box' centre option, the three sections of the line are drawn on top of each other.

Is there a solution that will allow centring and word-wrap of a mixture of text and data selections, without resorting to Talk?

Thanks.

Top
#18152 - 05/23/05 09:42 AM Re: Centering in a box
Anonymous
Unregistered


Hi Neil Simms,
Here is a simple solution for you (tested on PP 4.2)

1) Create a box a static box in your form
2) Check the "Set snapping point" attribute and select the dot in the center of the rectangle
3) Create a new box
4) Check the "Dynamic height" attribute (in Basic Attributes)
5) Check the "Snap to previous object" attribute and select the dot in the center of the rectangle
6) Set the "Borders" "Settings" to None
7) Center horizontaly the text
8) Make sure that the first box is just on top of the second box in the "Document Structure"

The only down side of this solution is : if the text get bigget than the static box, it will overflow and there is no Non-PPtalk way to deal with that.

I hope this will help you.

Top
#18153 - 05/25/05 04:42 AM Re: Centering in a box
Neil Simms Offline
Junior Member

Registered: 10/11/04
Posts: 9
Loc: North Yorkshire, UK
Merlin,

I tried this and got the same result as using a static box with a centre snapping point, followed by a text object, with dynamic height snapping to the previous object on its centre point. The top of the text box remains fixed on each page, regardless of the actual height of the text box. (The display in the design tool is correct, but try the preview to see the behaviour across several pages.)

I have implemented a solution in talk. This is not ideal as it can no longer be edited by the end users. It renders the text in white, records the height using ¤t.y. It then moves to the correct vertical position and re draws the text in black.

I have also had a similar suggestion from OL tech support, but have not tried it as yet. This involves drawing the text in a box in white and recording its height in a global variable using PressTalk After for the box. Then using the global variable as the height for a box containing the text in black. Because the balck text box knows the correct height before it starts rendering, it should snap to the correct height.
This has the benefit of being editable by the users.

Top
#18154 - 05/25/05 02:14 PM Re: Centering in a box
Anonymous
Unregistered


Hi Neil,
We may have found a solution for you that will allow the client to modify easily the text that needs to grow dynamically and be centered.

This solution cannot be explained on the Newsgroup since, while not that complex, it requires many steps.

Please open a Support Call by phone or by the web so we can show you this solution.

Thank you.

Top