I have been testing this component for a couple of days now and it looks like I need to buy it.
But I first need to figure out how to make bullets and numbering work on the DB version of the editor.
I have found a sample on this forum that has bullets and numbering, but when I copy the code to a DB version it stops working.
What might I be doing wrong?
Bullets and numbering
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
When the database is changed in an editing state, the content of DB-controls, including TDBRichViewEdit, may be reloaded.
In TRichView demos, the code for adding bullets is:
where CreateBullets may add a new item in RichViewEdit1.Style.ListStyles.
ApplyListStyle, before making the actual work, turns the database in an editing mode. So
1) bullets are added in RVStyle
2) database is switched to an editing state
3) the content of RichViewEdit (and the linked RVStyle) is reloaded, and the changes made on the step 1 are lost
4) the editor tries to apply non-existing bullets.
The solution: switching to an editing state before the whole operation. You can do in using CanChange:
In TRichView demos, the code for adding bullets is:
Code: Select all
RichViewEdit1.ApplyListStyle(CreateBullets,0,0,False,False);
ApplyListStyle, before making the actual work, turns the database in an editing mode. So
1) bullets are added in RVStyle
2) database is switched to an editing state
3) the content of RichViewEdit (and the linked RVStyle) is reloaded, and the changes made on the step 1 are lost
4) the editor tries to apply non-existing bullets.
The solution: switching to an editing state before the whole operation. You can do in using CanChange:
Code: Select all
if DBRichViewEdit1.CanChange then
DBRichViewEdit1.ApplyListStyle(CreateBullets,0,0,False,False);
I have made the button click like this now. But I still don't get any bullets.
The CreateBullets, CreateNumbering, GetListNo and CaretMove are copied from the demo in http://www.trichview.com/forums/viewtop ... +numbering
The CreateBullets, CreateNumbering, GetListNo and CaretMove are copied from the demo in http://www.trichview.com/forums/viewtop ... +numbering
Code: Select all
procedure TfrmMdEditor.btnBulletsClick(Sender: TObject);
begin
if RichViewEdit.CanChange then
begin
if btnBullets.Down then
RichViewEdit.RemoveLists(False)
else
RichViewEdit.ApplyListStyle(CreateBullets, 0, 0, False, False);
end;
end;
Sergey Tkachenko wrote:When the database is changed in an editing state, the content of DB-controls, including TDBRichViewEdit, may be reloaded.
In TRichView demos, the code for adding bullets is:where CreateBullets may add a new item in RichViewEdit1.Style.ListStyles.Code: Select all
RichViewEdit1.ApplyListStyle(CreateBullets,0,0,False,False);
ApplyListStyle, before making the actual work, turns the database in an editing mode. So
1) bullets are added in RVStyle
2) database is switched to an editing state
3) the content of RichViewEdit (and the linked RVStyle) is reloaded, and the changes made on the step 1 are lost
4) the editor tries to apply non-existing bullets.
The solution: switching to an editing state before the whole operation. You can do in using CanChange:Code: Select all
if DBRichViewEdit1.CanChange then DBRichViewEdit1.ApplyListStyle(CreateBullets,0,0,False,False);
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
That will take some work because I am using UniDAC as DB connection and some of my own utilities as well.
But I will give it a go and see if I can do it.
- is there a time limit and the trialversion I have installed? (if so I need to hurry up )
But I will give it a go and see if I can do it.
- is there a time limit and the trialversion I have installed? (if so I need to hurry up )
Sergey Tkachenko wrote:Can you send me a simple example to richviewgmailcom?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: