![]() |
Shifting Focus while Tabbing in a toolbar |
Post Reply
|
| Author | |||
mwest
Newbie
Joined: 13 June 2005 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Topic: Shifting Focus while Tabbing in a toolbarPosted: 13 June 2005 at 5:00pm |
||
|
How do you shift focus along with the selection (highlight) when tabbing through controls (like CControlComboBoxEx)?
I am having trouble getting certain notifications. Take a look at the Custom Themes Sample. How can you make it enter focus into the "masked" combo box when the user tabs from a previous control like the "new" box? The user should be able to start typing without having to hit <enter> first. Thanks. |
|||
![]() |
|||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 June 2005 at 5:05am |
||
|
Thank you for this good suggestion. We changed this behaviour.
|
|||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
mwest
Newbie
Joined: 13 June 2005 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 June 2005 at 9:52am |
||
|
Will this change be in a future release? If so, what did you do to move the focus?
|
|||
![]() |
|||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 June 2005 at 7:24am |
||
|
It is added for 9.70 release. Key handled in CXTPCommandBar::OnKeyDown.
|
|||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
mwest
Newbie
Joined: 13 June 2005 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 August 2005 at 5:26pm |
||
|
For those out there, I came up with an ugly hack to get the tabbing to
work (the cursor enters an edit box or a dropdown, regardless of
whether it is inherited from CWnd or CXTPControl) without altering the
Code Jock source code. The work-around is not pleasant, but it
seems to work. If there is a better solution, I would love to
hear it.
1) Because we cannot alter CXTPCommandBar and we cannot use a custom CommandBar, we need to make a new class that inherits from CXTPToolBar. Call it CToolBarEx or something. 2) When adding the toolbar that needs the tabbing behavior in CMainFrame:: OnCreate, explicitly indicate what toolbar class to use:
3) In the CToolBar class, override the OnKeyDown(UINT nChar). Take note this is a custom Codejock method and not the standard OnKeyDown we all know and love. 4) The body of the OnKeyDown should be:
The code essentially sets the next control up for focus and calls an extra OnKeyDown, but with VK_ENTER so that all the codejock code will perform like normal. The ‘if(tag == 42 )’ statement is noteworthy because we want to check to see if this control requested the tabbing-enter (You might not want an Enter performed on a button). 5) When making the control set the Tag data to flag it wants to be a part of the tab-enter in CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl).
6) Test it |
|||
![]() |
|||
g_j_a_i_n
Groupie
Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2005 at 5:23am |
||
|
Fantastic ! Thank you so much for sharing. Thank you. With your suggestion, the following statement has solved the problem: return CXTPCommandBar::OnKeyDown(VK_RETURN); The mistake I did was that I always returned TRUE. I am still not sure how you got this idea. ![]() I was having problem with removing the focus from the combo box totally. What I was not able to do. Thanks again ![]() Regards, Gautam Jain |
|||
![]() |
|||
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |