Andrey Sergienko | 4 Feb 2011 13:56
Picon

CTreeViewCtrl and WM_PAINT


Hello

I have a main frame. And I create TreeView in it:

/* mainfrm.h */

class CMainFrame : public CFrameWindowImpl<CMainFrame>, public
CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler
{
public:

// ...

CMyTreeViewCtrl mytreeview;

// ...

};

/* end of mainfrm.h */

/* mainfrm.cpp */

// ...

m_treeview.Create(m_lPane.m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE
| WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);

m_lPane.SetClient(m_treeview.m_hWnd)
(Continue reading)

Michael Stephenson | 4 Feb 2011 16:06
Picon

RE: CTreeViewCtrl and WM_PAINT

Odd stuff.  Based just on what you've shown, you should see your handler
being called.

Does the TreeView actually paint okay?

What's the declaration of your CMyTreeViewCtrl?

It should be something like:

Class CMyTreeViewCtrl : public CWindowImpl<CMyTreeViewCtrl>
{
}

Do you have WS_CLIPCHILDREN in the main frame's window styles?

What if you add handlers for WM_PRINT and WM_PRINTCLIENT, do those get
called?

-----Original Message-----
From: wtl@...
[mailto:wtl@...] On Behalf Of Andrey
Sergienko
Sent: Friday, February 04, 2011 7:56 AM
To: wtl@...
Subject: [wtl] CTreeViewCtrl and WM_PAINT

Hello

I have a main frame. And I create TreeView in it:

(Continue reading)

Igor Tandetnik | 4 Feb 2011 18:46
Favicon

Re: CTreeViewCtrl and WM_PAINT

On 2/4/2011 7:56 AM, Andrey Sergienko wrote:
> So as I think CMyTreeViewCtrl does not ever receive WM_PAINT message. So
> how to do what I want?

Derive your class from CWindowImpl<CMyTreeViewCtrl, CTreeViewCtrl>. 
CTreeViewCtrl by itself doesn't provide the machinery to hook window proc.
-- 
Igor Tandetnik

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    wtl-digest@... 
    wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

(Continue reading)

lighth7015 | 5 Feb 2011 00:02
Picon

custom-drawing a CTabCtrl

Hi guys,

Where could I find information on custom-drawing a CTabCtrl to make it look similar to the old 'Sheridan 3D'
controls look?

Thanks,
- Robert

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    wtl-digest@... 
    wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
(Continue reading)

Andrey Sergienko | 7 Feb 2011 10:37
Picon

Re: Re: CTreeViewCtrl and WM_PAINT


On 04.02.2011 19:46, Igor Tandetnik wrote:
> Derive your class from CWindowImpl<CMyTreeViewCtrl, CTreeViewCtrl>. 
> CTreeViewCtrl by itself doesn't provide the machinery to hook window proc.

Solved already but thank you - yuo're right.

-- 
Andrey Sergienko
http://erazer.org

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    wtl-digest@... 
    wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
(Continue reading)

addicted2freefall | 11 Feb 2011 10:44
Picon
Favicon

NM_DBLCLK handler for a CListViewCtrl

I've got a CListViewCtrl in a dialog application.  In my message map, I declare a couple of event handlers for
the list view ctrl.  NM_DBLCLK works as expected, but NM_KEYDOWN appears to do nothing.

Can anyone point out what I'm missing in order to get the list ctrl responding to keydown events - 

Here's my code:

BEGIN_MSG_MAP(...)
  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_DBLCLK, OnDblClickEntry )
  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_KEYDOWN, OnKeyDownEntry )
END_MSG_MAP()

LRESULT OnDblClickEntry (NMHDR* pNMHDR )
{...}

LRESULT OnKeyDownEntry ( NMHDR* pNMHDR )
{
	NMKEY * pKey = reinterpret_cast<NMKEY*> (pNMHDR);
	BOOL bYawn;

	if( pKey )	
		if( pKey->nVKey == VK_DELETE )							
			OnDeleteJob(0,0,0,bYawn);				

	return 0;
}

------------------------------------

Yahoo! Groups Links
(Continue reading)

Jim Barry | 11 Feb 2011 12:20

Re: NM_DBLCLK handler for a CListViewCtrl

Try LVN_KEYDOWN instead of NM_KEYDOWN. Don't forget to change NMKEY
to NMLVKEYDOWN as well.

On 11 February 2011 09:44, addicted2freefall <addicted2freefall@...>wrote:

> I've got a CListViewCtrl in a dialog application.  In my message map, I
> declare a couple of event handlers for the list view ctrl.  NM_DBLCLK works
> as expected, but NM_KEYDOWN appears to do nothing.
>
> Can anyone point out what I'm missing in order to get the list ctrl
> responding to keydown events -
>
> Here's my code:
>
> BEGIN_MSG_MAP(...)
>  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_DBLCLK, OnDblClickEntry )
>  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_KEYDOWN, OnKeyDownEntry )
> END_MSG_MAP()
>
> LRESULT OnDblClickEntry (NMHDR* pNMHDR )
> {...}
>
> LRESULT OnKeyDownEntry ( NMHDR* pNMHDR )
> {
>        NMKEY * pKey = reinterpret_cast<NMKEY*> (pNMHDR);
>        BOOL bYawn;
>
>        if( pKey )
>                if( pKey->nVKey == VK_DELETE )
>                        OnDeleteJob(0,0,0,bYawn);
(Continue reading)

sagymz | 20 Feb 2011 15:21
Picon

WTL dialogs in MFC application

Hi,
I have a MFC application project. I've added a new dialog to the project
and, using WTL wizard, added the header and the source files
(automatically generated). Then I created another dialog in the same
way.
To the first dialog I have added a CSplitterWindow member, and in the
OnInitDialog I have written the following:
CRect rect;GetClientRect(&rect);m_ctlSplitter1.Create(m_hWnd, rect,
NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN);m_Second.Create(m_ctlSplitter1);m_ctlSplitter1.SetSplit\
terPanes(m_Second, ::GetDlgItem(m_hWnd, IDCANCEL),
false);m_ctlSplitter1.SetSplitterPos( rect.right/2 );
Where m_Second is the second dialog that I have mentioned before.
What I see after running it is that the second dialog is not presenting
the controls that it has on it. When running DoModal() on the second
dialog when it is not in the splitter, the dialog is shown fine, but
when it is inside the splitter, something is wrong.
Do you have any idea what might have gone wrong?
Thanks.

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
(Continue reading)

Michael Stephenson | 21 Feb 2011 03:02
Picon

RE: WTL dialogs in MFC application

Does m_Second have a PreTranslateMessage() member function that returns the
result of IsDialogMessage?  This is needed for non-modal dialogs to hook
them into the app's message loop.

From: wtl@...
[mailto:wtl@...] On Behalf Of sagymz
Sent: Sunday, February 20, 2011 9:21 AM
To: wtl@...
Subject: [wtl] WTL dialogs in MFC application

Hi,
I have a MFC application project. I've added a new dialog to the project
and, using WTL wizard, added the header and the source files
(automatically generated). Then I created another dialog in the same
way.
To the first dialog I have added a CSplitterWindow member, and in the
OnInitDialog I have written the following:
CRect rect;GetClientRect(&rect);m_ctlSplitter1.Create(m_hWnd, rect,
NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN);m_Second.Create(m_ctlSplitter1);m_ctlSplitter1.SetSplit\
terPanes(m_Second, ::GetDlgItem(m_hWnd, IDCANCEL),
false);m_ctlSplitter1.SetSplitterPos( rect.right/2 );
Where m_Second is the second dialog that I have mentioned before.
What I see after running it is that the second dialog is not presenting
the controls that it has on it. When running DoModal() on the second
dialog when it is not in the splitter, the dialog is shown fine, but
when it is inside the splitter, something is wrong.
Do you have any idea what might have gone wrong?
Thanks.

(Continue reading)

sagymz | 21 Feb 2011 09:10
Picon

Re: WTL dialogs in MFC application

Thanks for your answer!

I have compared my classes to a few examples found on the internet and found out that PreTranslateMessage()
and some other stuff were missing.

--- In wtl@..., "Michael Stephenson" <domehead100 <at> ...> wrote:
>
> Does m_Second have a PreTranslateMessage() member function that returns the
> result of IsDialogMessage?  This is needed for non-modal dialogs to hook
> them into the app's message loop.
> 
>  
> 
> From: wtl@...
[mailto:wtl@...] On Behalf Of sagymz
> Sent: Sunday, February 20, 2011 9:21 AM
> To: wtl@...
> Subject: [wtl] WTL dialogs in MFC application
> 
>  
> 
>   
> 
> Hi,
> I have a MFC application project. I've added a new dialog to the project
> and, using WTL wizard, added the header and the source files
> (automatically generated). Then I created another dialog in the same
> way.
> To the first dialog I have added a CSplitterWindow member, and in the
> OnInitDialog I have written the following:
(Continue reading)


Gmane