Print Page | Close Window

Tab behaviour

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=7578
Printed Date: 14 May 2024 at 4:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tab behaviour
Posted By: Osiris
Subject: Tab behaviour
Date Posted: 11 July 2007 at 4:40am
Hello,

I want to implement the following behaviour for a property grid. After a value has been altered via keyboard input and the user hits the tab key the focus shall be set to the next property item and its content shall be selected automaticaly, so that the value is overwritten as soon as a key is pressed.

Does the Xtreme PropertyGrid already have this behaviour or do I have to implement it myself? If second, how would I do that (can I catch the TabPressed event and set the focus tio the next item)?

Thanks
Stefan



Replies:
Posted By: Oleg
Date Posted: 11 July 2007 at 5:36am
Hello,
 
You can call m_wndPropertyGrid.NavigateItems(TRUE); to allow tab all items.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Osiris
Date Posted: 11 July 2007 at 8:36am
Hi Oleg,

thank you for the fast response!

But is there a way to prevent the key portion of an item (left part) from getting the focus? I want to step via the tab key through the item values only (value1->value2->value3 instead of value1->key2->value2->key3->value3).

Thanks in advance
Stefan


Posted By: Oleg
Date Posted: 12 July 2007 at 1:30am
Hello,
Override
void CXTPPropertyGrid::OnNavigate(XTPPropertyGridUI nUIElement, BOOL bForward, CXTPPropertyGridItem* pItem) method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mgampi
Date Posted: 25 February 2008 at 3:30pm
Hello Oleg;
 
I need your help, how to Overwrite OnNavigate to get the results Stefan mentioned in his previous post.
Which part of OnNavigate has to be changed to tab through key1 -> key 2 -> key 3 ...
 
Thanks in advance


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Barto
Date Posted: 27 February 2008 at 10:30am
I did something like this to move the focus to the next item upon pressing RETURN:
 

void CXTPPropertyGridInplaceEdit2::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
 // on ENTER automatically go to next row and activate edit
 CXTPPropertyGridItem* pItem = GetItem();
 if(nChar == VK_RETURN && pItem && pItem->GetGrid()) {
  CXTPPropertyGridView* pGrid = pItem->GetGrid();
  int nIndex = pItem->GetIndex();
  if (nIndex < pGrid->GetCount() - 1) {
   if(pGrid->GetItem(nIndex+1)->IsCategory())
    nIndex++;
   if (nIndex < pGrid->GetCount() - 1) {
    pGrid->SetFocus();
    pGrid->SetCurSel(nIndex+1);
    pGrid->OnSelectionChanged();
    pItem = pGrid->GetItem(nIndex+1);
    pItem->OnSelect();
    pItem->SetFocusToInplaceControl();
    return;
   }
  }
 }
 
 CXTPPropertyGridInplaceEdit::OnChar(nChar, nRepCnt, nFlags);
}
 
this is code for XTP 9.81, dunno if it still works...


Posted By: mgampi
Date Posted: 27 February 2008 at 5:25pm

Hi Barto;

Thanks for your suggestions. In my case this is to restrictive because it depends on the edit control to be activated to navigate from item key to item key. Additional, in our case we have several items that do not have CXTPPropertyGridInplaceEdit derived edit controls. This would result in code duplication or multiple inheritance.

So I have to look for another solution to get the required results.



-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: mgampi
Date Posted: 07 March 2008 at 7:28am
Hi;
If someone is interrested in this. I got informed that the behaviour requested will be contained in the next release.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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