mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 12:00:45 +00:00
Update code in GSXib5KeyedUnarchiver.m to read alternative toolTip format (#193)
* Update code in GSXib5KeyedUnarchiver.m to read alternative toolTip format * Update to make the code a bit tighter, per suggestion by @fredkiefer
This commit is contained in:
parent
629d065b91
commit
3f35da7860
2 changed files with 34 additions and 10 deletions
|
@ -1,7 +1,13 @@
|
|||
2023-08-30 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSXib5KeyedUnarchive.m: Fix for issue#192. Added code to
|
||||
-decodeObjectForXib:forClassName:withID: to decode toolTip using
|
||||
alternative format described in the issue.
|
||||
|
||||
2023-08-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSSwitch.m (-drawRect:): Correct drawing as suggested by
|
||||
Austin Clow (dr_clow@me.com).
|
||||
Austin Clow (dr_clow@me.com).
|
||||
|
||||
2023-02-12 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
|
|
|
@ -3169,6 +3169,31 @@ didStartElement: (NSString*)elementName
|
|||
}
|
||||
}
|
||||
|
||||
- (void) addToolTip: (GSXibElement *)element forObject: (id)object
|
||||
{
|
||||
NSString *toolTipString = [element attributeForKey: @"toolTip"];
|
||||
|
||||
// Process tooltips...
|
||||
if (toolTipString == nil)
|
||||
{
|
||||
GSXibElement *toolTipElement = [element elementForKey: @"toolTip"];
|
||||
|
||||
toolTipString = [toolTipElement value];
|
||||
}
|
||||
|
||||
if (toolTipString != nil)
|
||||
{
|
||||
if ([object respondsToSelector: @selector(setToolTip:)])
|
||||
{
|
||||
[object setToolTip: toolTipString];
|
||||
}
|
||||
else if ([object respondsToSelector: @selector(setHeaderToolTip:)])
|
||||
{
|
||||
[object setHeaderToolTip: toolTipString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (id) decodeObjectForXib: (GSXibElement*)element
|
||||
forClassName: (NSString*)classname
|
||||
withID: (NSString*)objID
|
||||
|
@ -3177,15 +3202,8 @@ didStartElement: (NSString*)elementName
|
|||
id object = [super decodeObjectForXib: element forClassName: classname withID: objID];
|
||||
|
||||
[self addOrderedObject: element];
|
||||
|
||||
// Process tooltips...
|
||||
if ([element attributeForKey: @"toolTip"])
|
||||
{
|
||||
if ([object respondsToSelector: @selector(setToolTip:)])
|
||||
[object setToolTip: [element attributeForKey: @"toolTip"]];
|
||||
else if ([object respondsToSelector: @selector(setHeaderToolTip:)])
|
||||
[object setHeaderToolTip: [element attributeForKey: @"toolTip"]];
|
||||
}
|
||||
[self addToolTip: element forObject: object];
|
||||
|
||||
// Process IB runtime attributes for element...
|
||||
// Ensure we don't process the placeholders...
|
||||
if ([element elementForKey: @"userDefinedRuntimeAttributes"] &&
|
||||
|
|
Loading…
Reference in a new issue