Print Page | Close Window

Derived control doesn't work in collapsed group

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16017
Printed Date: 18 July 2025 at 9:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Derived control doesn't work in collapsed group
Posted By: DavidH
Subject: Derived control doesn't work in collapsed group
Date Posted: 15 January 2010 at 8:00am
To suit my needs for a control on the Ribbon, I derived a new class from it:

class ValueEditRibbon: public CXTPControlEdit{
public:
...
protected:
  BOOL OnHookKeyDown(UINT nChar, LPARAM lParam);
private:
...
};

I use the OnHookKeyDown to make sure only certain patterns can be entered (numerical values with fractions).

I put it on the ribbon like this:
ValueEditRibbon* veValue(new ValueEditRibbon());
pGroup->Add(veValue, ID_EDITABLE_VALUE);

This all works fine.

When I make the application screen small, the group with this control collapses. This is intended behavior of course.
However, when I click the arrow down to unfold it, the edit box is there, but its OnHookKeyDown is no longer called. The control seems to be cast down to a CControlEditRibbon.



What can I do to make it work?

Thanks,

David.



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