Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Tab behaviour
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tab behaviour

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

Joined: 18 June 2007
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Osiris Quote  Post ReplyReply Direct Link To This Post Topic: Tab behaviour
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Osiris View Drop Down
Groupie
Groupie
Avatar

Joined: 18 June 2007
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Osiris Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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: 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post 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...
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: 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 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: 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 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.188 seconds.