Page 1 of 1

Tdbrichviewedit event

Posted: Wed Nov 26, 2014 1:27 pm
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

Posted: Wed Nov 26, 2014 3:59 pm
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.

Posted: Thu Nov 27, 2014 1:48 pm
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

Posted: Fri Nov 28, 2014 10:37 am
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;

Posted: Fri Nov 28, 2014 12:29 pm
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

Posted: Fri Nov 28, 2014 1:07 pm
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.