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 » Dynamic creation of controls within a subclassed CExtResizableDialog Collapse All
Subject Author Date
Harvey Cohen Mar 17, 2005 - 9:14 PM

I am still evaluating Prof-UIS for commerical use. It should be possible, in principle, to dynamically install controls, or draw items (via the CDC) in a CExtResizableDialog that has a CExtControlBar as it’s parent.

I refer to the Prof-UIS supplied example "MDI".

In MDI, there is a CExtWRB< CExtResizableDialog > that has a CExtControlBar as it’s parent (m_wndInBarDlg is contained within m_wndResizableBar3).

If I place a control in the dialog resource that m_wndInBarDlg is based on, it appears.

If I dynamicaly create a control, such as

CStatic alpha;
CRect aRect (100, 100, 200, 150);
alpha.Create    ("Some Text", WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE, &aRect, m_wndInBarDlg, 25001);
alpha.ShowWindow (SW_SHOW);
in CMainFrame::On_Create (after all m_wndInBarDlg is created),


the text does not appear.

What, pray tell, am I doing wrong?

TIA

Harvey

Harvey Cohen Mar 17, 2005 - 9:39 PM

Ignore ..

I created the control out of scope of CMainFrame, and when the function that created the control ended, the control was destroyed. Foo ..

I created the control using dynamic allocation

(CStatic foo = new CStatic)

and low and behold, all works well.

Duh ..

Thanks anyway.

PS .. It is somewhat difficult to go through all 95 pages of messages on this board, but I read the last 10 pages and many questions I was contemplated were answered.

If would be of great benefit if you made the board easier to browse ..

HJC

Technical Support Mar 18, 2005 - 8:25 AM

We just want to add some comments which should help you continue your experiments with the CExtResizableDialog class. Please use the WS_CLIPCHILDREN style for any resizable dialog, especially if it is really can be resized in your application. You should also use our CExt*** classes for any dialog controls that are based on the parent window background, i.e. use CExtLabel instead of CStatic and CExtGroupBox instead of CButton (This is already described in the FAQ category Simple controls.