Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Keyboard Tabbing column to column
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Keyboard Tabbing column to column

 Post Reply Post Reply
Author
Message
RonISAC View Drop Down
Groupie
Groupie


Joined: 22 December 2006
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote RonISAC Quote  Post ReplyReply Direct Link To This Post Topic: Keyboard Tabbing column to column
    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
 
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
RonISAC View Drop Down
Groupie
Groupie


Joined: 22 December 2006
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote RonISAC Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.