Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CPTextField Changes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ross Boucher  
View profile  
 More options Oct 28 2009, 11:24 pm
From: Ross Boucher <rbouc...@gmail.com>
Date: Wed, 28 Oct 2009 20:24:17 -0700
Local: Wed, Oct 28 2009 11:24 pm
Subject: CPTextField Changes
In an attempt to make it work more like NSTextField, I've gone ahead  
and changed several things about CPTextField.

First, didbegin and didend editing are now related to whether or not  
the text content has actually changed. If you don't type anything, you  
won't get a didBeginEditing (though you may still get a didEndEditing  
sometimes).

didEndEditing is also sent when enter is pressed, which essentially  
commits the edit. And I've added support for sendsActionOnEndEditing,  
so you can have your textfield send its action only on return, or  
whenever editing ends.

Finally, in recognition of the fact that these changes break a lot of  
what people are using begin/end for, I've added new notifications for  
focus/blur which you can listen to. That should give an appropriate  
hook without the need to subclass for what most people need.

Let me know if I've broken anything, or if you see a potential problem.

Thanks,
Ross


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Saikat Chakrabarti  
View profile  
 More options Oct 29 2009, 6:44 pm
From: Saikat Chakrabarti <saik...@gmail.com>
Date: Thu, 29 Oct 2009 15:44:03 -0700
Local: Thurs, Oct 29 2009 6:44 pm
Subject: Re: CPTextField Changes
Thanks for this!  Definitely makes CPTextField a bit easier to work
with.  One question though:

> First, didbegin and didend editing are now related to whether or not
> the text content has actually changed. If you don't type anything, you
> won't get a didBeginEditing (though you may still get a didEndEditing
> sometimes).

In what cases does it send didEndEditing?  It seems like right now, it
doesn't hit textDidEndEditing unless the text field value is first
edited, and in the code, I see, in CPTextFieldKeyPressFunction:

if (owner._isEditing)
{
    owner._isEditing = NO;
    [owner textDidEndEditing:[CPNotification
notificationWithName:CPControlTextDidEndEditingNotification
object:owner userInfo:nil]];

}

I see the same in resignFirstResponder.  This makes it seem like
textDidEndEditing will only be called if the user has started editing
the text field first?  Is that the expected behavior?  Or am I missing
something?

Thanks,
Saikat


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »