discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of GNUstep fixes


From: Fred Kiefer
Subject: Re: List of GNUstep fixes
Date: Mon, 28 Nov 2005 21:45:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921

Hi Andreas,

Andreas Höschler wrote:
> 
> we are currently in the process of establishing a stable desktop
> environment for Solaris based on GNUstep (a mission critical business
> application and some utility apps). It seems that Window Maker is no
> option right now (focus problems discussed on the list). So we are stuck
> to JDS (not optimal but ok for now). In order to stabilize things we did
> the following changes to GNUstep so far. Please feel free to comment on
> these changes and/or integrate them in the official GNUstep tree (we
> have no write access to cvs). We will from time to time repost this list
> whenever essential changes have been addded (in the hope this is usefull
> to someone). If there is a better target channel for this please let me
> know.
> 

thank you for providing all these patches, some look quite nice others
rather like local hacks that should be kept in custome code. As for the
code in NSNumberFormatter, did you try the change I made in this class a
few weeks ago? Qou wont like it, as there is still a warning message
(the method is only half implemented), but it should be able to handle
the cases you are interested in.


> 
> *NSApplication*
> 
> - (void)abortModal
> {
> [self stopModalWithCode:NSRunAbortedResponse];
> }
> 

You did propose this NSApplciation fix previously :-)
As far as my mail folder tells me Alexander M. had to do some tests with
the run loop code before applying it. I wont change this method now,
without Alexanders input.

> *NSTabView*
> 
> - (NSSize)minimumSize
> {
> switch (_type)
> {
> case NSTopTabsBezelBorder:
> return NSMakeSize(2, 19.5);
> case NSNoTabsBezelBorder:
> return NSMakeSize(2, 3);
> case NSBottomTabsBezelBorder:
> return NSMakeSize(2, 16);
> default:
> return NSZeroSize;
> }
> }
> 

Looks nice.

> *NSTableView*
> Simply nice to have.
> 
> @interface NSTableView (GNUstepFix)
> 
> - (void)selectPreviousRow;
> - (void)selectNextRow;
> 
> @end
> 
> @implementation NSTableView (GNUstepFix)
> 
> - (void)keyDown:(NSEvent *)theEvent
> {
> NSString *string = [theEvent characters];
> 
> if ([string length] > 0)
> {
> if ([string characterAtIndex:0] == NSDownArrowFunctionKey)
> {
> [self selectNextRow];
> }
> else if ([string characterAtIndex:0] == NSUpArrowFunctionKey)
> {
> [self selectPreviousRow];
> }
> else [super keyDown:theEvent];
> }
> else [super keyDown:theEvent];
> }
> 
> - (void)selectPreviousRow
> {
> int selectedRow = [self selectedRow];
> if (selectedRow > 0)
> [self selectRow:(selectedRow - 1) byExtendingSelection:NO];
> }
> 
> - (void)selectNextRow
> {
> int numberOfRows = [self numberOfRows];
> int selectedRow = [self selectedRow];
> if (selectedRow < numberOfRows - 1)
> [self selectRow:(selectedRow + 1) byExtendingSelection:NO];
> }
> 
> @end
> 

We need key handling for the NSTableView class, perhaps this would be a
start.


> *NSTextField*
> This fix makes sure, that objectValue is valid, when the delegate method
> is called (which is the case on MacOSX).
> 
> - (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)command
> {
> if (sel_eq (command, @selector(insertNewline:)))
> {
> [self validateEditing];
> }
> if (_delegate && [_delegate respondsToSelector:
> @selector(control:textView:doCommandBySelector:)])
> {
> return [_delegate control:self textView:textView
> doCommandBySelector:command];
> }
> 
> return NO;
> }
> 
As I already told you in a private mail, I think this is not the root
cause of the problem you are seeing. We need to track down the actual
reason, why validateEditing is not called for the case where you request
objectValue from the cell.
I just did check our code and the Cocoa specification, we don't call
call validateEditing in NSActionCell for objectValue, only for the other
value methods. This may be wrong but closely follows the specification.

> Check whether delegate does implement didFailToFormatString:.

Added both checks in CVS.

> }
> 
> *NSBrowserCell*
> 
> - (void)setType:(NSCellType)aType
> {
> [super setType: aType];
> }
> 
> - (void)drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView
> *)controlView
> {
> ...
> if (cell_image)
> {
> NSSize size;;
> NSPoint position;
> 
> size.height = cellFrame.size.height;
> size.width = size.height;
> 
> position.x = NSMinX(title_rect);
> position.y = NSMinY(title_rect);
> 
> if ([controlView isFlipped]) position.y += size.height;
> 
> NSImage *temp = [[NSImage alloc] initWithSize:size];
> [temp lockFocus];
> [[NSGraphicsContext currentContext] setImageInterpolation:
> NSImageInterpolationHigh];
> [temp unlockFocus];
> 
> [cell_image setSize:size];
> [cell_image setScalesWhenResized:YES];
> [cell_image compositeToPoint:position operation:NSCompositeSourceOver];
> 
> [temp release];
> 
> title_rect.origin.x += size.width + 4;
> title_rect.size.width -= size.width + 4;
> }
> ...
> }
> 

I must admit that I don't understand the idea behind this patch.

> *NSPopUpButtonCell*
> 
> - (void)synchronizeTitleAndSelectedItem
> {
> int index;
> 
> if (!_pbcFlags.usesItemFromMenu) return;
> 
> if ([_menu numberOfItems] == 0)
> {
> index = -1;
> }
> else if (_pbcFlags.pullsDown)
> {
> index = 0;
> }
> else
> {
> index = [[_menu menuRepresentation] highlightedItemIndex];
> if (index < 0) index = [self indexOfSelectedItem];
> // if (index < 0) index = 0; // <--------------- this is bad
> }
> 
> if ((index >= 0) && ([_menu numberOfItems] > index))
> {
> NSMenuItem *anItem;
> 
> 
> // This conversion is needed as [setMenuItem:] expects an NSMenuItem
> anItem = (NSMenuItem *)[_menu itemAtIndex: index];
> [self setMenuItem: anItem];
> }
> else
> {
> [self setMenuItem: nil];
> }
> }
> 
Here our implementations matches the specification, why should we
deviate from that?

Cheers
Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]