Beiträge von russellshannon

    1. If you added this feature to version 6 I would gladly upgrade
    2. As an alternative I have tried to delete the entire paragraph in the MailMerge procedure

    Code
    Contents.MergePar.DeleteParagraph;


    however this causes an Access Violation
    3.What is the best way of programatically searching for unique text in a paragraph and then programatically either delete the text or delete the entire paragraph

    I generate a table in code and then want to merge the entire top row. I tried:

    Code
    par := wpRichText.TableAdd(numCols, numRows, [wptblActivateBorders], nil, CallBack);  for i := 0 to par.TableRow.ColCount-2 do    par.TableRow.Cols[i].MergeCell(true);


    however the tableAdd function does not return the table Paragraph but some other paragraph. Therefore I tried:

    Code
    wpRichText.BeginTable('TABLE', 0, 0, 0);
      wpRichText.TableAdd(numCols, numRows, [wptblActivateBorders], nil, CallBack);
      if wpRichText.MoveToCell(0,0,'TABLE') then
        for i := 0 to wpRichText.TableRow.ColCount-2 do 
          wpRichText.TableRow.Cols[i].MergeCell(true);
      wpRichText.EndTable;


    But that also doesn't merge the table columns in the first row
    Any suggestions?

    1. suggested FieldAtCP function works well, however - the help file describes this as Field at Cursor Position whereas I think it should be Field at Caret Position.

    I use

    Code
    var
      obj: TWPTextObj;
    begin
      obj := wpRichText.FieldAtCP;
      if assigned(obj) then
        obj.Name := obj.EmbeddedText;
    end;

    in the onChange event so that the field name will change automatically when the displayed name is updated.

    2. Is this the best place to put the code?

    3. Will this code cause other problems - where else is the TWPTextObject used?

    4. To automatically check and update fields in code, how do I enumerate the field objects? I can use the FieldGetNames function to enumerate the names and I can use the FieldReadText(const fieldname: string):string function to get the embedded text but I think I need a FieldReadObj(const fieldname: string): TWPTextObject function to get the object so that I can update its name.

    I have upgraded from D5 WPTools 5.18.7 to D2006 WPTools 5.202 and found that paragraphs that are hidden with version 5.18.7 are displayed with version 5.202

    When you set paragraph paprHidden, the rtf file inserts the wpparhide1 attribute in the paragraph. Both versions do this correctly.

    When displayed however in a TWPRichText component, the earlier version hides the paragraph, whereas the later version does not

    Julian,
    I have checked the design time package and it only includes WPTools_reg.pas. I have tried removing WPTools5_D10_W32 and adding the files you list below and get the following message :(

    Zitat

    The following changes are necessary to make this package compatible with other installed packages. Choose OK to apply these changes and rebuild the package.

    Add WPTools5_D10_W32.
    WPTools5_D10_W32 contains implicit unit(s) WPUtil, WPOBJ_Image, GraphicEx, MZLib, GraphicColor, GraphicStrings, GraphicCompression, JPG, WPPrTab1, WPRuler.

    Remove WPCTRStyleCol, WPCTRLabel, WPCTRMEMO, WPCtrPrint, WPCTRRich, WPIOWriteRTF, WPIO, WPIoANSI, WPIOCSS, WPIOHTML, WPIOReadRTF, WPIOUNICODE, WPIOWPTools, WPRTEPAINT, WPRteDefs.
    Unit(s) WPCTRStyleCol, WPCTRLabel, WPCTRMEMO, WPCtrPrint, WPCTRRich, WPIOWriteRTF, WPIO, WPIoANSI, WPIOCSS, WPIOHTML, WPIOReadRTF, WPIOUNICODE, WPIOWPTools, WPRTEPAINT, WPRteDefs were found in required package WPTools5_D10_W32

    If I don't accept I cannot compile.
    If I do accept and compile I get a runtime bpl file which is only 23k in size.

    Russell

    The reason for using run time packages is to allow my regular web updates to be much smaller. I agree it's not ideal.

    WRT the run time package, I compile with the units you suggest however most of these units are removed as they are already included in the required package WPTools5_D10_W32.bpl (the design time only package)

    Now if both the run time and design time packages are required to be distributed why bother splitting into 2 packages. Borland recommends and I would like them to be separate to allow a smaller download.

    I checked and the only unit the design time page contains is WPTools_reg

    Russell

    How do I create a D2006 run time package?

    It would be helpful if a project group was supplied with updates that includes a project for creating the design time package and a project for creating the run time package.

    Also under options for these projects, the current version should be set if possible

    Thank you
    Russell

    Thanks Julian - I'm not sure that you understand my problem.

    The ParStyles sample works as I expected. You can select text in the main rtf editor, then change to a different style in the style combo box and the selected text will change to the new style.

    In the wpDefEditor however this doesn't happen.

    The wpDefEditor uses a TWPComboBox control to select the style whereas ParStyles uses a TWPToolBar with SelStyle list Box. I can resolve it myself by making my own replacement DefEditor however I like to use your version as it should come with enhancements as you upgrade your components.

    Use the WordPad5 demo (UseDefEditor.dpr). Create a new style with a distinctive font and size eg cursive 32 point size.

    The fonts show correctly in the combo box, however when you select some text in the editor and apply the style some characteristics work eg bold, italic,centered etc however font name and font size do not work

    Inside the TableCellCallBack function I would like to create an image
    - I use the following code - however it DOESN'T work????