After looking at the numbering demo I have the following questions.
a) it appears that after each carriage return a new number is issued. If formating is done after the document is created and two carriage returns are issued to create a blank line between paragraphs, the blank line is also numbered.
Is there a mechanism to prevent numbering of blank lines between paragraphs?
b) If I use the code below and raise the speed button, the numbering is removed, but in paragraphs consisting of more than one line, all lines after the first line continue to remain indented.
Is there a mechanism to restore the entire paragraph back to its "non indented" state via code?
c) I do not think this is possible, but one does not know what one does not know. Instead of using the case statement to define the tempStyle variable (see the OnClick method below), is it possible to: a) take the text of the wwDBComboBoxNumber b) type cast the string as a TWPNumberStyle and c) eliminate the case statement? Something like the following?
var tempString: String; tempPointer: PChar; tempStyle: TWPNumberStyle;begin tempStyle := wwDBComboBoxNumberStyle.Text as TWPNumberStyle;
or
tempString := wwDBComboBoxNumberStyle.ToString;
tempPointer := PChar(tempString);
tempStyle := tempPointer As TWPNumberStyle;
procedure TformWordProcessor.SpeedButtonNumberParagraphsClick(Sender: TObject);
var
tempIndent: Integer;
tempBeforeText: String;
tempAfterText: String;
tempStyle: TWPNumberStyle;
begin
tempBeforeText := '';
tempAfterText := '';
if SpeedButtonNumberParagraphs.Down = True then
begin
tempIndent := 360;
Case wwDBComboBoxNumberStyle.ItemIndex of
0: tempStyle := wp_none;
1: tempStyle := wp_bullet;
2: tempStyle := wp_circle;
3: tempStyle := wp_1;
4: tempStyle := wp_lg_i;
5: tempStyle := wp_i;
6: tempStyle := wp_lg_a;
7: tempStyle := wp_1st;
8: tempStyle := wp_One;
9: tempStyle := wp_First;
10: tempStyle := wp_unicode;
11: tempStyle := wp_char;
12: tempStyle := wp_01;
end;
WPRichText1.SelectAll;
WPRichText1.CurrAttr.BeginUpdate;
WPRichText1.CurrAttr.IndentLeft := tempIndent;
WPRichText1.CurrAttr.IndentFirst:= - tempIndent;
WPRichText1.CurrAttr.SetNumberStyle(
tempBeforeText,
tempAfterText,
'',
tempStyle,
tempIndent );
WPRichText1.CurrAttr.EndUpdate;
WPRichText1.HideSelection;
end
else
begin
wwDBComboBoxNumberStyle.ItemIndex := 0;
WPRichText1.SelectAll;
WPRichText1.CurrAttr.BeginUpdate;
WPRichText1.CurrAttr.IndentLeft := 0;
WPRichText1.CurrAttr.IndentFirst:= 0;
WPRichText1.CurrAttr.SetNumberStyle(
tempBeforeText,
tempAfterText,
'',
wp_none,
0 );
WPRichText1.CurrAttr.EndUpdate;
WPRichText1.HideSelection;
end;
TIA
John