In XMLOutlineController, fix the visibility checkbox functions to match the new cell view structures.

This commit is contained in:
dsward2
2020-03-27 17:47:54 -05:00
parent 2b17c773c4
commit cd75666a2e
2 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -105,7 +105,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2896</string>
<string>2908</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.graphics-design</string>
<key>LSMinimumSystemVersion</key>
@@ -1976,20 +1976,30 @@
NSInteger clickedRow = -1;
if ([senderButton.superview isKindOfClass:[NSTableRowView class]] == YES)
NSTableCellView * tableCellView = NULL;
if ([senderButton.superview.superview isKindOfClass:[NSTableRowView class]] == YES)
{
NSTableRowView * tableRowView = (NSTableRowView *)senderButton.superview;
tableCellView = (NSTableCellView *)senderButton.superview;
XMLOutlineRowView * tableRowView = (XMLOutlineRowView *)tableCellView.superview;
clickedRow = [self.xmlOutlineView rowForView:tableRowView];
}
if (clickedRow >= 0)
{
id checkboxButtonObject = (NSButton *)[self outlineView:self.xmlOutlineView viewForTableColumn:aTableColumn item:sender];
NSXMLNode * selectedXMLNode = [self.xmlOutlineView itemAtRow:clickedRow];
id checkboxCellViewObject = (NSButton *)[self outlineView:self.xmlOutlineView viewForTableColumn:aTableColumn item:selectedXMLNode];
if ([checkboxButtonObject isKindOfClass:[NSButton class]] == YES)
if ([checkboxCellViewObject isKindOfClass:[NSTableCellView class]] == YES)
{
NSButton * checkboxButton = (NSButton *)checkboxButtonObject;
NSTableCellView * tableCellView = (NSTableCellView *)checkboxCellViewObject;
NSArray * subviews = tableCellView.subviews;
NSButton * checkboxButton = (NSButton *)subviews.firstObject;
if (checkboxButton.enabled)
{
@@ -2663,7 +2673,7 @@
checkboxButton.refusesFirstResponder = YES;
// object locking is not implemented yet
//[checkboxButton setTarget:self];
//[checkboxButton setAction:@selector(visibilityCheckboxAction:)];
//[checkboxButton setAction:@selector(lockedCheckboxAction:)];
[checkboxButton setIntValue:[resultValue intValue]];
}