Beiträge von mwilliams

    Is WPTools 7 no longer supported. I can't see a forum for it.

    And this seems to be the only forum I can create a new thread in. So...

    WPTools 7.

    I want to store a hint with hyperlink objects.

    I thought I could use the Extra property, but when ever I try to add text it triggers an access violation. Looking at the code, it seems "Extra" is never actually created.

    Next thought was to store the hint as part of the display text and then use OnTextObjGetTextEx to manipulate the displayed text.

    Assumed this would be as simple as setting PrintString to the text I wanted, but that doesn't seem to be the case. If I wanted, for example, to change the displayed text to "Hello", how would I go about that?

    Next problem I faced was how to get the text object under the mouse in the mouse move event. Thought CodeObjectAtXY would get it, but it only fires when you are on the far right of the object and the far left of it (including from the edge of the object to the far left margin). GetObjectFromXY does the same.

    Many thanks.

    When I insert a new paragraph as a "heading" I am trying to set its its properties so that the next paragraph does not become orphaned and g on to the next page. I am using using WPAT_ParKeepN

    to achieve this, which it does. However, the next paragraph is now allowed to split and I cannot find any property to allow the net para to split over the page.

    I am getting this result:

    HEADING

    Next paragraph text

    Next paragraph text

    Next paragraph text

    ---------------------------------------- Page break--------------------------

    Another paragraph text


    I am trying to achieve this:

    HEADING

    Next paragraph text

    ---------------------------------------- Page break--------------------------

    Next paragraph text

    Next paragraph text

    Another paragraph text

    Is this possible?

    Hi Julian,

    Here's a print out from the Madshi bug report. Maybe this is sufficient. If not, I'll try manual freeing as suggested and see what that outputs.

    callstack crc : $4e13e0b8, $6ead7e03, $afdc3cb4

    exception number : 1

    exception class : EAccessViolation

    exception message : Access violation at address 0085E62A in module 'Will_Writer.exe'. Read of address 090B4214.

    thread $484:

    0085e62a +05e Will_Writer.exe WPCTRMemo 13830 +12 TWPCustomRtfEdit.Notification

    00883792 +09e Will_Writer.exe WPCTRRich 4781 +11 TWPCustomRichText.Notification

    0047a2ec +04c Will_Writer.exe Classes TComponent.Notification

    00497173 +00f Will_Writer.exe Controls TControl.Notification

    004aff5c +010 Will_Writer.exe Forms TCustomForm.Notification

    0047a1b1 +01d Will_Writer.exe Classes TComponent.RemoveComponent

    0047a021 +061 Will_Writer.exe Classes TComponent.Destroy

    00496f04 +0a0 Will_Writer.exe Controls TControl.Destroy

    00499f57 +0bb Will_Writer.exe Controls TWinControl.Destroy

    0049f955 +01d Will_Writer.exe Controls TCustomControl.Destroy

    008516a0 +184 Will_Writer.exe WPCTRMemo 6356 +38 TWPCustomRtfEdit.Destroy

    00880bf3 +097 Will_Writer.exe WPCTRRich 3607 +17 TWPCustomRichText.Destroy

    00499f27 +08b Will_Writer.exe Controls TWinControl.Destroy

    004ca609 +039 Will_Writer.exe ComCtrls TTabSheet.Destroy

    00499f27 +08b Will_Writer.exe Controls TWinControl.Destroy

    004c996e +03e Will_Writer.exe ComCtrls TCustomTabControl.Destroy

    004caa11 +049 Will_Writer.exe ComCtrls TPageControl.Destroy

    00499f27 +08b Will_Writer.exe Controls TWinControl.Destroy

    004af154 +028 Will_Writer.exe Forms TScrollingWinControl.Destroy

    004afe03 +0ab Will_Writer.exe Forms TCustomForm.Destroy

    00403324 +008 Will_Writer.exe System TObject.Free

    004b36e0 +000 Will_Writer.exe Forms TCustomForm.CMRelease

    00498d75 +111 Will_Writer.exe Controls TControl.WndProc

    0049b906 +1d2 Will_Writer.exe Controls TWinControl.WndProc

    004b0c62 +3aa Will_Writer.exe Forms TCustomForm.WndProc

    0049b508 +02c Will_Writer.exe Controls TWinControl.MainWndProc

    004ae1a0 +014 Will_Writer.exe Forms StdWndProc

    779aa56b +00b user32.dll DispatchMessageA

    004b69af +083 Will_Writer.exe Forms TApplication.ProcessMessage

    004b69e6 +00a Will_Writer.exe Forms TApplication.HandleMessage

    004b6bf1 +081 Will_Writer.exe Forms TApplication.Run

    00d8d5e7 +03b Will_Writer.exe Will_Writer 93 +3 initialization

    77b4fa27 +017 KERNEL32.DLL BaseThreadInitThunk

    thread $46a8 (TWorkerThread):

    774711a3 +93 KERNELBASE.dll WaitForSingleObjectEx

    774710fd +0d KERNELBASE.dll WaitForSingleObject

    00533f13 +17 Will_Writer.exe VirtualTrees 5065 +3 TWorkerThread.Execute

    00462233 +2b Will_Writer.exe madExcept HookedTThreadExecute

    00479d58 +1c Will_Writer.exe Classes ThreadProc

    00404104 +28 Will_Writer.exe System ThreadWrapper

    00462115 +0d Will_Writer.exe madExcept CallThreadProcSafe

    0046217f +37 Will_Writer.exe madExcept ThreadExceptFrame

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    >> created by thread $484 at:

    00533e42 +16 Will_Writer.exe VirtualTrees 5028 +1 TWorkerThread.Create

    thread $480:

    7747b24d +fd KERNELBASE.dll WaitForMultipleObjectsEx

    00462115 +0d Will_Writer.exe madExcept CallThreadProcSafe

    0046217f +37 Will_Writer.exe madExcept ThreadExceptFrame

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    >> created by thread $484 at:

    77763fb7 +00 combase.dll

    thread $3c98:

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    thread $3390:

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    thread $41c0:

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    thread $2fb8:

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    thread $3640:

    77b4fa27 +17 KERNEL32.DLL BaseThreadInitThunk

    I am trying to get wprichtext to work like Word when a user backspaces at the start of a numbered or bulleted paragraph. And also with an indented para. I am not getting very far!

    Code so far:

    The first section of the code only works if a top level number/bullet. Not sure how to get it to decrease the indent by 1. Any pointers please?

    Julian,

    I have looked at the BeforePasteEvent.

    I assume that I work with the rtfData paramter and do something like

    Code
    var p:TParagraph;
    begin
      p:=RTFData.FirstPar;
      while assigned(p) do
        begin
    	[Get the fields and reset the attribute]
          p:=p.NextPar;
        end;

    However, I am not quite sure if this is right and, if so, how I get a reference to the hyperlink objects in each para.

    I have checked the help file I downloaded with version 7 (in chm format) and it seems to be broken, clicking on the document indexes does not open the relevant help. I have found the WPTools7 manual online, but I couldn't find anything which helped. Can you please point me in the right direction as to what I need to do here? Can you also tell me where I can find the help file for download in chm format?

    Thanks

    Julian,

    I am pasting text from word and after pasting, I am inserting a new hyperlink inside the pasted text using inputhyperlink. Does the hyperinktextattr not override the pasted word attributes?

    If not, what do I need to do in the onBeforePateEvent so stop pasted text overriding the hyperlinktextattr? I wouldn't know where to begin!

    Thanks

    Mark

    I have set the properties of the hyperlinktextattr for a richtext to

    HyperlinkTextAttr.Underline = tsFALSE
    HyperlinkTextAttr.NotUsedForSpellAsYouGo = True
    HyperlinkTextAttr.UnderlineColor = clBlue
    HyperlinkTextAttr.TextColor = clHighlight
    HyperlinkTextAttr.UseUnderlineColor = True
    HyperlinkTextAttr.UseTextColor = True
    HyperlinkTextAttr.HotUnderlineColor = clRed
    HyperlinkTextAttr.HotTextColor = clHighlight
    HyperlinkTextAttr.UseHotTextColor = True
    HyperlinkTextAttr.HotUnderline = tsFALSE
    HyperlinkTextAttr.HotEffect = wpeffPopup
    HyperlinkTextAttr.HotStyleIsActive = True
    HyperlinkTextAttr.HotEffectColor = clBtnFace

    This all works fine in general. However, I have pasted a document from MS Word into the richtext and if I insert a hyperlink using hyperlinktextattr inside that text the text does not appear highlighted. The hover effects work however. Any ideas why that might be happening? any work around?

    It doesn't happen with all text pasted into the rich text just certain texts.

    I can's seem to get this to work. Have followed instructions in pdf help (btw there seems to be a problem with the chm file. None of the items you click on actually displays anything).

    Add a richtext.
    Add an action list.

    Set richtext's actionlist.

    Add a combobox.

    Add a TWPToolsCustomEditControlAction to the action list.

    Set its attached control to the combobox.

    The help file says "the property AttachedControlStyle is ignored". How then do you tell the action what it is supposed to do? Ie should it be a font or a fontsize combo.

    I am setting AttacheControlStyle to one of the font combos, but I just have an empty combobox when I run.

    How should I do this please?

    The code I sued for WPTools 5 for inserting a page no in the footer no longer seems to work in WPTools7. However, it is the same code that appears at 45 of the pdf manual for WPTools 7. Any ideas? code is:

    var par : TParagraph;
    txtplain : Cardinal;
    begin
    par:=WPRichText1.HeaderFooter.Get(wpFooter,wpraOnAllPages).
    FirstPar;
    WPRichText1.WritingAttr.Clear;
    WPRichText1.WritingAttr.SetFontName('Courier New');
    WPRichText1.WritingAttr.SetFontSize(900); // 9pt
    txtplain := WPRichText1.WritingAttr.CharAttr;
    par.ClearText;
    par.ASet(WPAT_Alignment, Integer(paralRight));
    par.Insert(0,'Page ',txtplain);
    par.InsertNewObject(maxint, wpobjTextObject, false, false,
    txtplain).Name := WPTextFieldNames[wpoPageNumber];
    par.Insert(maxint,' of ',txtplain);
    par.InsertNewObject(maxint, wpobjTextObject, false, false,
    txtplain).Name := WPTextFieldNames[wpoNumPages];
    end;

    I use the above action to set indents. When you are at the start of a paragraph indented using this action I would like the backspace key to decrement the indent. I could do that presumably by calling WPADecIndent execute, but how do I detect when I am at the start of paragraph that has been indented using WPAIncIndent.

    Thanks