Does anyone have an example to loop through the currattr or par styles of a document?
I would like to remove all indents unless it is a bulleted or numbered list and in that case, I would like to increase the indent.
Thank you.
-d
Beiträge von Damon
-
-
It is VCL forms project. I will try your suggestion. Thank you.
-
Thanks for the info!
-
I cannot for the life of me get the cursor to show up in a wprichtext after loading a file unless I manually click on the wprichtext.
-
I worked around this by using my own open dialog action instead of the wpaopen action.
-
currentfile := wprichtext1.Memo.FileLoadNameAndPath;
When using afterexecute of wpaopen default action, the code above returns the loaded file if you open an rtf file, but if you open a word file it returns nothing.
How do I get the file name and path from the wpaopen dialog action?
thanks, -d -
Thanks Julian, I take your advice and not start with white font and have it working correctly now.
-
Julian, I try the code above, it does keep other text color formatting, but does not change white text at all.
Maybe it is because my default on wprichtext1 the settings I start with are black paper color and white font color?
-damon -
Thanks, I know I can invert the color of text in the entire document (or change to any color) by just assigning the color,
However, I want to preserve existing colors. That is why I need to go through the entire document attr by character in some manor.
If on word is RED, I want to keep it red, but still change all white words to black.
-Damon -
Can't figure out why this doesn't work.
It has no effect on the color of the text. I just want to detect all white text in the document and change it to black, leaving all other colors how they exist.
Thanks for any help.Code
Alles anzeigenif wprichtext1.PaperColor = clblack then begin wprichtext1.PaperColor := clwhite; wprichtext1.SelectAll; progressbar.Maximum := wprichtext1.SelLength; progressbar.Update; WPRichText1.CPPosition := 0; with WPRichtext1.cpattr do begin beginupdate; WPRichtext1.CPPosition := 0; repeat if WPRichText1.CPAttr.Color = clwhite then wprichtext1.CPAttr.Color := clblack ; progressbar.Position := wprichtext1.CPPosition; progressbar.Update; until wprichtext1.CPMoveNext = FALSE; endupdate; end; wprichtext1.HideSelection; wprichtext1.Refresh; wprichtext1.CPPosition := lastpos; wprichtext1.Refresh; end else
-
Is this possible to change/add file types in the default wpaopen action for a wprichtext?
-
I would like to print the contents of a wprichtext as it is displayed on screen, with the visual word wrapping, but in a different font size.
So I need to convert word wraps to #13 I am guessing before I decrease the font size.
I used to use:
wprichtext1.memo.fastappendactiveline
and
wprichtext1.lines.add(#13)
but this no longer works.
I tried using wprichtext1.lines[] but that returns entire paragraphs. -
>> wprichtext saves even when you click NO
Any one else experience this? it's driving me nuts. I'm using the default actions, i click close file and no to the save changes, but the changes get saved no matter what.
-
I'm not following.
There does not seem to be a direct relation between topoffset and memo.textheight.
In my application with wprichtext at the end of file, the topoffset is 18457 and the textheight is 119600. (6 times larger)I need to know if the user has scrolled to the end of the file and if so, send them a message and update another control.
I used to do this with the following code:if wprichtext1.topoffset >= wprichtext1.getverttextsize-300 then do more.
300 is just a number I found that worked well in testing.Is there any way to detect end of file already built into the wprichtext control?
thanks. -d -
this call is no longer available in version 6. Is there a replacement so you can get the value of the max topoffset for the current document?
-
I know there are lots of getcp sort of functions, i'm trying to put a few together to achieve the following.
Say you are half way through a document, and viewing full screen, If you resize to windowed, what was the top line in view is no longer positioned at the top of the screen, it is several lines down.
Prior to window resize, I need to get the actual cp in the file, then after resize is complete, somehow move the yoffset so that what was the top line (or just word due to wprapping) in view goes to the top line in the new window size.
-damon -
Thank you. I will try that.
-
Jeremy, fwiw, I got this problem worked around in my install.
D2010 wptools 6.14.
I used the solution for wptools 5 at this post:
http://wpcubed.com/forum/viewtopi…preview+buttons
Made a backup of the wpprvfrm.dfm file in my D2010 wptools source folder and replaced with the downloaded file. I rebuilt the project and the close, print, and print setup buttons now have images.Julian will have to confirm if this is a valid fix for version 6 or not. It's working for me.
-damon -
I am seeing the exact same problem with the print preview dialog not having any glyphs or captions on the buttons.
-
First off, why doesn't this work:
This code should copy wp1 to wp2 then if the wppreview dialog is assigned wp2 then the preview should show it. ???
Not only is the preview blank, but the wprichtext2 never gets populated.
procedure TForm1.Action1Execute(Sender: TObject);
var
printtext : Tmemorystream;
begin
printtext := Tmemorystream.create;
wprichtext1.rtftext.SaveToStream(printtext);
wprichtext2.rtftext.LoadFromStream(printtext);
wprichtext2.Update;
showmessage('preview');
wppreviewdlg1.Execute;
end;On a side note, I thought maybe I could use wprtfstorage and it would just be a live duplicate all the time, but after assigning the links for the 2 wprichtext components, I try to run the program and get "text buffer corrupt" and cannot run the program.
The object here is to take a wprichtext with black paper and white text and convert it to white paper with black text for printing and viewing from the preview window.
-damon