Fields.txt


\ Fields 99.2.8 7:51 pm NAB
needs Forms
needs core-ext

: FlushQueue ( -- )
  begin 0. (ekey) 0= until ;

: FieldFocus ( fieldid -- )
  FrmGetActiveForm  2dup 2>r 
  FrmGetObjectIndex dup
  2r@ FrmGetObjectPtr ( idx ptr. )
\ Make the field active:
  0 rot rot  FldSetInsPtPosition
  2r> FrmSetFocus  FlushQueue ;

: string>Field ( c-addr u fieldID -- Err )
  >r  swap >abs 
  r> GetObjectPtr 
  2dup FldGetTextLength 0 2over
  FldDelete  FldInsert  FlushQueue ;

: Field>string ( c-addr fieldID -- len )
  swap >r GetObjectPtr
  2dup FldGetTextLength dup >r
  s>d 2swap FldGetTextPtr
  r> r> swap >r >abs  MemMove drop
  r>  FlushQueue ;



  HTMLized by Forth2HTML