WPCubed Product Support

auto-selection of paragraphs

In my application, almost all actions - point size, styles, etc - are performaned on complete paragraphs, not so much on individual words, etc.

Is there anyway where i can control WPTools so that instead of the built in selection methods, complete paragraphs are selected instead?

For example, after the user makes a selection, can i alter the selection so that it begins and ends with a complete paragraph being selected?

thanks!

Alan

#1 ♥ 0
3.1k Views 2 users read 1 min
support

Hi,

For example, after the user makes a selection, can i alter the selection so that it begins and ends with a complete paragraph being selected?

a kind of mean trick in OnChangeSelection

procedure TForm1.WPRichText1ChangeSelection(Sender: TObject);
begin
  if WPRichText1.TextCursor.block_reverse then
  begin
  WPRichText1.TextCursor.block_e_posinpar := 0;
  WPRichText1.TextCursor.block_s_posinpar := $FFFF;
  end else
  begin
  WPRichText1.TextCursor.block_s_posinpar := 0;
  WPRichText1.TextCursor.block_e_posinpar := $FFFF;
  end;
end;

Regards,

Julian

#2 ♥ 0
This category is archived. No new posts are possible.