Page 1 of 1

FormatForPrinting

Posted: Wed Apr 11, 2018 2:24 pm
by dunbarx
This got nothing on the use-list, so I am repeating it here:

With regard to formatForPrinting for Windows, the dictionary says to set the property *before* you open the stack. I'm probably just being thick, but how do you set the property of a stack that is not open? Does this really mean to set it to true, save it, close it and then reopen it in order to print accurately? And then if the user wants to make a change to some text, they have to set it to false, save, close, reopen? Then to print a second time go through all of that again? That sounds like a horrible thing to put a user through. Why can’t you set it to true just before you print, then back to false afterward?

Can anybody provide some input on this?

Thanks,
Marty

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 2:26 pm
by dunbarx
I am intrigued as well.

The dictionary is quite clear: Set this property before the stack of interest is ever in
memory.

Does the engine store properties just in case a stack of the appropriate
name opens? Are there other such properties?

Or is it a global property that applies to all stacks, but then they all have to be unopened before they can use it.

The dictionary states that this property can be cleared if text is to be
edited, and then, I assume reset if the user want to print again. So is the
property stored in the stack as well?

Craig

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 4:39 pm
by bogs
the dictionary says to set the property *before* you open the stack. I'm probably just being thick, but how do you set the property of a stack that is not open?
Maybe I don't understand the question, isn't that what the 'preOpenStack' message is for?

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 4:51 pm
by dunbarx
Bogs.

I could be wrong, but I think "preOpenStack" appears before any card is drawn, but I do not think it appears before the stack is in memory. After all, what would be receiving that message, except for, er, the stack?

But you might be onto something, if the dictionary intended this, and just did not say so.

Craig

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 5:53 pm
by jacque
I haven't had to print in years but the last time I did it was to a substack. I set the formatForPrinting to true before opening the stack and it worked. So I don't think "in memory" is accurate since substacks are always in memory. The important part is to set it before the stack is actually rendered. PreOpenStack would probably work for a mainstack.

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 6:27 pm
by dunbarx
Jacque.

All makes sense. It is just that the dictionary is so clear on the subject.

If "clear" is the right word.

Craig

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 7:06 pm
by bogs
dunbarx wrote:
Wed Apr 11, 2018 6:27 pm
If "clear" is the right word.
Yah, that problem I often have when interpreting what the dictionary 'says' vs. what it actually means. Sometimes it is clear as mud :roll:

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 7:39 pm
by dunbarx
Bogs.

You know, I wonder if I am making too big a deal out of this. If the property is a global one, what is all the noise about?

It was just the opening/memory sequence thing, in that the property should be set before the stack is even born. Normally this would not matter, but maybe this particular property doesn't do its job well unless it is already in play.

Craig

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 8:29 pm
by bogs
Heh, unfortunately, as Smokey the bear use to say, only you can determine if it is too big a deal or not. For me, it is the shortcut keys that rankles.

Besides, I agree with you that it is a weird way of putting something, but that is weird to me, coming as I do from a completely different way of doing stuff. If I had started out in Hc/Mc/Lc instead of the languages I did start with, it might seem completely normal to me. Hard to say.

Also, the read I got from it was a bit different than the interpretation listed in the post you copied. Taken in whole, it seems to say that if your going to print a stack on a windows system only, that you need to set the property to true before displaying the stack (despite the in memory part in parenthesis) due to the way Windows handles fonts differently on screen vs. printing. It also says that text corruption can occur if you change the text in the field while the property is true, etc etc.

So yah, it is weird.

Jacque's explanation sounds the most reasonable to me, but then, except for her variable naming things you know pretty much everything she says sounds reasonable.

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 9:02 pm
by SparkOut
You can have a stack open, set the formatForPrinting and watch the font metrics change on screen. I don't know what other implications there are but afaik it is possible to set and unset while the stack is in memory without any errors. Maybe the reason for rendering for print out of memory (ie offscreen) is to stop a distracting change in the appearance.

Re: FormatForPrinting

Posted: Wed Apr 11, 2018 11:33 pm
by FourthWorld
Did anyone file a Bugzilla or pull request for that Dictionary entry to remove the parenthetical part about "(and not in memory)" from the Dictionary's formatForPrinting entry?

That seems to be the source of confusion here, is only partially technically accurate, and explaining it would require far more text about the nuances of how stacks are unpacked from disk than anyone wants to read there. Once that's removed using the formatForPrinting property is straightforward.

Please note the BZ# or PR# when you file it. Thanks.

Re: FormatForPrinting

Posted: Fri Apr 13, 2018 3:34 am
by dunbarx
Asked QCC about it

# 21198

Craig

Re: FormatForPrinting

Posted: Fri Apr 13, 2018 4:04 am
by FourthWorld
Thanks for submitting that, Craig.