Re: Cannot enter edit boxes on CProperty pages
For starter a link to Jo?o Paulo Figueira's article would be nice. I see
two on codeproject.com that are related to propertysheets, but don't see
anything about scrolling on either one, so I don't know which one you might
be using.
Are you trying to make the propretysheet scroll, or the page to be
scrollable? I think you are talking about the page.
AliR.
"Henryk Birecki" <soaringpilot@sbcglobal.net> wrote in message
news:jlat441bj05u4uqs48oa7qptglu7nlndft@4ax.com...
I needed to re-work my Properties dialogs in an application (VisStudio
6) to have property pages with scroll bars. This is mostly because I
run pretty much the same code on a WinCE devices and PC. I "borrowed"
and modified some code from Jo?o Paulo Figueira which was designed to
run on WinCE device, and except for some minor cosmetics it pretty
much works on WinCE. The basic design is that instead of
CPropertySheet a standard CDialog is used In my case this dialog has a
tab control to switch pages and on a PC an OK button. The dialog has a
child window with scroll bars that in turn has a CProperty page as a
child.
Container window is created as follows. ( WC_PROP_PAGE_CONTAINER is
registered beforehand as a window class)
BOOL CPageContainer::Create(DWORD dwStyle, const RECT &rc, CWnd
*pParentWnd, UINT nID)
{
HWND hWnd = NULL;
BOOL bOk = FALSE;
HINSTANCE hInst = AfxGetInstanceHandle();
CRect r(rc);
dwStyle |= WS_VSCROLL | WS_HSCROLL;
hWnd = ::CreateWindowEx(0, WC_PROP_PAGE_CONTAINER, NULL,
dwStyle, r.left, r.top, r.Width(), r.Height(),
pParentWnd->GetSafeHwnd(), (HMENU)nID, hInst, NULL);
bOk = (hWnd != NULL);
if(bOk) bOk = SubclassWindow(hWnd);
return bOk;
}
The property pages (m_pagesInfo[i]->page) are created by the container
as follows:
m_pagesInfo[i]->page->Create(
m_pagesInfo[i]->page->m_psp.pszTemplate, this);
m_pagesInfo[i]->page->ModifyStyle(
WS_BORDER|WS_CAPTION|WS_POPUP|WS_SYSMENU|
WS_MAXIMIZEBOX|WS_MINIMIZEBOX, WS_CHILD, 0);
The ModifyStyle is a "precaution" as I am using some old Property
Pages resources, In fact it turns out that adding WS_CHILD after
creation seems to work for WinCE but not for PC, and removing WS_POPUP
does nothing good.
The problem I am seeing is that once a PropertyPage is displayed I can
click all checkboxes, buttons, spin controls, but I cannot set focus
to an edit box with mouse and edit it, nor does it seem tab keyboard
clicks are getting through. If an edit control has a buddy spin
control, I cna click on spin control wich in turn sets focus to CEdit,
and I can edit a number. This happens only on PC, not on WinCE device
(at least an emulator).
Can anyone give me a hint as to what is going on? Thanks.
Henryk Birecki