views:

402

answers:

0

Hi all,

We have a relatively large MFC application that uses an SDI to host a number of dynamically created CView- based views. The basic structure of the application is somewhat like Outlook (tree view on the left, dynamic view(s) on the right).

I've been puzzling over the correct way to handle focus changing in the app. For example, I'd like to be able to hit 'tab' whilst the focus is in the tree view (left view), and move the focus to the right view. Whilst I could capture the tab key in the tree ctrl and manually change to the appropriate view, we have a lot of different view types (some CFormView- based), and a lot of splitter controls and I'm unsure whether there a more generic way to handle it.

I know setting the focus in a CDialog- or CFormView- is easy (just using the built-in tab order manager in Visual Studio), but an application which hosts multiple view types and splitter bars etc. is far more complex. For example, if the focus is currently in a form-view, when I tab over the end of the form view tab order, how do I detect that I need to change the input focus to another (dynamic) view?

Cheers and thanks all.

Darren.