Print Page | Close Window

How to Call C++Code from XAML-CheckBox-Click-Event

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=23402
Printed Date: 23 December 2024 at 10:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to Call C++Code from XAML-CheckBox-Click-Event
Posted By: millenium
Subject: How to Call C++Code from XAML-CheckBox-Click-Event
Date Posted: 01 August 2017 at 3:22am
Hi fellow Codejock-users,

I am using CXTPPopupControl to show a XAML-Notification to  our users.
And i would like to offer a "Do not show this notification again"-functionality, driven by a simple XAML-checkbox.
So my question is: How do i connect the XAML-Checkbox-Clicked-event with my c++-code?

Thank you,
regards



Replies:
Posted By: millenium
Date Posted: 01 August 2017 at 7:42am
The answer can be found in:
Codejock\Samples\ToolkitPro\MarkupSample


Posted By: cpede
Date Posted: 01 August 2017 at 1:47pm
Make a delegate on the sub-classed control:
m_ctrlMyControl.SetDelegate(L"Click", CreateMarkupClassDelegate(this, &CMyWnd::OnClick));
Add a method for handling the delegate:
void CMyWnd::OnClick(CXTPMarkupObject* pSender, CXTPMarkupMouseEventArgs* pArgs)
{
  if (pSender->IsKindOf(MARKUP_TYPE(CXTPMarkupCheckBox)))
  {
    CXTPMarkupString* pTag = MARKUP_STATICCAST(CXTPMarkupString,
        ((CXTPMarkupCheckBox*)pSender)->GetTag());
    CString sTag(*pTag);
    //((CXTPMarkupCheckBox*)pSender)->SetChecked(bIsChecked ? TRUE : FALSE);
    pArgs->SetHandled();
  }
}

-cpede




-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: millenium
Date Posted: 02 August 2017 at 3:50am
Thank you for your answer.



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