EditTextField in Datagrid

Josep jmyepes at mac.com
Mon Jul 20 15:24:52 EDT 2009


You are great! the script run like a charm. Many thanks Trevor.

So sending "DeleteFieldEditorAndOpenNext" and "DeleteFieldEditor" and append
others messages I can control all from the editing point. It's fantastic.

Are documented these messages?

Thanks again, I'm blocked for hours following the flow between open, close
and edit ... :)

Salut,
Josep


Trevor DeVore wrote:
> 
> On Jul 20, 2009, at 12:03 PM, Josep wrote:
> 
>> Step by step...
>>
>> On preOpenFieldEditor assign my bInputControl
>>
>> On bInputControl control the keypress and show the stack and store  
>> the value
>> in a global var
>>
>> And where put the value from the global var?
> 
> I thought about this for a minute and I think the solution is pretty  
> straightforward. Here is a customized version of the default "Field  
> Editor" script that has your rawKeyDown handler included. This script  
> would be assigned to your "bInputControl" button. It is completely  
> untested.
> 
> I also added some commented code to rawKeyDown that uses the  
> dialogData rather than a global and doesn't require the code you  
> currently have in selectionChanged.
> 
> Notes:
> 
> 1) When your stack opens you don't want to close the field editor.  
> That is the reason for the script local used in closefield and  
> exitField.
> 2) Why not use the dialogData rather than a global?
> 
> Regards,
> 
> -- 
> Trevor DeVore
> Blue Mango Learning Systems
> www.bluemangolearning.com    -    www.screensteps.com
> 
> 
> 
> ======================
> 
> local sEditingValueInDialog = false
> 
> 
> on escapeKey
>      send "DeleteFieldEditor false" to the dgControl of me in 0 seconds
> end escapeKey
> 
> 
> on closeField
>      if not sEditingValueInDialog then
>          ## Don't delete editor within same message
>          send "DeleteFieldEditor" to the dgControl of me in 0 seconds
>      end if
> end closeField
> 
> 
> on exitField
>      if not sEditingValueInDialog then
>          send "DeleteFieldEditor" to the dgControl of me in 0 seconds
>      end if
> end exitField
> 
> 
> on returnInField
>      if the autotab of me then
>          send "DeleteFieldEditor" to the dgControl of me in 0 seconds
>      else
>          pass returnInField
>      end if
> end returnInField
> 
> 
> on enterInField
>      if the autotab of me then
>          send "DeleteFieldEditor" to the dgControl of me in 0 seconds
>      else
>          pass enterInField
>      end if
> end enterInField
> 
> 
> on tabKey
>      if the autotab of me then
>          send "DeleteFieldEditorAndOpenNext" to the dgControl of me in  
> 0 seconds
>      else
>          pass tabkey
>      end if
> end tabKey
> 
> 
> on selectionChanged
>      ## don't pass as selectionChanged is reserved for group
>      ## developer can override behavior to process selectionChanged
> end selectionChanged
> 
> 
> on rawkeydown keycode
>    Global gConcepte
>    put keycode
>    switch keycode
>       case 65472
>          put true into sEditingValueInDialog ## so field editor does  
> not close
> 
>          ## set the dialogData to the text of me
>          go stack "ss_conceptos" as sheet
> 
> 	##########
> 	## Update cell with new value.
> 	set the text of me to gConcepte ## Why not use the dialogData here?
>          ## set the text of me to the dialogData
> 	##########
> 
>          focus on me ## bring focus back to this field
>          put false into sEditingValueInDialog ## field editor should  
> close next time focus leaves.
> 
>          break
>    end switch
>    pass rawkeydown
> end rawkeydown
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/EditTextField-in-Datagrid-tp24571063p24575989.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list