mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:57:39 +00:00
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:
parent
6543a3861a
commit
eeee6b5df8
3 changed files with 20 additions and 6 deletions
|
@ -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++)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue