Print Page | Close Window

Keyboard Tabbing column to column

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=8496
Printed Date: 23 November 2024 at 2:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Keyboard Tabbing column to column
Posted By: RonISAC
Subject: Keyboard Tabbing column to column
Date 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
 



Replies:
Posted By: Baldur
Date Posted: 01 November 2007 at 9:14am
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.


Posted By: RonISAC
Date Posted: 01 November 2007 at 10:57am
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.
 


Posted By: sserge
Date Posted: 05 November 2007 at 4:30pm
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


Posted By: mgampi
Date Posted: 02 June 2008 at 6:51am
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


Posted By: mgampi
Date Posted: 02 June 2008 at 6:58am
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net