Print Page | Close Window

CXTPMarkupContext

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13770
Printed Date: 08 May 2024 at 10:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPMarkupContext
Posted By: zaksoft
Subject: CXTPMarkupContext
Date Posted: 24 March 2009 at 1:48am
I'd like to know how CMarkupContent can fire event without hyperlink.
 
Take your StartPageSample.xaml in MarkupPad as example: how can I react to click on news ? if I replace Run with HyperLink all titles are underlines... 
 
Can you please give me some suggestions ?
 
TIA


-------------
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com



Replies:
Posted By: Oleg
Date Posted: 24 March 2009 at 6:07am
Hi,
Catch m_pMouseLeftButtonDownEvent from this Run instead.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: zaksoft
Date Posted: 24 March 2009 at 8:05am
I've added...
 
m_wndBackGround.SetMarkupText( sXaml, MARKUP_NO_SCROLL, MARKUP_CENTERED);

m_wndBackGround.AddHandler( CXTPMarkupHyperlink::m_pClickEvent, CreateMarkupClassDelegate( this, &CCentroView::OnHyperlinkClick));

// >> new

m_wndBackGround.AddHandler( CXTPMarkupHyperlink::m_pMouseLeftButtonDownEvent, CreateMarkupClassDelegate( this, &CCentroView::OnLeftMouseClick));

<<

and I've added a new function:
 

void CCentroView::OnLeftMouseClick( CXTPMarkupMouseButtonEventArgs * pArgs)

{

     AfxMessageBox( "OnLeftMouseClick");

}

But it's not called... I've stepped into debugger and

void CXTPMarkupInputElement::OnMouseLeftButtonDown(CXTPMarkupMouseButtonEventArgs* /*e*/)

{

}

is called instead.
 
Can you please give me more information about intercepting this message and how to retrieve tag inserted into <Run> starting from a CXTPMarkupMouseButtonEventArgs pointer ?
 
TIA


-------------
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com


Posted By: Oleg
Date Posted: 25 March 2009 at 2:13am
You need SetDelegate insted
 
Set it before you set Markup
 
m_wndBackGround.SetDelegate(L"Run_MouseLeftButtonUp", CreateMarkupClassDelegate(this, &CMarkupPadView::OnBorderMouseLeftButtonUp));
 
and in your markup add <Run MouseLeftButtonUp= 'Run_MouseLeftButtonUp' .... >


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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