Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - CXTPPropertyPage does not work with OnCmdMsg
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertyPage does not work with OnCmdMsg

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertyPage does not work with OnCmdMsg
    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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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.156 seconds.