mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
Add bindigns to NSTableColumn and handle font bindings in _applyBindingsToCell:... method
This commit is contained in:
parent
766a358fb7
commit
74e0c19503
2 changed files with 49 additions and 3 deletions
|
@ -98,6 +98,9 @@
|
|||
[self exposeBinding: NSValueBinding];
|
||||
[self exposeBinding: NSEnabledBinding];
|
||||
[self exposeBinding: NSEditableBinding];
|
||||
[self exposeBinding: NSFontBinding];
|
||||
[self exposeBinding: NSFontNameBinding];
|
||||
[self exposeBinding: NSFontSizeBinding];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6861,8 +6861,9 @@ For a more detailed explanation, -setSortDescriptors:. */
|
|||
forTableColumn: (NSTableColumn *)tb
|
||||
row: (NSInteger)index
|
||||
{
|
||||
GSKeyValueBinding *theBinding;
|
||||
|
||||
GSKeyValueBinding *theBinding = nil;
|
||||
NSFont *font = nil;
|
||||
|
||||
theBinding = [GSKeyValueBinding getBinding: NSEditableBinding
|
||||
forObject: tb];
|
||||
if (theBinding != nil)
|
||||
|
@ -6887,7 +6888,49 @@ For a more detailed explanation, -setSortDescriptors:. */
|
|||
objectAtIndex: index];
|
||||
flag = [result boolValue];
|
||||
[cell setEnabled: flag];
|
||||
}
|
||||
}
|
||||
|
||||
// Font bindings...
|
||||
theBinding = [GSKeyValueBinding getBinding: NSFontBinding
|
||||
forObject: tb];
|
||||
if (theBinding != nil)
|
||||
{
|
||||
font = [(NSArray *)[theBinding destinationValue]
|
||||
objectAtIndex: index];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *fontName = nil;
|
||||
CGFloat fontSize = 0.0;
|
||||
|
||||
theBinding = [GSKeyValueBinding getBinding: NSFontNameBinding
|
||||
forObject: tb];
|
||||
if (theBinding != nil)
|
||||
{
|
||||
fontName = [(NSArray *)[theBinding destinationValue]
|
||||
objectAtIndex: index];
|
||||
}
|
||||
|
||||
if (fontName != nil)
|
||||
{
|
||||
theBinding = [GSKeyValueBinding getBinding: NSFontSizeBinding
|
||||
forObject: tb];
|
||||
if (theBinding != nil)
|
||||
{
|
||||
id num = [(NSArray *)[theBinding destinationValue]
|
||||
objectAtIndex: index];
|
||||
fontSize = [num doubleValue];
|
||||
}
|
||||
|
||||
font = [NSFont fontWithName: fontName
|
||||
size: fontSize];
|
||||
}
|
||||
}
|
||||
|
||||
if (font != nil)
|
||||
{
|
||||
[cell setFont: font];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _willDisplayCell: (NSCell*)cell
|
||||
|
|
Loading…
Reference in a new issue