Keyboard Tabbing column to column |
Post Reply |
Author | |
RonISAC
Groupie Joined: 22 December 2006 Location: United States Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 22 October 2007 at 6:50pm |
I have a application running that did tab to the next right most column when the user pressed the Tab key in an Inplace control. The process worked fine in v10.3 of the toolkit, but now that I have upgraded to v11.2 this process stopped working.
My current code looks like:
void CTNVWPoints::OnPreviewKeyDown(NMHDR * pNotifyStruct, LRESULT * result){ XTP_NM_REPORTPREVIEWKEYDOWN *pKeyNotify = (XTP_NM_REPORTPREVIEWKEYDOWN *)pNotifyStruct; ASSERT(pKeyNotify); if (pKeyNotify->nChar==VK_TAB){ pKeyNotify->bCancel=TRUE; GetReportCtrl().GetNavigator()->MoveRight(); GetReportCtrl().GetNavigator()->BeginEdit(); ...
}
}
What I discovered is that the Navigator->MoveRight() function appears to work and select the next column, however after the call to ReportCtrl->AdjustScrollbars() at the beginning of the Navigator->BeginEdit() function, the ivar ReportCtrl->m_pFocusedColumn is cleared to NULL and the rest of Navigator->BeginEdit() is skipped.
The net result is that the expected column is not openned for editting and the focused column is lost (focused row remains ok).
Do you have a suggested Tabbing technique for v11.2?
Thanks in advance
RonISAC
|
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
Why do you not use the default functions of the ReportControl ?
If the Report is editable and FocusSubItems is true, the ReportControl does this automaticly for you.
|
|
RonISAC
Groupie Joined: 22 December 2006 Location: United States Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Baldur,
Thanks for the suggestion, but that function does not give me the behaviour that I wanted.
I have found a work-around that replaces the navigator BeginEdit function, which doesn't work, with the Report EditItem function.
Example:
...
GetReportCtrl().GetNavigator()->MoveRight();
pCol = GetReportCtrl().GetFocusedColumn();
pCol->EnsureVisible();
pRow = GetReportCtrl().GetFocusedRow();
pItem = pRow->GetRecord()->GetItem(pCol);
Args.pRow = pRow;
Args.pColumn = pCol;
Args.pItem = pItem;
Args.pControl = &GetReportCtrl();
GetReportCtrl().EditItem(&Args);
...
Lastly, to allow the Tab key to move beyond an inplace List control, I needed to modify the CXTPReportInplaceList::OnKeyDown() method.
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
When I add your code into HeaderFooterView of ReportSample, it works fine. Try it, and then validate difference between your control settings and a sample one. -- WBR, Serge |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi;
In version 12.0 the behaviour seems to be still wrong.
I try to tab between items and also the mentioned solution with direct call to EditItem does not word. As I can see, GetNavigator()->MoveRight() selects the wrong column (to the left of the currenly focused item) !!!
But I will dig into this.
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi;
I found my mistake: Don't call EndEdit(0) in OnPreviewKey() handler when editing is still in progress!
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |