Topic Options
#29959 - 05/22/07 06:56 AM PressTalk 6 - Element properties
Azamat Offline
Member

Registered: 05/03/07
Posts: 34
Loc: UK
Using Planetpress Talk, does anyone know how I can access the properties of an object/element and put it into a variable?

For example, something like this;

define(&ElementHeight,Measure,0)
&ElementHeight := Text1.Height

Cheers.

Top
#29960 - 05/22/07 09:43 AM Re: PressTalk 6 - Element properties
Anonymous
Unregistered


Hello / Bonjour !

Please refer to:
http://www.objectiflune.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=58;t=000059;p=#000002

Top
#29961 - 05/22/07 09:53 AM Re: PressTalk 6 - Element properties
Azamat Offline
Member

Registered: 05/03/07
Posts: 34
Loc: UK
The answer is NO then. frown

Top
#29962 - 05/23/07 10:25 AM Re: PressTalk 6 - Element properties
John Price Offline
OL Expert

Registered: 10/07/03
Posts: 164
Loc: Wigan, UK
I am not sure exactly what you mean but maybe this will help.

I have used code to keep track of the positions of certain objects so I can move related objects around a page.

I use this for drawing lines under variable size blocks of text.

Hope this helps.

Top
#29963 - 05/23/07 10:41 AM Re: PressTalk 6 - Element properties
Azamat Offline
Member

Registered: 05/03/07
Posts: 34
Loc: UK
Hi John

I wanted to be able to store the current height of, for example, a text box into a variable by interogating the text box properties. It seems that PressTalk doesn't expose object properties during runtime. The problem I had was knowing whether to print a text box on the current page, if it was to big and overflowed off of the bottom of the page I needed to print it on a new page. Using something like 'If current.y+NextTextBoxHeight) > BottomOfPage then start a new page.
To be honest I'm a bit surprised Design doesn't have a built in process for handling such a thing.

Top
#29964 - 05/23/07 11:03 AM Re: PressTalk 6 - Element properties
Anonymous
Unregistered


Hello,

I don't want to go into too many details here but the question of accessing object's properties is alot more complex then just publishing them at run time. The first thing to note is that at the end we are dealing with Postscript and not PressTalk. What might seem quite easy to do in PressTalk might be quite difficult, not efficient, etc in Postscript. Just as a base example, objects don't really exists in Postscript. While I am not in anyway saying this is impossible to do, I would just like to let you know it is not just a question of publishing values. In fact, for some objects (like a Text Object) we have no idea of its height until after it is actually drawn on the page. So a Press Talk object that would exist before the text object that says Text1.height would actually be 0 as its height has yet to be determined.

With that being said, there are ways to get around this. Mainly, just create a global variable that will store the height and then use that variable later on. The way I usually do this is to create a global variabel (say &Text1Height) and in the PressTalk before of a text object I will use this code

Code:
&Text1Height := &physical.y
and in PressTalk after

Code:
&Text1Height := &physical.y - &Text1Height
Now the variable &Text1Height contains the height of the text object and can be used later on.

Top
#29965 - 05/23/07 12:25 PM Re: PressTalk 6 - Element properties
John Price Offline
OL Expert

Registered: 10/07/03
Posts: 164
Loc: Wigan, UK
Azmat,

I too have an application that requires a text box printing at the bottom of a page, in our case its a transaction statement. Statements are variable but in our case they only run to a maximum of 2 sides of paper but it would work for more pages with some modifications.

I use the run page method to print the statements. The text box is on a page of its own and I execute the page depending on the number of statement lines I am processing.

If the number of statement lines is over 30 I know it can't print on page 1 so I call it when printing the 2nd and final page.

Seems to work well for me.

Hope this helps.

Top