Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Do we always need to subclass controls on dialogs? Collapse All
Subject Author Date
Malcolm D Jun 12, 2007 - 8:29 PM

Do we always need to subclass controls on dialogs, to get a number of things with prof-uis to work?. E.G. get themes to work.

class Dialog
{
CExtButton m_button;
//...
};

Dialog::DoDataExchange()
{
DDX_CONTROL( IDC_BUTTON, m_button);
}

I understand if we actually want to make use of the control as a variable then we need to
{
m_button.SetWindowText( ...) ;
}

But if we don’t actaully use the control, by should we need to do it. There might be some cases where the user doesn’t want to , but if this is the case, could we jsut set a flag (or similar) which automatically subclasses each control (with the default class) which isn’t otherwise subclassed.

Hope this is clear.

Malcolm D Jun 13, 2007 - 4:42 PM

Yes, the seems like it is what we want.

What is the correct place to call this function? In OnInitDialog after the base class OnInitDialog is called?

Also is there any reason why this shouldn’t be moved to a more general base class rather than just in CExtResizableDialog?
We don’t like to copy and paste code that is meant to be the same as code else where (good design principles).

Thanks

Technical Support Jun 14, 2007 - 7:54 AM

Yes, you can invoke it in the OnInitDialog() method. We agree about adding this method as a base functionality of CExtResizableDialog and, most probably, will add it in the next release. Thank you.



Technical Support Jun 13, 2007 - 11:57 AM

We are not sure if you read this FAQ article but you can use the code from this article as a ready-to-use solution for subclassing your controls.