Here are a few straight forward patches for :
- NSBrowser, to fix a <tab> problem (focus was not moving properly when
    tab was pressed due to a missing return)
- NSCell, pressing <space> when a cell is selected does not only send
    an action but does also change the state of the selected cell
    (NSOnOffButton for example -> try the preview button of the
    NSFontPanel)
- NSPanel, setting the nextKeyView chain so one can navigate using
    tab/shift-tab in the AlertPanels

The last patch is about NSFontPanel :
- it sets up a nextKeyView chain (again)
- it changes defer:NO to defer:YES for performance
    (i don't see any reason to use defer:NO)
- if overrides NSWindow fieldEditor:forObject: in order not to give to
    sizeField the common fieldEditor, otherwise selecting the sizeField
    NSTextField sets the current font of the NSFontPanel to the font used
    by sizeField (Helvetica 12 normal on my system), reseting all the
    changes made to the current font. So it gives sizeField a fieldEditor
    with usesFontPanel set to NO.

Pierre-Yves
--- ../core/gui/Source/NSCell.m Mon Apr 16 21:52:52 2001
+++ ../core.patch/gui/Source/NSCell.m   Thu Jun 14 00:16:12 2001
@@ -1045,6 +1045,7 @@
       NSRect   cvBounds = [cv bounds];
       NSWindow *cvWin = [cv window];
       
+      [self setNextState];
       [self highlight: YES withFrame: cvBounds inView: cv];
       [cvWin flushWindow];
       
--- ../core/gui/Source/NSBrowser.m      Mon May 14 04:31:32 2001
+++ ../core.patch/gui/Source/NSBrowser.m        Wed Jun 13 22:49:33 2001
@@ -2644,6 +2644,7 @@
            else
              [_window selectKeyViewFollowingView: self];
          }
+         return;
          break;
        }
     }
--- ../core/gui/Source/NSPanel.m        Wed May  2 04:31:18 2001
+++ ../core.patch/gui/Source/NSPanel.m  Wed Jun 13 23:06:54 2001
@@ -558,6 +558,11 @@
       altButton = [self _makeButtonWithRect: rect];
       othButton = [self _makeButtonWithRect: rect];
 
+      /* PYR : create the nextKeyView chain */
+      [defButton setNextKeyView: othButton];
+      [othButton setNextKeyView: altButton];
+      [altButton setNextKeyView: defButton];
+
       rect.size.height = 80.0;
       scroll = makeScrollViewWithRect(rect);
 
--- ../core/gui/Source/NSFontPanel.m    Mon Apr 23 01:01:23 2001
+++ ../core.patch/gui/Source/NSFontPanel.m      Thu Jun 14 15:58:20 2001
@@ -69,6 +69,8 @@
 }
 
 
+NSText *sizeFieldText = nil;
+
 /* Implemented in NSBrowser */
 @interface GSBrowserTitleCell : NSTextFieldCell
 @end
@@ -328,6 +330,28 @@
   return self;
 }
 
+/*
+ *  Overriding fieldEditor: forObject:
+ */
+- (NSText *) fieldEditor:(BOOL) createFlag
+              forObject:(id) anObject
+{
+  if ( ([anObject respondsToSelector: @selector(tag)])
+      && ([anObject tag] == NSFPSizeField))
+    {
+      if ((sizeFieldText == nil) && createFlag)
+        {
+          sizeFieldText = [NSText new];
+          [sizeFieldText setUsesFontPanel: NO];
+          [sizeFieldText setFieldEditor: YES];
+        }
+      return sizeFieldText;
+    }
+
+  return [super fieldEditor: createFlag
+               forObject: anObject];
+}
+
 @end
 
 @implementation NSFontPanel (Privat)
@@ -373,7 +397,7 @@
   self = [super initWithContentRect: contentRect 
                          styleMask: style
                            backing: NSBackingStoreRetained
-                             defer: NO
+                             defer: YES
                             screen: nil];
   [self setTitle: @"Font Panel"];
 
@@ -541,6 +565,16 @@
   //[self setDefaultButtonCell: [setButton cell]];
   RELEASE(setButton);
 
+  // set the nextResponder chain
+  [familyBrowser setNextKeyView: faceBrowser];
+  [faceBrowser setNextKeyView: sizeField];
+  [sizeField setNextKeyView: sizeBrowser];
+  [sizeBrowser setNextKeyView: revertButton];
+  [revertButton setNextKeyView: previewButton];
+  [previewButton setNextKeyView: setButton];
+  [setButton setNextKeyView: familyBrowser];
+
+
   [v addSubview: topArea];
   RELEASE(topArea);
 
@@ -555,6 +589,8 @@
   RELEASE(bottomArea);
 
   [self setMinSize: [self frame].size];
+
+  [self setInitialFirstResponder: setButton];
   
   return self;
 }

Reply via email to