Printing ignores document class settings for some documents

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
zainka
Posts: 33
Joined: Tue Apr 29, 2003 6:40 am

Printing ignores document class settings for some documents

Post by zainka »

Heres the case...

I am using Textpad (ver 4.7.2) as GUI when writing c code. (used tp for this purpose for several years). On a new computer I have changed the document class settings for C files and the printing prefferenses to fit my needs (i.e. syntax highliting, printer borders and top text/ footer etc.).

In a project containing severeal files, both source and header files, i have selected all opened files in the document selector and choosen to print the documents. All documents then camed out with the new printing prefferences / formatting, except for ONE stupid file which decided to use the fuc.. default settings.

Strange thing is that this file (named radio.c) was created by copying an existing c file in the same project (which prints perfectly) and then renamed to radio.c. The same thing was done for radio.h which prints perfectly too.

While peeping on the properties for the radio.c file only it does show the old printer prefferences. But WHY? If i now changes the document class for c files, radio.c does not follow but the others does. Note that before I changed my document class settings all files followed the old default printersettings.

Some thoughts. Can it be that if the properties has been changed individual for a file it losses its connection to the global document class? I have not done this for the radio.c files but there are others working on the same project too so prehaps.... ?!?.

For a test, i (here and now) have copied the radio.c content, deleted the old file and created a new radio.c file. Now it does print correctly! Greate

Hmm. It seems like I have solved my own trouble while typing, but I choose to post it anyway for others who might have similar troubles.
I guess the problem was that the link to the document class was broken somehow. Anyone who wants to confirme this?

Regards
Vidar (Z)
zainka
Posts: 33
Joined: Tue Apr 29, 2003 6:40 am

Post by zainka »

Now, THIS is strange... I have been doing som other changes inside the document class according to tabulation settings after my last topic when finaly everything worked well. Then this happend. The new tabulation settings worked well for all documents, except for the dreadfull radio.c!!! How can this be? Note that I in my last post deleted the old radio.c and created a new one which followed my class settings. Does TP somehow remember which filenames which is locked to a document class and which is not??? One idea... could it be that changes in a document class only works for files which is out of focus or not opened? (the radio.c file was in focus when the global change in document class was done)

Any ideas?

Vidar (Z)

(NOTE: I have also been uppgrade from 4.7.2 to 4.7.3)
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Have you tried closing the document and then reopening it?
zainka
Posts: 33
Joined: Tue Apr 29, 2003 6:40 am

Post by zainka »

Yupp, but that wont help. Maybe it was fullmoon last night?

The problem is still here for the radio.c file mentioned above BUT here is something very strange, in fact it is strange indeed... My project consists of two very similar products which have a slightly different firmware but the radio.c part is common, so today I have copied the files from the first product which is common to the second product into a new folder and then i start building my new code from there, Now THIS radio.c file behaves normaly, i.e. it follows the class settings as specifyed by the doc. class, but the original file does still not follow this class. Strange. I have some ideas to follow which I will try right now, i list them up beneath with the result given for anyone to follow:

Enviroment: I am back in workspace for the first part of the project, i.e. the one with the "broken" radio.c. Using tp ver 4.7.3

1: Testing the abnormalities to ensure its like described.
result: It is.

2: Closing and reopening workspace:
result: Still the same

3: Open file radio.c alone (i.e. not in workspace)
result: please wait...... Wow... It now follows its own document class but if changing class, changes to opened file will only apper if reopening the file again. If document prefferences are changed, these changes will stay until file is closed but when reopening again, document prefferences is equal to class

4: reopening workspace (which also includes radio.c)
result: Back in trouble again, it does not! follow class

5: Removing radio.c from workspace, saving workspace and then I include radio.c in workspace again.
result: Voila.... It does follow class, also when class is changed when file is not in focus. If File is in focus when class is changed, changes does only appear after reopening workspace. If radio.c document preference is changed induvidual, then these changes has higher priority than class settings as long as workspace contains radio.c

Conclusion:
Workspace saves info aboute wich prefferences to be used, and each file has its own prefferences which are set equal to class when workspace is generated, the file itself does not save any settings.
From this we can write the following rules:

a: Changes to a document class applys to all files opened after changes is done

b: Changes to a document class applys to all files included in a workspace opened after changes is done and which has not had its own induvidual prefferences changed earlier.

c: Changes to document class applys to all opened documents which is not in focus and which has not had its own prefferences changed earlier for the session given. (applyes also to files included in a workspace)

d: Induvidual document prefferences has a higher priority than the document class prefferences

e: Workspace saves information aboute prefferences for each files in workspace.

f: Files included in a workspace which have had its own prefferences changed does not follow its document class anymore (until removing file from workspace, save, and then include it again)

g: Dont tell your boss aboute how much time you wasted to solw this problem

Hopes this is of any help

Regards
Vidar (Z)


(Thanks anyway for the tip.) :!:
Post Reply