Thanks for your suggestions!
I make some change in Integration Sample for testing, the following are code pieces
ViewController.mm
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint p = [touch locationInView:self.view];
widget->_xamlRenderer->TouchDown(p.x, p.y, widget->_button);
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:self.view];
widget->_xamlRenderer->TouchMove(p.x, p.y, widget->_button);
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint p = [touch locationInView:self.view];
//_xamlRenderer->TouchUp(currentPoint.x, currentPoint.y, 3);
//Drawing::Point p = widget->_button->PointFromScreen(Drawing::Point(currentPoint.x, currentPoint.y));
widget->_xamlRenderer->TouchUp(p.x, p.y, widget->_button);
}
WidgetTest.cpp
void OnClickedButton(Ptr<BaseComponent>& sender, const RoutedEventArgs& e)
{
Ptr<Button> button = NsStaticCast<Ptr<Button>>(sender);
button->SetContent("Click Meaaaaa!");
}
void WidgetTest::init(){
_button = *new Button();
_button->SetContent("Click Me!");
_button->SetWidth(400);
_button->SetHeight(200);
_button->TouchUpEvent += MakeDelegate(&OnClickedButton);
_grid = *new Grid();
_grid->GetChildren()->Add(_button.GetPtr());
_xamlRenderer = Noesis::GUI::CreateRenderer(_grid.GetPtr());
}
void WidgetTest::Release(){
}
There are some linked errors, as bellow
Undefined symbols for architecture armv7:
"typeinfo for Noesis::Core::BaseComponent", referenced from:
typeinfo for Noesis::Core::Delegate<void (Noesis::Core::Ptr<Noesis::Core::BaseComponent>&, Noesis::Gui::RoutedEventArgs const&)>::MultiDelegate::DelegateVector in WidgetTest.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So I confuse about the link error, and I'm sure that it is produced by MakeDelegate(&OnClickedButton).
I expect some help,thanks!