Applied two small patches.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22442 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2006-02-06 15:52:49 +00:00
parent 6543a3861a
commit eeee6b5df8
3 changed files with 20 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2006-02-06 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMatrix.m (-deselectAllCells): Allow empty selection,
when there are no cells. Patch by Georg Fleischmann <georg@vhf.de>.
* Source/NSPopupButtonCell.m (-synchronizeTitleAndSelectedItem):
Don't set selection index to 0, if apopup button doesn't have a
selection. Patch by Andreas Höschler <ahoesch@smartsoft.de>.
2006-02-05 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSMenuView.m: ([-sizeToFit]) Fix bug #15631

View file

@ -1036,14 +1036,17 @@ static SEL getSel;
}
/**<p>Deselects all NSMatrix's cells. Does nothing if the NSMatrix's mode
is NSRadioModeMatrix and if it does not allows empty selection</p>
is NSRadioModeMatrix and if it does not allows empty selection.
Except for the case, when there are no cells left at all. Then the
selection is always cleared.</p>
<p>See Also: -mode -allowsEmptySelection -setNeedsDisplayInRect:</p>
*/
- (void) deselectAllCells
{
int i;
if (!_allowsEmptySelection && _mode == NSRadioModeMatrix)
if (_numRows > 0 && _numCols > 0 &&
!_allowsEmptySelection && _mode == NSRadioModeMatrix)
return;
for (i = 0; i < _numRows; i++)

View file

@ -367,6 +367,12 @@ static NSImage *_pbc_image[2];
return [_menu itemAtIndex: end];
}
/*
The Cocoa specification has this method as
- (id <NSCopying>) objectValue
but this gives a conflict with the NSCell declaration of this method, which is
- (id) objectValue
*/
- (id <NSCopying>) objectValue
{
return [NSNumber numberWithInt: [self indexOfSelectedItem]];
@ -533,11 +539,8 @@ static NSImage *_pbc_image[2];
if (index < 0)
{
// If no item is highighted, display the selected one ...
// If no item is highighted, display the selected one, if there is one.
index = [self indexOfSelectedItem];
// ... if there is nown, then the first one, but don't select it.
if (index < 0)
index = 0;
}
else
{