Beiträge von MARK WILLIAMS

    Following a previous suggestion, I have overriden your logic that determines whether it needs to add left or bottom cells depending on whether the adjacent right or top border is set. I found this to be very problematic for example when different styles are set for the left border and its adjacent right border or if you have a double line border set. Accrodingly all the borders are set for every cell. I have then added some code to your various units which works out whether the right or top borders are set on adjacent cells and if they are it works out whether to draw one or other of the lines (it will ignore one of them if the sytles and thickness are the same) if not it tries to work out how to draw the adjacent borders. Have not got it quite right yet, but will continue working on it. More than happy to give it to you when finished so you can improve on it if you wish. Would much prefer to see this sort of thing in wpTools as standard. You're also more than welcome to my dialogs.

    However, the issue of adjacent cells is not one that is affecting whether to draw the width of the border. Setting the border width is not just a problem for the left border it is a problem for all borders, I just chose left as an example.

    Any ideas?

    Thanks

    Hi Julian,

    Perhaps it is better if I explain what I am doing. I am trying, as far as possible, to replicate Word's table handling. I have created a table properties dialog which is similar to Word's and which works well, even setting the border widths. This is because I deal with all the borderwisdths (and other properties) in one function. I delete all border and other relevant properties before I reset them again and then I reset them one by one, dealing with left then right etc. This works fine using ASet.

    In addition to this I am replicating the way Word's Tables and Border toolbar deals with setting table properties. As you will of course realise, you can choose to deal with any of the borders in isolation from the rest. So if the user chooses to deal with the left border in isolation, I need to set only the left border. At first, I was not deleting any properties and trying to set, for example, the left border, the ASet function was finding the code and value required in the array ie it was reporting that i>=0 and that FParAttrVal[i] and $FF000000) = c which was wrong. I then tried deleting the wpat_BorderwithL value to clear it form the array before trying to set it again. When I did this, ASet was reporting that i<0 and also I checked that "Card" was the correct value in twips. It also then proceeded to the ANeedUpdateProps function, but did not change the border width from 10 to the required 60. I analysed the value being received by wpDrawBorder and instead of registering 60 twips it had somehow been demoted to 10 twips during the intervening process.

    I hope this is clearer.

    Regards

    Mark

    Hi Julian,

    What I am actually doing is seeting the borders one by one. I cannot delete all the border properties only the one that I am currently dealing with.

    There are no compiler errors it just seems that the request to update the properties from ASet is either not happening (even though my tests confirm the function is being called) or it is somehow losing the new value between ASet and wpDrawBorder and I cannot work out which it is.

    Any suggestions as to how I can get this working on a border by border basis?

    Thanks.

    Hi Julian,

    I am having real problems with this method. I am trying to set the borderwidths of the borders of table cells. Sometimes I can get it to do it and other times not. I have analysed the code for the method and I think there are potentially some bugs with it.

    As an example I was setting the borderwidth to 3 points. At first, the ASet procedure was reporting that the FParAttrVal array included the wpat_code and matched the value, even though the borderwidth had not previously been set.

    I then tried ADel to delete the borderwidth value before setting it. This got me past the initial problem and into the else statement following if i>=0. I checked that the value of "card" was as desired (ie 60 twips) which it was and so this should have added the appropriate code and value to the array and triggered an update. However, it didn't and when it came to calling the wpDrawBorder procedure in WPRTEDefs the value had been reset to the default value of 10 twips. I have tried but found it difficult to follow what happens between ASet and wpDrawBorder.

    Can you please let me know if this is a bug or if it would appear that I am doing something wrong.

    Regards

    Mark

    Hi Julian, a couple of questions problems and possible bugs relating to above. I am designing a border and fill dialog with as far as possible the functionality provided by Word. I am not far off, but have hit a couple of snags:

    1 There does not appear to be any way of setting the border and fill properties of a textual paragraph within a cell. Presumably, this is not supported. If it is, can you please advise how I do it.

    2 If a table cell has a number of textual paragraphs within it and the cursor is not on the first paragraph in the cell then setting the WPAT properties for border and fill affects neither the cell nor the textual paragraph. The obvious answer is to get the first paragraph in the cell and the obvious answer to that is use FirstSibling property. However, this always returns the second text para in the cell not the first! I have had a look at the source for this and it appears fine, but it just doesn't seem to loop back far enough to pick up the first para. I have had a look at the methods and properties for TParagraph and can't find any other one which will easily give me the first paragraph of the cell. I have tried using the activeparagraph.cell property but this does not appear to assist. Presumably the modifycellsonly property of TWPCharAttrInterface would work, but this is not the way I am approaching it. I need to go via ActiveParagraph.

    Regards

    Mark

    Does FGColor and ShadingType actually add anything. I tested shadingtype with numerous integer values and found (I think) that the only one that made any difference was 2 which cleared the table cell of any colour in which case don't set a background color. Seriously though,

    1 does shadingtype actually produce any patterns and if so how.

    2 Why have BGColor and FGColor I can't work out what they are supposed to do. If you set both FGColor obliterates BGColor. I assumed that by applying shadingvalue you would get a mix of both, but this doesn't appear to be the case.

    Thanks

    Mark (seeking enlightenment)

    Hi Julian,

    The constants for WPBrd seem a little erratic. They are numbered 0..28. But when I try and set these constants few of them correspond to the description given and some seem to do nothing at all. Eg WPBrd_Wavy sets a thick line.

    Is this a problem or is it me (as usual).

    Thanks

    Mark

    Hi Julian,

    I am having difficulties figuring out how to force a bottom border when the cell is not in the bottom row and how to force a right border when the cell is not in the last column.

    The bottom border only appears if the top border of the cell below is disabled and likewise for the right border. I have tried WPBrd_Draw_Finish but this appears to have no effect.

    I appreciate that you don't normally need a bottom border where the cell below has a top border and likewise for the right border However, if you wish to have a cell with a line type of eg Double, you do need to force the bottom and right borders.

    How do I do this?

    Thanks,

    Mark

    Hi Julian,

    Thanks for the reply.

    2 I was only wandering about ParKeepN as this is supported by xsl:fo (formatting objects).

    Thanks for the info on the rest. Clipping of overflow text on a table row would be really handy.

    Thanks,

    Mark

    Hi Julian,

    A couple more questions on this stuff (a few of them ones I raised a while back but have not been answered yet).

    WPTools5 takes a bit of getting used to, but it is very powerful stuff. I suppose it is inevitable that it takes time to get used to it. However, with yopur help I am pretty close to getting a table properties page that has close to the same functionality as word. I think the only stuff I am missing now is:

    1. WPAT_ParKeepN. I cannot get this to work with table rows. I have managed to get ParKeep working by using ASetRow and setting the value to 1, but I cannot get it to work with ParKeepN. Is this not possible for table rows or is there some other way I need to do this?
    2. Is there a ParKeepP to keep a paragraph with the previous row.
    3. I am using WPAT_BoxHeight to set the max height of a table row, which works except any text that is not visible due to the height restraint overflows into the row below. Any suggestions please?
    4. Is there a default setting for the table for IndentLeft and IndentRight, SpaceBefore and SpaceAfter so that you can change these settings for the whole table as opposed to the current cell?

    Thanks,

    Mark

    Hi Julian,

    Thanks for the reply. Is there any way of preventing a table row from splitting onto the next page?

    Also, my questions re setting the properties of a number of selected table rows or columns at the same time was not just to do with parkeep, I had in mind other properties such as ColWidth, BoxMaxHeight etc. Can you let me know if this is possible and how I would go about it please?

    Thanks,

    Mark

    Hi Julian,

    Hopefully a couple of quickies:

    1 How do I use ParKeepN and ParKeep. I have tried setting the parentrow and activeparagraph but does not seem to have any effect.
    2 If I need to change the properties of a number of selected table rows, how would I go about that?
    3 Ditto for table columns.

    Thanks

    Mark