Beiträge von Kym
-
-
Thats what I did, theres a WPRichText on that form:
procedure Tfrm_ri_modelos_editor.FormCreate(Sender: TObject);
begin
WPRichText.Header.MarginFooter := 0;
WPRichText.Loaded;
end;Still nothing happen, I cant find to remove the unused part of the footer.
-
I tried to set it with:
- WPRichText.Header.MarginHeader := 0;
- WPRichText.Header.MarginFooter := 0;But nothing happens, I tried also to set it in design time, but still nothing happens, what am I missing?
-
Sometimes I can't find how to do simple stuffs too. For example, to set the initial values for the editor (width, height, pagesize, etc), I had to manually set these using the rulers (horizontal e vertical), then save a document, and then everytimes I open the editor I load this document.
One simple thing I'm trying to find out how to do is reduce the height of the ununsed area in the editor:
[Blockierte Grafik: http://www.louman.com.br/kym/wptools.jpg]
I want the vertical ruler to go to 30 not to pass 33, but I can't find where to set it.
-
-
Hi,
I have an instance of WPRichText with this:
"My name is <name>"
I want to replace "<name>" with the content of another WPRichText, so I did:
WPRichText1.Finder.ReplaceAll("<name>",WPRichText2.AsString);
The thing is, the replaced text apears as:
{\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset2 Wingdings;}{\f2\fnil\fcharset2 Symbol;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red128\green128\blue0;}\wpprheadfoot1\paperw12240\paperh20160\margl567\margr740\margt1167\margb2830\headery254\footery254\endnhere\sectdefaultcl{\
If I do:
WPRichText1.Finder.ReplaceAll("<name>",WPRichText2.Text);
Then its OK, but I loose the formatting I had in WPRichText2.
I tried with Finder using Finder.FoundText but it happens the same thing.
So I ask, How do I replace the token <name> in WPRichText1 with the content of another WPRichText without loose the text format and without have this RTF code?
Thanks
-
I resintall everything and I found now, but I'm still not able to login in the support area.
-
I reinstall everything and how the files are not missing anymore, even though I dont know where they are lol.
-
I'm trying to add WPSPell to my project but I'm facing a lot of "file not found" issues:
[DCC Error] E1026 File not found: 'WPSpell_Controller.res'
[DCC Error] E1026 File not found: 'WPSpell_OptForm.dfm'
[DCC Error] E1026 File not found: 'WPSpell_STDForm.DFM'Using: WPSpell_link, WPSpell_Controller, WPSpell_OptForm, WPSpell_StdForm;
I own a copy of WPTools6 Standard and the WPSpell (bought together).
What am I missing?
-
Hello, I own a copy of WPTools6 and a copy of WPSpell, but I cant seen to find where are the demos for them, so should I download it a part of the components or what?
EDIT: I tried to find it in http://support.wpcubed.com/ but my login isnt working anymore, how can I fix that too?
-
Zitat von wpsupport
Hi,
when you do a Print at once I would suggest a second ReformatAll(false, false) - this is important if the page number has more digits.
If this does not help add a
my_wp-SaveToFile( debugfile.rtf)
and check what is in that file.
It is also possible that You have some code in OnTextObjGetTextEx.
Julian
I think the ReformatAll(False, False) did the job, it is printing now the total pages number, but it doesnt save the footer to the RFT file, its not a problem since I dont need to save, but is it the right behavior? Also, Can you just take a look at if it is the place to put the code?
PS: I dont have any code in the OnTextObjGetTextEx.
Code
Alles anzeigenmy_wp.AsString := sds_comunicados_lri.FieldByName('CORPO').AsString; my_wp.Header.PageSize := wp_DinA4; my_wp.ActiveText := my_wp.HeaderFooter.Get(wpIsFooter,wpraOnAllPages); my_wp.InputString('Comunicado nº ' + sds_comunicados_lriNUMERO_COMUNICADO.AsString + '/' + sds_comunicados_lriANO_COMUNICADO.AsString + ', ' + 'de ' + sds_comunicados_lriDATA_COMUNICADO.AsString + ' - ' + 'Prenotado sob nº ' + sds_comunicados_lriCODRIPROT.AsString + #13); my_wp.InputString('Página '); my_wp.InputTextField(wpoPageNumber); my_wp.InputString(' de '); my_wp.InputTextField(wpoNumPages); my_wp.InputString(' - Impresso em: '); my_wp.InputTextField(wpoDate); my_wp.InputString(' '); my_wp.InputTextField(wpoTime); my_wp.ActiveText := my_wp.BodyText; ------>my_wp.ReformatAll(True,True); ------>my_wp.ReformatAll(False, False); my_wp.Print(); my_wp.SaveToFile('debugfile.rtf');
Finally, How do I set the font size only for the footer? I mean, I want Arial 11 to be used in footer, but I cant seen to find how to do it.
Thanks!
-
I'm trying to print the total pages in footer with this code:
Code
Alles anzeigenmy_wp.AsString := sds_comunicados_lri.FieldByName('CORPO').AsString; my_wp.Header.PageSize := wp_DinA4; my_wp.ActiveText := my_wp.HeaderFooter.Get(wpIsFooter,wpraOnAllPages); my_wp.InputString('Página '); my_wp.InputTextField(wpoPageNumber); my_wp.InputString(' de '); my_wp.InputTextField(wpoNumPages); my_wp.InputString(' - '); my_wp.InputTextField(wpoDate); my_wp.InputString(' '); my_wp.InputTextField(wpoTime); my_wp.ReformatAll(True,True); my_wp.ActiveText := my_wp.BodyText; my_wp.Print();
Everything prints fine, except the "wpoPageNumber", it prints nothing, and I get no error. The final result seens like:
Página 1 de [blank] - 20/09/2010 18:56:00
Where [blank] should say the total number of the pages.
Using D2010 with WPT6, what am I missing?
Thanks!
-
-
Zitat von wpsupport
Use ReformatAll(true, true)
As I said in the first post, I already tried ReformatAll(True,True), still doesnt update the screen.
Here's the code:
Code
Alles anzeigenwith frm_ri_prot_ap_editor do begin WPRichText.Refresh; WPRichText.Finder.Clear; WPRichText.Finder.ToStart; while WPRichText.Finder.Next('uma parte ideal*)') do WPRichText.Finder.FoundAttr.IncludeStyle(afsUnderline); WPRichText.ReformatAll(True,True); WPRichText.Modified := True; end;
-
Hello, no problem
But I'm not using the DBWPRichText, I'm using the regular WPRichText, then I load the text from database using WPRichText.AsString := Field[].AsString.
I know the text is updated because if I place the cursor over the lines that should be underlined the ToolBar shows the underline button correctly, but the only way I can update the screen is: save the data to the dabase and load it again with WPRichText.AsString := Field[].AsString.
What I want to do is refresh the WPRichText (on the screen) without have to save it to database, got it?
I tried to call "Changing" before and "ChangedText" after the changes, but still doesnt work, in fact, theres no ChangedText property or procedure in WPRichText.
-
Oh ok, its working now, Thanks.
-
Hello, how come everyone get an answer after your vacation time and I don't :(
-
I'm trying to do the same thing now in Delphi 2010 with WPTools6 but the paragraph is not protected anymore, does anything changed from WPTools5 to 6 to do the same thing?
Here's my code:
Codevar mem : TMemoryStream; myWP : TWPRichText;begin inherited; if modo_impressao then begin try myWP := TWPRichText.Create(Self); myWP.Visible := False; myWP.Parent := frm_ri_prot_ap_editor; myWP.Memo.DisableProtection; myWP.HideSelection; myWP.CPPosition := MaxInt; myWP.CurrAttr.AddStyle([afsProtected]); myWP.SelectionAsString := sds_ri_prot_apTEXTO.AsString; myWP.CurrAttr.DeleteStyle([afsProtected]); myWP.Memo.EnableProtection; mem := TMemoryStream.Create; try myWP.SaveToStream(mem); mem.Position := 0; WPRichText.CPPosition := MaxInt; WPRichText.Memo.LoadFromStream(mem, true, '', true, nil, AfterLoadEvent); WPRichText.InsertPar; finally mem.Free; end; finally FreeAndNil(myWP); end; end;
And the AfterLoadEvent:
Code
Alles anzeigenprocedure Tfrm_ri_prot_ap_editor.AfterLoadEvent(RTFData: TWPRTFDataCollection; Stream: TStream; Reader: TWPCustomTextReader; OnlyBodyText: Boolean; var LoadedText: TWPRTFDataBlock); var aPar : TParagraph; i : Integer; atr : TWPStoredCharAttrInterface; begin // Use a TWPStoredCharAttrInterface to update all character attributes atr := TWPStoredCharAttrInterface.Create(RTFData); aPar := LoadedText.FirstPar; // Paragraph Loop while aPar<>nil do begin aPar.ASet(WPAT_ParProtected, 1); for i:=0 to aPar.CharCount-1 do begin atr.CharAttr := aPar.CharAttr[i]; atr.IncludeStyle(afsProtected); aPar.CharAttr[i] := atr.CharAttr; end; aPar := aPar.next; end; atr.Free; end;
Just to remember, I'm trying to add a text loaded from database as a protected paragraph into a WPRichText.
Thanks in advance,
KymEDIT: The text is added to the WPRichText but its not protected!
-
I'm trying to add some styles to the text using:
Code
Alles anzeigenwith frm_ri_prot_ap_editor do begin WPRichText.Refresh; WPRichText.Finder.Clear; WPRichText.Finder.ToStart; while WPRichText.Finder.Next('uma parte ideal*)') do WPRichText.Finder.FoundAttr.IncludeStyle(afsUnderline); WPRichText.Refresh; end;
With the content of the WPRichText as the following:
01) MARIA ANTONIA JACYNTHO DOS SANTOS PICCAGLI, brasileira, viuva, do lar, portadora do RG/SSP/SP nº e do CPF nº , uma parte ideal equivalente a sessenta por cento (60%);
The bold part is where I'm adding the underline style.
When I run the code, I can see that the style is updated with the Underline option, but the screen is not updated unless I save it to the database and load again.
I tried to refresh with .Refresh, .DelayedReformat and .ReformatAll but none of these seen to update the screen, what am I missing?
PS: Using Delphi 2010 and WPtools 6.
-
I got it already, thanks!