Beiträge von velter

    I can't find a way to save Unicode (or UTF8) HTML.

    For plain text using SaveToStream(lFlux,'UNICODE'); works. But for HTML the only way I found is to add the following lines to WPRETDefs.pas line 53030 :

    if pos('-unicode', optstr) > 0 then
    FOptUnicode := TRUE;

    and use

    SaveToStream(lFlux,'HTML-unicode');

    is there a way to achieve the same thing without modifying the source ('HTML-utf8') does work for reading but not for writing.

    cyril

    in WPSpell there is some hard-coded string which are not localized :

    In WPSpell_OptForm.pas lines 483 and 487 :

    btnEnableDCT.Caption := 'Enable'
    end
    else
    begin
    btnEnableDCT.Caption := 'Disable';

    should be

    btnEnableDCT.Caption := WPSpellLoadStr(tlblEnable);
    end
    else
    begin
    btnEnableDCT.Caption := WPSpellLoadStr(tlblDisable);

    Also if I use all USEWPT_LANGCTRL, WPSpell translations are missing from the WPLocalization_2013.xml found in the localization demo. Is it possible to add them ?

    I'm trying to uses wptools 7 as an HTML mail display/editor component. I'm facing quite a lot of difficulties are have trouble settings all the options correctly for this to work.

    * There is the AsWebpage property with the wpFormatAsWebpage. With this flag set, most of the html is read but :
    - A red frame is displayed around tables (I've open another topic on that)
    - Some VERY simple html fail to display correctly :

    <html><body>a<br><br>b</body></html>

    The "b" is there but not displayed. Seem to be caused by the two br.

    If the flag wpFormatAsWebpage is not set, a lot of HTML does not even load. It fails with "Cannot assign <nil>!" Exception on line 15839 of WPRETDefs. When the html format correctly, hyperlinks are displayed very differently


    I've found some samples in the docs (#7) but beside setting wpFormatAsWebpage it doesn't tell me more.

    What's the recommended way to use wptools as an HTML display and editor ?

    Thanks

    Cyril

    Thanks for your reply,

    No they are not defined.

    I find the culprit in WPRTEPaint after line 6570 :

    if (LineData.lineflags and WPDRAW_TABLEBOX) <> 0 then
    begin
    r.Left := LineData.x;
    r.Top := LineData.y;
    r.Right := r.Left + LineData.w;
    r.Bottom := r.Top + LineData.h;
    DestCanvas.Pen.Width := 0;
    if LineData.Par.ParagraphType=wpIsTable then
    DestCanvas.Pen.Color := clRed
    else if LineData.Par.ParagraphType=wpIsTableRow then
    DestCanvas.Pen.Color := clBlue
    else DestCanvas.Pen.Color := clBlack;
    DestCanvas.MoveTo(r.Left, r.Top);
    DestCanvas.LineTo(r.Right, r.Top);
    DestCanvas.LineTo(r.Right, r.Bottom);
    DestCanvas.LineTo(r.Left, r.Bottom);
    DestCanvas.LineTo(r.Left, r.Top);
    DestCanvas.Pen.Color := clBlack;
    end;

    the root is the WPDRAW_TABLEBOX flag in lineflags which is set in WPRTEFormatB line 849 :

    linedata.lineflags := WPDRAW_TABLEBOX + WPDRAW_NOCURSOR

    Do you have an idea ? Comenting out WPDRAW_TABLEBOX seem to solve the problem but may have other sideeffects.

    I just bought wptools yeaterdays an am integrating it in an application to view emails. When loading html with tables in wpFormatAsWebpage mode, I get an anoying red border on the tables (it does not show in other modes).

    just doing this :

    cTest.AsWebpage:=[wpFormatAsWebpage];
    cTest.LoadFromString('<html><body><table><tr><td>abc</td></tr></table></body></html>','HTML',true);

    Display a single table cell with "abc" inside and a red border.

    Any Idea how to remove the red border ?

    Thanks.