Print Page | Close Window

ON_NOTIFY - how ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=7784
Printed Date: 22 November 2024 at 1:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ON_NOTIFY - how ?
Posted By: re.tf
Subject: ON_NOTIFY - how ?
Date Posted: 13 August 2007 at 12:31pm
Hi,
 
I have one class:
 

class CPaneLog : public CWnd

{

DECLARE_DYNAMIC(CPaneLog)

public:

CPaneLog();

virtual ~CPaneLog();

 

void update()

{

report_.Populate();

}

 

void refresh(void)

{

report_.ResetContent();

populateCtrl();

report_.Populate();

}

protected:

DECLARE_MESSAGE_MAP()

void populateCtrl(void)

{

std::vector<CLogManagement::evt> list = CLogManagement::instance()->get();

for(int i = 0; i < list.size(); i++)

{

report_.AddRecord(new CLogRecord((CLogRecordItemIcon::iconType) list[i].type_, list[i].message_, list[i].date_, list[i].guid_));

}

}

private:

CXTPToolBar m_wndToolBar;

CXTPReportControl report_;

CImageList icons_;

afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

afx_msg void OnSize(UINT nType, int cx, int cy);

// afx_msg void OnRButtonUp(UINT nFlags, CPoint point);

afx_msg void OnTbPnLogButtonSave();

afx_msg void OnTbPnLogButtonClear();

afx_msg void OnTbPnLogButtonRefresh();

afx_msg void CPaneLog::OnReportItemRClick(NMHDR * pNotifyStruct, LRESULT * result);

};

 

...

BEGIN_MESSAGE_MAP(CPaneLog, CWnd)

ON_WM_CREATE()

ON_WM_SIZE()

// ON_WM_RBUTTONUP()

ON_COMMAND(ID_TB_PN_LOG_BUTTON_SAVE, &CPaneLog::OnTbPnLogButtonSave)

ON_COMMAND(ID_TB_PN_LOG_BUTTON_CLEAR, &CPaneLog::OnTbPnLogButtonClear)

ON_COMMAND(ID_TB_PN_LOG_BUTTON_REFRESH, &CPaneLog::OnTbPnLogButtonRefresh)

//}}AFX_MSG_MAP

ON_NOTIFY(NM_RCLICK, IDC_REPORT, &CPaneLog::OnReportItemRClick)

END_MESSAGE_MAP()

void CPaneLog::OnReportItemRClick(NMHDR * pNotifyStruct, LRESULT * result)

{

MessageBox("OnReportItemRClick");

}

...
 
I did try use:
ON_NOTIFY(NM_RCLICK, IDC_REPORT, &CPaneLog::OnReportItemRClick)
 
When I click in intem, OnReportItemRClick is not called, don't work, what is wrong?
thanks



Replies:
Posted By: idler
Date Posted: 14 August 2007 at 1:42am
try this notify

XTP_NM_REPORT_HEADER_RCLICK



Posted By: re.tf
Date Posted: 14 August 2007 at 8:04am
Hi,
 
I did try:

ON_NOTIFY(XTP_NM_REPORT_HEADER_RCLICK, IDC_REPORT, &CPaneLog::OnReportItemRClick)

but, I have no success...
 
If any other idea, please let me know...
 
Thanks


Posted By: idler
Date Posted: 21 August 2007 at 4:29am
CPaneLog is parent of IDC_REPORT?
IDC_REPORT must be a child CPaneLog if you want catch XTP_NM_REPORT_HEADER_RCLICK. IDC_REPORT - nID CXTPReportControl?



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