mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:10:38 +00:00
* Source/NSTextField.m (-mouseDown:): Check if the control is
disabled. (bug #13916) (-acceptFirstResponder:): Return no if disabled. (-acceptFirstMouse:): Ditto. * Source/NSTextFieldCell.m (-setEnabled:): Reset the string value to an empty string if disabling. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23574 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9d21170e10
commit
8dce386f4d
3 changed files with 22 additions and 3 deletions
|
@ -338,7 +338,7 @@ static Class textFieldCellClass;
|
|||
//
|
||||
- (void) mouseDown: (NSEvent*)theEvent
|
||||
{
|
||||
if ([self isSelectable] == NO)
|
||||
if ([self isSelectable] == NO || [self isEnabled] == NO)
|
||||
{
|
||||
[super mouseDown: theEvent];
|
||||
return;
|
||||
|
@ -392,7 +392,7 @@ static Class textFieldCellClass;
|
|||
|
||||
- (BOOL) acceptsFirstMouse: (NSEvent *)aEvent
|
||||
{
|
||||
return [self isEditable];
|
||||
return [self isEditable] && [self isEnabled];
|
||||
}
|
||||
|
||||
/** <p>Returns whether the NSTextField accepts to be the first responder.
|
||||
|
@ -405,7 +405,7 @@ static Class textFieldCellClass;
|
|||
// we do not accept first responder if there is already a
|
||||
// _text_object, else it would make the _text_object resign
|
||||
// and end editing
|
||||
return (_text_object == nil) && [self isSelectable];
|
||||
return (_text_object == nil) && [self isSelectable] && [self isEnabled];
|
||||
}
|
||||
|
||||
- (BOOL) becomeFirstResponder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue