Tdbrichviewedit event

General TRichView support forum. Please post your questions here
Post Reply
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Tdbrichviewedit event

Post by jota »

Hi.

I´m using the onchange event of a tdbrichviewedit component to detect a change in the number of styles.

It would be enough to know if the number of styles has changed, just before leaving the component. Is there some event where this can be done?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you mean changing TextStyles, ParaStyles, and ListStyles?
You can compare count with previously saved value in OnExit event.

---

Some useful info.


If styles are added as a result of:
- RVF insertion
- RTF loading or insertion
- operation with StyleTemplates
- changing keyboard language with rvoAutoSwitchLang in EditorOptions,
TRichViewEdit.OnAddStyle occurs.

If you use RichViewActions, if styles are added by RichViewActions, TRVAControlPanel.OnAddStyle occurs.
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Post by jota »

Hello

My code is as follows

If I leave the "TDBRichViewEdit" component by clicking the mouse on a node in the "TTreeView" component; the variable "tnNodAux" stores information for that node.

But I need to save the selected node just when leaving the "TDBRichViewEdit"

Code: Select all

# TDBRichViewEdit NoteEdit. OnExit event

procedure TSDIAppForm.NoteEditExit(Sender: TObject);

var
  tnNodAux: TTreeNode; // Node (auxiliar)

begin

  # TTreeView TreeOpc 	
  tnNodAux := TreeOpc.Selected;

  # TRVStyle NoteEditStyles	
  tnNodAux.ImageIndex := NoteEditStyles.TextStyles.Count;

end;
Thanks in advance
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you just need to save changes, you can call:

Code: Select all

if DataSet.State in [dsEdit, dsInsert] then
    DataSet.Post;
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Post by jota »

hello

My problem is this.

I have a TTreeView component. Selecting a node, the focus goes to a TDBRichViewEdit component.

Just before leaving the TDBRichViewEdit component (eg by clicking the mouse on another node in TTreeView component), I need to store 'tnNodAux: = TreeOpc.Selected;'.

If I do it in the OnExit event in TDBRichViewEdit component, variable stores the last node selected with the mouse.

I need to store the TTreeView selected node just in time before leaving the component TDBRichViewEdit

Thanks
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You switching records in your own code (probably in TreeView.OnSelect)?
So you can call all necessary additional code in the same event, not in OnExit/OnEnter.
Post Reply