Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
extensions:sp_text_field_input [2011/03/15 03:27] enbrextensions:sp_text_field_input [2015/09/14 11:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +~~NOTOC~~
  
 +====== SPTextField with Input ======
 +
 +---- dataentry extension ----
 +type          : mod
 +author_mail   : briancensor@gmail.com Brian Ensor 
 +description   : Lets you type into an SPTextField
 +lastupdate_dt : 2011-03-13
 +compatible    : v1.1
 +depends       : 
 +tags          : text, input, field, keyboard
 +homepage_url  : https://gist.github.com/868480
 +download_url  : https://gist.github.com/gists/868480/download
 +----
 +\\ [[/users/brian/start|My Wiki Page]]
 +\\
 +===== Usage =====
 +
 +{{http://img864.imageshack.us/img864/5500/screenshot20110313at401.png|}}
 +
 +You will need to add the files to your Sparrow source.
 +
 +<code objc>
 +SPTextField *inputField = [[SPTextField alloc] initWithWidth:300 height:220 text:@"This text is editable.\ninputField.inputEnabled = YES;\ninputField.returnKeyType = UIReturnKeyDone;" fontName:@"Helvetica" fontSize:12 color:0x000000];
 +inputField.inputEnabled = YES;
 +inputField.returnKeyType = UIReturnKeyDone;
 +[self addChild:inputField];
 +[inputField release];
 +[inputField addEventListener:@selector(inputBegan:) atObject:self forType:SP_EVENT_TYPE_INPUT_BEGAN];
 +[inputField addEventListener:@selector(inputEnded:) atObject:self forType:SP_EVENT_TYPE_INPUT_ENDED];
 +[inputField addEventListener:@selector(inputCancelled:) atObject:self forType:SP_EVENT_TYPE_INPUT_CANCELLED];
 +</code>
 +
 +===== Changelog =====
 +
 +  * 2011/03/13: First public version
 +
 +===== Source Code =====
 +
 +%gist(868480)%
 +
 +Embr
 +
 +Just tried adding this, I replaced the textfield files in the Sparrow framework and added both lines to my textfield:
 +
 +inputField.inputEnabled = YES;
 +inputField.returnKeyType = UIReturnKeyDone;
 +
 +Gave the following errors:
 +
 +error: request for member 'inputEnabled' in something not a structure or union
 +error: request for member 'returnKeyType' in something not a structure or union
 +
 +Do I have to add something to the implementation to make it work?
 +
 +Thanks
 
 
Powered by DokuWiki