Embedded CPropertySheet and tab order 
Author Message
 Embedded CPropertySheet and tab order

With a CPropertySheet (as a tab-folder) embedded in a modal dialog I had
two problems:
1) The tab-folder was not part of the tab order of the dialog
2) Alt-Tabbing away hung the app

Searching through the MSDN library gave a solution to the second
problem:  the WS_EX_CONTROLPARENT flag is missing from the common
control under Windows 95 so do a ModifyStyleEx.

Thing was it fixed the first problem too!

Great...  so why am I posting?

Well, I also have a CPropertySheet similarly embedded in a CFormView and
it doesn't join in the tab order either (to be more specific Create()ing
it with the WS_TABSTOP style allows focus in, but it then loops around
inside the tab-folder and never goes back out; also short-cut keys
pressed with focus in the tab-folder aren't passed out to the parent).

Why doesn't the ModifyStyleEx() call fix this?
How can I get a CPropertySheet tab-folder to behave as a child control
inside a CFormView?
Any ideas?

Barry Norton



Mon, 31 Jul 2000 03:00:00 GMT  
 Embedded CPropertySheet and tab order

In you CPropertySheet Derived class, Override PreTranslateMessage and do
this..
BOOL CPropSheet::PreTranslateMessage(MSG* pMsg)
{
/*First Property Sheet tab key translation
 allow sheet to translate Ctrl+Tab, Shift+Ctrl+Tab,
  Ctrl+PageUp, and Ctrl+PageDown */

if (pMsg->message == WM_KEYDOWN && GetAsyncKeyState(VK_CONTROL) < 0 &&
  (pMsg->wParam == VK_TAB || pMsg->wParam == VK_PRIOR || pMsg->wParam ==
        VK_NEXT))
    {
        if (SendMessage(PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg))
                return TRUE;
    }
/*Check for the Dialog handling by the PropertyPage*/
    if (IsDialogMessage (pMsg))
        return TRUE;
    else if (CWnd::PreTranslateMessage(pMsg)) /*Last , see if the window
wants to handle this message*/
        return TRUE;
    return FALSE; /*Nobody wants it so return false */

Quote:
}

--
Girish Bharadwaj [VC++/MVP]
Quote:

>With a CPropertySheet (as a tab-folder) embedded in a modal dialog I had
>two problems:
>1) The tab-folder was not part of the tab order of the dialog
>2) Alt-Tabbing away hung the app

>Searching through the MSDN library gave a solution to the second
>problem:  the WS_EX_CONTROLPARENT flag is missing from the common
>control under Windows 95 so do a ModifyStyleEx.

>Thing was it fixed the first problem too!

>Great...  so why am I posting?

>Well, I also have a CPropertySheet similarly embedded in a CFormView and
>it doesn't join in the tab order either (to be more specific Create()ing
>it with the WS_TABSTOP style allows focus in, but it then loops around
>inside the tab-folder and never goes back out; also short-cut keys
>pressed with focus in the tab-folder aren't passed out to the parent).

>Why doesn't the ModifyStyleEx() call fix this?
>How can I get a CPropertySheet tab-folder to behave as a child control
>inside a CFormView?
>Any ideas?

>Barry Norton



Mon, 31 Jul 2000 03:00:00 GMT  
 Embedded CPropertySheet and tab order

I had in mind to put something like that into PreTranslateMessage() if
there's not a simpler solution, but your version is a lot neater than what I
have so far.

Thanks,

Barry Norton

Quote:

> In you CPropertySheet Derived class, Override PreTranslateMessage and do
> this..
> BOOL CPropSheet::PreTranslateMessage(MSG* pMsg)
> {
> /*First Property Sheet tab key translation
>  allow sheet to translate Ctrl+Tab, Shift+Ctrl+Tab,
>   Ctrl+PageUp, and Ctrl+PageDown */

> if (pMsg->message == WM_KEYDOWN && GetAsyncKeyState(VK_CONTROL) < 0 &&
>   (pMsg->wParam == VK_TAB || pMsg->wParam == VK_PRIOR || pMsg->wParam ==
>         VK_NEXT))
>     {
>         if (SendMessage(PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg))
>                 return TRUE;
>     }
> /*Check for the Dialog handling by the PropertyPage*/
>     if (IsDialogMessage (pMsg))
>         return TRUE;
>     else if (CWnd::PreTranslateMessage(pMsg)) /*Last , see if the window
> wants to handle this message*/
>         return TRUE;
>     return FALSE; /*Nobody wants it so return false */
> }



Mon, 31 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Changing Tab Order of Embedded CPropertySheet

2. Changing tab order in a CPropertySheet

3. Tab control and tab order

4. Apply order in CPropertySheet

5. Embed modeless CPropertySheet object in a view

6. Crash when using embedded CPropertySheet (focus issue).

7. Embedding: CPropertySheet in CPropertyPage

8. Embedded CPropertySheet - CTabCtrl doesn't reflect EnableWindow(FALSE)

9. Embed modeless CPropertySheet object in a view

10. Embed modeless CPropertySheet object in a view - Resend

11. CPropertySheet embedded in CDialog, Please answer with EMail

12. CPropertySheet Tabbed Index

 

 
Powered by phpBB® Forum Software