Author: fredkiefer
Date: Sat May 3 23:45:47 2014
New Revision: 37830
URL: http://svn.gna.org/viewcvs/gnustep?rev=37830&view=rev
Log:
* Source/GSXibLoader.m (-awake:inContainer:withContext:): Allow
for subclasses of NSApplication as rootObjects.
Based on patch by Marcian Lytwyn <[email protected]>.
* Source/NSWindow.m (-userSpaceScaleFactor): Handle case where
_screen is nil.
Patch by Doug Simons ([email protected]).
* Source/NSWindow.m (-_screenForFrame:): Require real overlapp.
Patch by Doug Simons ([email protected]).
* Source/NSTextField.m (-textDidChange:): Improve editing
behavior when formatter returns a new string.
Patch by Doug Simons ([email protected]).
Modified:
libs/gui/trunk/ChangeLog
libs/gui/trunk/Source/GSXibLoader.m
libs/gui/trunk/Source/NSTextField.m
libs/gui/trunk/Source/NSWindow.m
Modified: libs/gui/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=37830&r1=37829&r2=37830&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog (original)
+++ libs/gui/trunk/ChangeLog Sat May 3 23:45:47 2014
@@ -1,9 +1,23 @@
2014-05-03 Fred Kiefer <[email protected]>
- * 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 <[email protected]>.
+ * Source/NSWindow.m (-userSpaceScaleFactor): Handle case where
+ _screen is nil.
+ Patch by Doug Simons ([email protected]).
+ * Source/NSWindow.m (-_screenForFrame:): Require real overlapp.
+ Patch by Doug Simons ([email protected]).
+ * Source/NSTextField.m (-textDidChange:): Improve editing behavior
+ when formatter returns a new string.
+ Patch by Doug Simons ([email protected]).
+
+2014-05-03 Fred Kiefer <[email protected]>
+
+ * 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.
Modified: libs/gui/trunk/Source/GSXibLoader.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSXibLoader.m?rev=37830&r1=37829&r2=37830&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSXibLoader.m (original)
+++ libs/gui/trunk/Source/GSXibLoader.m Sat May 3 23:45:47 2014
@@ -865,20 +865,35 @@
id owner = [context objectForKey: NSNibOwner];
id first = nil;
id app = nil;
-
+ NSCustomObject *object;
+ NSString *className;
+
// Get the file's owner and NSApplication object references...
- if ([[(NSCustomObject*)[rootObjects objectAtIndex: 1] className]
isEqualToString: @"FirstResponder"])
- first = [(NSCustomObject*)[rootObjects objectAtIndex: 1] realObject];
+ object = (NSCustomObject*)[rootObjects objectAtIndex: 1];
+ if ([[object className] isEqualToString: @"FirstResponder"])
+ {
+ first = [object realObject];
+ }
else
- NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__);
-
- if ([[(NSCustomObject*)[rootObjects objectAtIndex: 2] className]
isEqualToString: @"NSApplication"])
- app = [(NSCustomObject*)[rootObjects objectAtIndex: 2] realObject];
+ {
+ 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__);
+ {
+ 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)
{
Modified: libs/gui/trunk/Source/NSTextField.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTextField.m?rev=37830&r1=37829&r2=37830&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSTextField.m (original)
+++ libs/gui/trunk/Source/NSTextField.m Sat May 3 23:45:47 2014
@@ -573,9 +573,8 @@
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
{
Modified: libs/gui/trunk/Source/NSWindow.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSWindow.m?rev=37830&r1=37829&r2=37830&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSWindow.m (original)
+++ libs/gui/trunk/Source/NSWindow.m Sat May 3 23:45:47 2014
@@ -389,7 +389,7 @@
*/
- (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 @@
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 @@
{
return 1.0;
}
+ else if (_screen != nil)
+ {
+ return [_screen userSpaceScaleFactor];
+ }
else
{
- return [_screen userSpaceScaleFactor];
+ return 1.0;
}
}
@@ -2117,7 +2122,7 @@
difference = NSMaxY (screenRect) - NSMaxY (frameRect);
if (_styleMask & NSResizableWindowMask)
{
- float difference2;
+ CGFloat difference2;
difference2 = screenRect.origin.y - frameRect.origin.y;
difference2 -= difference;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs