mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-23 06:20:47 +00:00
Update number formatter
This commit is contained in:
parent
ea7307a91b
commit
eab17e9f2f
6 changed files with 22 additions and 23 deletions
Binary file not shown.
Binary file not shown.
|
@ -4,15 +4,15 @@
|
|||
Actions = (
|
||||
);
|
||||
Outlets = (
|
||||
formatTable,
|
||||
detachButton,
|
||||
addThousandSeparatorSwitch,
|
||||
commaPointSwitch,
|
||||
formatForm,
|
||||
formatTable,
|
||||
localizeSwitch,
|
||||
negativeField,
|
||||
negativeRedSwitch,
|
||||
positiveField,
|
||||
detachButton
|
||||
positiveField
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -35,11 +35,11 @@
|
|||
id commaPointSwitch;
|
||||
id formatForm;
|
||||
id formatTable;
|
||||
id localizeSwitch;
|
||||
id negativeField;
|
||||
id negativeRedSwitch;
|
||||
id positiveField;
|
||||
id detachButton;
|
||||
id localizeSwitch;
|
||||
id positiveField;
|
||||
id negativeField;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -98,17 +98,16 @@ extern NSArray *predefinedNumberFormats;
|
|||
zeroFmt = [NSNumberFormatter zeroFormatAtIndex:row];
|
||||
negativeFmt = [NSNumberFormatter negativeFormatAtIndex:row];
|
||||
fullFmt = [NSNumberFormatter formatAtIndex:row];
|
||||
|
||||
// Update Appearance samples
|
||||
[self updateAppearanceFieldsWithFormat: fullFmt];
|
||||
|
||||
// Update editable format fields
|
||||
[[formatForm cellAtIndex:0] setStringValue: VSTR(positiveFmt)];
|
||||
[[formatForm cellAtIndex:1] setStringValue: VSTR(zeroFmt)];
|
||||
[[formatForm cellAtIndex:2] setStringValue: VSTR(negativeFmt)];
|
||||
|
||||
[fmtr setFormat:fullFmt];
|
||||
// Update Appearance samples
|
||||
[self updateAppearanceFieldsWithFormat: fullFmt];
|
||||
|
||||
// Update editable format fields
|
||||
[[formatForm cellAtIndex:0] setStringValue: VSTR(positiveFmt)];
|
||||
// [[formatForm cellAtIndex:1] setStringValue: VSTR(zeroFmt)];
|
||||
[[formatForm cellAtIndex:2] setStringValue: VSTR(negativeFmt)];
|
||||
|
||||
[fmtr setFormat:fullFmt];
|
||||
}
|
||||
}
|
||||
else if (sender == formatForm)
|
||||
|
@ -116,10 +115,10 @@ extern NSArray *predefinedNumberFormats;
|
|||
NSUInteger idx;
|
||||
|
||||
positiveFmt = [[sender cellAtIndex:0] stringValue];
|
||||
zeroFmt = [[sender cellAtIndex:1] stringValue];
|
||||
negativeFmt = [[sender cellAtIndex:2] stringValue];
|
||||
minValue = [[sender cellAtIndex:3] stringValue];
|
||||
maxValue = [[sender cellAtIndex:4] stringValue];
|
||||
// zeroFmt = [[sender cellAtIndex:1] stringValue];
|
||||
negativeFmt = [[sender cellAtIndex:1] stringValue];
|
||||
minValue = [[sender cellAtIndex:2] stringValue];
|
||||
maxValue = [[sender cellAtIndex:3] stringValue];
|
||||
NSDebugLog(@"min,max: %@, %@", minValue, maxValue);
|
||||
|
||||
fullFmt = [NSString stringWithFormat:@"%@;%@;%@",
|
||||
|
@ -187,10 +186,10 @@ extern NSArray *predefinedNumberFormats;
|
|||
// Format form
|
||||
NSDebugLog(@"format from object: %@", [fmtr format]);
|
||||
[[formatForm cellAtIndex:0] setStringValue: [fmtr positiveFormat]];
|
||||
[[formatForm cellAtIndex:1] setStringValue: [fmtr zeroFormat]];
|
||||
[[formatForm cellAtIndex:2] setStringValue: [fmtr negativeFormat]];
|
||||
[[formatForm cellAtIndex:3] setObjectValue: [fmtr minimum]];
|
||||
[[formatForm cellAtIndex:4] setObjectValue: [fmtr maximum]];
|
||||
// [[formatForm cellAtIndex:1] setStringValue: [fmtr zeroFormat]];
|
||||
[[formatForm cellAtIndex:1] setStringValue: [fmtr negativeFormat]];
|
||||
[[formatForm cellAtIndex:2] setObjectValue: [fmtr minimum]];
|
||||
[[formatForm cellAtIndex:3] setObjectValue: [fmtr maximum]];
|
||||
|
||||
// If the string typed is a predefined one then highligh it in
|
||||
// Number Format table view above
|
||||
|
|
Loading…
Reference in a new issue