Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to Call C++Code from XAML-CheckBox-Click-Event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
millenium View Drop Down
Groupie
Groupie


Joined: 24 February 2016
Location: Germany
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote millenium Quote  Post ReplyReply Direct Link To This Post Topic: How to Call C++Code from XAML-CheckBox-Click-Event
    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
Back to Top
millenium View Drop Down
Groupie
Groupie


Joined: 24 February 2016
Location: Germany
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote millenium Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2017 at 7:42am
The answer can be found in:
Codejock\Samples\ToolkitPro\MarkupSample
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (1) Thanks(1)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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++)
Back to Top
millenium View Drop Down
Groupie
Groupie


Joined: 24 February 2016
Location: Germany
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote millenium Quote  Post ReplyReply Direct Link To This Post Posted: 02 August 2017 at 3:50am
Thank you for your answer.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.