Hello!!
How can I let the user right-click a bookmark, and prompt him to delete or not the bookmark?? And how can I say that the text right-clicked is realy a bookmark??
Thanks!
Hello!!
How can I let the user right-click a bookmark, and prompt him to delete or not the bookmark?? And how can I say that the text right-clicked is realy a bookmark??
Thanks!
Ok, I already figured out how to delete the bookmark with right-click. But now, I have another problem: when I delete a bookmark the first time, averything goes fine. So, I add another bookmark in the exact same place where the other were. Now, when I delete that second bookmark, it is delete from the bookmark list, but the text remains in the WPRichText component until I the application is closed. Please, somebody help me.
And sorry for my bad english...
Hi,
Bookmarks conists of start and end tags, <a name = ..>text</a>
so deleiting the bookmarks only means the tags <a> and </a> is deleted. The closing is usually deleted - you can check that when enabling the display of bookmarks in ViewOptions.
To delete the text, too, you can use BookmarkSelect and then ClearSelection.
Julian Ziersch
Thanks Julian, but i'm already using BookmarkSelect and ClearSelection. The first time, everything goes well, but when I insert a new bookmark in the same place, and then delete tha bookmark, the bookmark is deleted from the bookmark list, but the text remains. I don't understand this... :shock:
Here is the code I'm using:
procedure InsertTag(var Editor: TWPRichText; TagName: String);
begin
TagName := Concat(TagStart, TagName, TagEnd);
Editor.HideSelection;
Editor.CurrAttr.AddStyle([afsProtected]);
Editor.InputString(TagName);
with Editor.Finder do
begin
Next(TagName);
Editor.SetSelPosLen(Editor.Finder.FoundPosition, Editor.Finder.FoundLength);
end;
Editor.BookmarkInput(TagName);
Editor.HideSelection;
end;
procedure RemoveTag(var Editor: TWPRichText; TagName: String);
begin
TagName := Concat(TagStart, TagName, TagEnd);
Editor.BookmarkSelect(TagName, False);
Editor.ClearSelection;
Editor.BookmarkDelete(TagName, True, True);
end;
Alles anzeigen
Something wrong with that??
Thanks
I tried this too, but didn't work either:
Hi,
the text is protected - no change is accepted as long as it is protected, even not DeleteStyle(afsProtected)!
You need to set ProtectedProp = [] and when you are finished restore the original value.
Julian