* Source/GSXibLoader.m (-awake:inContainer:withContext:): Allow

for subclasses of NSApplication as rootObjects.
        Based on patch by Marcian Lytwyn <gna@advcsi.com>.
        * Source/NSWindow.m (-userSpaceScaleFactor): Handle case where
        _screen is nil.
        Patch by Doug Simons (dsimons@testplant.com).
        * Source/NSWindow.m (-_screenForFrame:): Require real overlapp.
        Patch by Doug Simons (dsimons@testplant.com).
        * Source/NSTextField.m (-textDidChange:): Improve editing
        behavior when formatter returns a new string.
        Patch by Doug Simons (dsimons@testplant.com).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37830 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-05-03 21:45:47 +00:00
parent dcb4ac58f2
commit 59b1180d27
4 changed files with 52 additions and 19 deletions

View file

@ -1,9 +1,23 @@
2014-05-03 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow.m: (-setFrame:): Revert last change.
* Source/NSWindow.m: (-encodeWithCoder:, -initWithCoder:): Use
* Source/GSXibLoader.m (-awake:inContainer:withContext:): Allow
for subclasses of NSApplication as rootObjects.
Based on patch by Marcian Lytwyn <gna@advcsi.com>.
* Source/NSWindow.m (-userSpaceScaleFactor): Handle case where
_screen is nil.
Patch by Doug Simons (dsimons@testplant.com).
* Source/NSWindow.m (-_screenForFrame:): Require real overlapp.
Patch by Doug Simons (dsimons@testplant.com).
* Source/NSTextField.m (-textDidChange:): Improve editing behavior
when formatter returns a new string.
Patch by Doug Simons (dsimons@testplant.com).
2014-05-03 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow.m (-setFrame:): Revert last change.
* Source/NSWindow.m (-encodeWithCoder:, -initWithCoder:): Use
content min/max size instead of min/max size.
* Source/NSWindow.m: (+initialize): Increase version number to 3.
* Source/NSWindow.m (+initialize): Increase version number to 3.
* Source/GSNibLoading.m (NSWindowTemplate -encodeWithCoder:,
-initWithCoder:): Use NSWindowContentMinSize/NSWindowContentMaxSize
instead of NSMinSize/NSMaxSize.

View file

@ -865,20 +865,35 @@
id owner = [context objectForKey: NSNibOwner];
id first = nil;
id app = nil;
// Get the file's owner and NSApplication object references...
if ([[(NSCustomObject*)[rootObjects objectAtIndex: 1] className] isEqualToString: @"FirstResponder"])
first = [(NSCustomObject*)[rootObjects objectAtIndex: 1] realObject];
else
NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__);
NSCustomObject *object;
NSString *className;
if ([[(NSCustomObject*)[rootObjects objectAtIndex: 2] className] isEqualToString: @"NSApplication"])
app = [(NSCustomObject*)[rootObjects objectAtIndex: 2] realObject];
// Get the file's owner and NSApplication object references...
object = (NSCustomObject*)[rootObjects objectAtIndex: 1];
if ([[object className] isEqualToString: @"FirstResponder"])
{
first = [object realObject];
}
else
NSLog(@"%s:NSApplication missing\n", __PRETTY_FUNCTION__);
{
NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__);
}
object = (NSCustomObject*)[rootObjects objectAtIndex: 2];
className = [object className];
if ([className isEqualToString: @"NSApplication"] ||
[NSClassFromString(className) isSubclassOfClass:[NSApplication class]])
{
app = [object realObject];
}
else
{
NSLog(@"%s:NSApplication missing\n", __PRETTY_FUNCTION__);
}
// Use the owner as first root object
[(NSCustomObject*)[rootObjects objectAtIndex: 0] setRealObject: owner];
en = [rootObjects objectEnumerator];
while ((obj = [en nextObject]) != nil)
{

View file

@ -573,9 +573,8 @@ static Class textFieldCellClass;
if (newString != nil)
{
NSLog (@"Unimplemented: should set string to %@", newString);
// FIXME ! This would reset editing !
//[_text_object setString: newString];
// This resets editing with insertion point after the string, which is what Cocoa does
[_text_object setString: newString];
}
else
{

View file

@ -389,7 +389,7 @@ has blocked and waited for events.
*/
- (NSScreen *) _screenForFrame: (NSRect)frame
{
NSInteger largest = -1;
CGFloat largest = 0.0;
NSArray *screens = [NSScreen screens];
NSInteger index = 0;
NSScreen *theScreen = nil;
@ -399,7 +399,8 @@ has blocked and waited for events.
NSScreen *screen = [screens objectAtIndex: index];
NSRect sframe = [screen frame];
NSRect iframe = NSIntersectionRect(frame, sframe);
NSInteger isize = NSWidth(iframe) * NSHeight(iframe);
CGFloat isize = NSWidth(iframe) * NSHeight(iframe);
if (isize > largest)
{
largest = isize;
@ -1386,9 +1387,13 @@ titleWithRepresentedFilename(NSString *representedFilename)
{
return 1.0;
}
else if (_screen != nil)
{
return [_screen userSpaceScaleFactor];
}
else
{
return [_screen userSpaceScaleFactor];
return 1.0;
}
}
@ -2117,7 +2122,7 @@ titleWithRepresentedFilename(NSString *representedFilename)
difference = NSMaxY (screenRect) - NSMaxY (frameRect);
if (_styleMask & NSResizableWindowMask)
{
float difference2;
CGFloat difference2;
difference2 = screenRect.origin.y - frameRect.origin.y;
difference2 -= difference;