Print Page | Close Window

CXTPPropertyPage does not work with OnCmdMsg

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=14639
Printed Date: 25 April 2024 at 6:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyPage does not work with OnCmdMsg
Posted By: znakeeye
Subject: CXTPPropertyPage does not work with OnCmdMsg
Date Posted: 27 June 2009 at 12:16pm
I have some panes derived from CXTPPropertyPane. This gives me good scrollbar behavior thanks to the special member variables m_TotalDev etc. Though, I discovered a problem; my command-handlers stopped working when I switched from CXTPDialog to CXTPPropertyPage.
 
// My custom command router stopped working:
if (pPane->OnCmdMsg(...))
    return TRUE;
 
How do I make my commands work inside a CXTPPropertyPane? If it's not possible, then how do I get the scrollbar behavior in CXTPDialog?


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: Oleg
Date Posted: 29 June 2009 at 7:30am

Hi,

it have to - CProperypage derived from CDialog. Check in MFC sources what methods can prevent it.


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


Posted By: znakeeye
Date Posted: 29 June 2009 at 8:41am
My pane derives from CPaneBase, which is derived from CXTPPropertyPage. When I press <enter> in my edit-box, nothing happens.
If I change the base-class of CPaneBase to CXTPDialog, <enter> triggers OnOK.
 
Hence, the problem must be in CXTPPropertyPage!
 
 
Note:
I did find a similar problem on the net, regarding CPropertyPage. I was hoping you knew what was going on. Anyway, if MFC does something nasty with property pages, then I must use CXTPDialog instead. It would be great to have scrollbar-functionality, but it seems it's only implemented in CXTPPropertyPage . Any hints?


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 29 June 2009 at 8:52am

Could this be it?

BOOL CPropertyPage::PreTranslateMessage(MSG* pMsg)

{

VERIFY(!CWnd::PreTranslateMessage(pMsg));

return FALSE; // handled by CPropertySheet::PreTranslateMessage

}



-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 29 June 2009 at 2:03pm

Hi,

I need more details about what you have, where/what you call to give some hint. ideally if you update propertysheet sample and attach it here.


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


Posted By: znakeeye
Date Posted: 29 June 2009 at 2:44pm
I was right. Copying CDialog::PreTranslateMessage and overriding it in my CPropertyPage-based class solved it:
 
BOOL CDialogPaneBase::PreTranslateMessage(MSG* pMsg)
{
    // CPropertyPage does not handle messages the way we want, but CDialog does.
    return CDialog::PreTranslateMessage(pMsg);
}
 
I believe CPropertyPage is not meant to be used as a pane window :P. Thanks for your assistance though.


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: ABuenger
Date Posted: 29 June 2009 at 3:09pm
Originally posted by znakeeye znakeeye wrote:

I believe CPropertyPage is not meant to be used as a pane window :P. Thanks for your assistance though.


What you want is a tabbed view. See the sample.



-------------
Codejock support


Posted By: znakeeye
Date Posted: 30 June 2009 at 3:02am
Nah, I want to put a dialog/form inside a pane. This is no big deal, but if you want scrollbars for the dialog, then CXTPPropertyPage is the way to go. Though, for correct keyboard handling, the hack above is needed!

-------------
PokerMemento - http://www.pokermemento.com/



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