Mercurial > dwindows
comparison ios/dw.m @ 2794:7ce51a7e8009
iOS: Fix tree control handling clicks on the expand/collapse button.
Since we didn't use _dw_internal_button_new() we had to add the
buttonClicked: target action to DWButton here for it to work.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 15 Jul 2022 08:15:11 +0000 |
parents | 24977a1ec6fc |
children | deefe6f5d716 |
comparison
equal
deleted
inserted
replaced
2793:24977a1ec6fc | 2794:7ce51a7e8009 |
---|---|
2856 _titleLabel = titleLabel; | 2856 _titleLabel = titleLabel; |
2857 | 2857 |
2858 DWButton *arrowImageButton = [[DWButton alloc] initWithFrame:CGRectMake(0, 0, | 2858 DWButton *arrowImageButton = [[DWButton alloc] initWithFrame:CGRectMake(0, 0, |
2859 _DW_TREE_IMG_HEIGHT_WIDTH, | 2859 _DW_TREE_IMG_HEIGHT_WIDTH, |
2860 _DW_TREE_IMG_HEIGHT_WIDTH)]; | 2860 _DW_TREE_IMG_HEIGHT_WIDTH)]; |
2861 [arrowImageButton addTarget:arrowImageButton | |
2862 action:@selector(buttonClicked:) | |
2863 forControlEvents:UIControlEventTouchUpInside]; | |
2864 | |
2861 [arrowImageButton setType:_DW_BUTTON_TYPE_TREE]; | 2865 [arrowImageButton setType:_DW_BUTTON_TYPE_TREE]; |
2862 [arrowImageButton setDidCheckedChanged:^(BOOL checked) { | 2866 [arrowImageButton setDidCheckedChanged:^(BOOL checked) { |
2863 _expanded = checked; | 2867 _expanded = checked; |
2864 if([_delegate respondsToSelector:@selector(treeViewCell:expanded:)]) | 2868 if([_delegate respondsToSelector:@selector(treeViewCell:expanded:)]) |
2865 [_delegate treeViewCell:self expanded:checked]; | 2869 [_delegate treeViewCell:self expanded:checked]; |