Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Excel style keyboard for report control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Excel style keyboard for report control

 Post Reply Post Reply
Author
Message
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Topic: Excel style keyboard for report control
    Posted: 14 June 2006 at 11:14am
I'm using the report control in a dialog. I have two columns and a variable number of rows (e.g. 7 rows). I'm basically using the report control as a simplified "grid control", which works well, except for the keyboard use. 

Although I've purchased a grid control (Dundas) I'd rather not use it (or any another grid control for that matter), because I want my validation/look+feel/etc to be uniform throughout the application.

My particular issues are:
1) When editing a cell, pressing Enter doesn't move to the next cell below.
2) When editing a cell, pressing the up/down arrow doesn't move to the next cell.

So my question/request is...

Is there a simple way to make the report control act like a grid control, or should I just catch the keyboard messages and try to respond appropriately? I guess I can derive + do this myself, but I imagine it's a common request, so maybe you could make up an "excel" sample app?

Thanks

Warren
Back to Top
pascal View Drop Down
Groupie
Groupie


Joined: 07 February 2005
Location: Germany
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote pascal Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2006 at 11:29am
Hi, we also need this feature. We used in the past the CUGGrid from Dundas. Please add the functionallity to a next release.
Pascal Verdier
Software Engineer Manager
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: 15 June 2006 at 4:24pm
Hi,

Report control has some standard behavior, and a lot of functionality for customization Wink

This feature could be implemented easily with handling XTP_NM_REPORT_PREVIEWKEYDOWN message. See below for an example:

ON_NOTIFY(XTP_NM_REPORT_PREVIEWKEYDOWN, XTP_ID_REPORT_CONTROL, OnReportPreviewKeyDown)
.....
void CYourForm::OnReportPreviewKeyDown(NMHDR * pNotifyStruct, LRESULT *result)
{
    XTP_NM_REPORTPREVIEWKEYDOWN* pKeyNotify = (XTP_NM_REPORTPREVIEWKEYDOWN*) pNotifyStruct;
    ASSERT(pKeyNotify);

    if (pKeyNotify->nChar == VK_DOWN)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveDown();
    }
    else if (pKeyNotify->nChar == VK_UP)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveUp();
    }
    else if (pKeyNotify->nChar == VK_RETURN)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveDown();
    }
}


--
WBR,
Serge
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.078 seconds.