Good day to all!
I am having problem with retrieving focused text in RichView. In documentation it is written that whit GetFocusedItem I can get the ItemNo of focused item. But RVData is nil and ItemNo is -1. Why can it be? Text style has "Jump" set to true, using tabs i switched between items, but can't get focused item.
RichView.GetFocusedItem(RVData, ItemNo) - RVData is nil
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I have found some interesting thing. If I focus on this item and then press Enter, OnJump event is called. And in this event GetFocusedItem works properly. But if I click on item with right button (item gets dooted frame) to call my popupmenu, click on some menu item and try to call GetFocusedItem in menuitemclick procedure, RVData is nil.
I have found out what the problem was.
Before calling GetFocusedItem I called SelectionExists. And SelectionExists resets focus. I have replaced with and now everything works properly.
Before calling GetFocusedItem I called SelectionExists. And SelectionExists resets focus. I have replaced
Code: Select all
RichView.SelectionExists
Code: Select all
RichView.RVData.SelectionExists(false, false)