\ fourtap-text 2001/05/16 KDJ
\ 
\ Copyright 2001
\ Kristopher D. Johnson
\ 
\ THIS CODE IS PROVIDED "AS IS"
\ WITHOUT WARRANTY OF ANY KIND.
\ THE AUTHOR SHALL NOT BE LIABLE
\ FOR ANY CLAIM IN CONNECTION
\ WITH THIS CODE.
\ 
\ This code may be used, copied,
\ modified, or distributed for any
\ purpose, provided that the above
\ copyright notice and disclaimer of
\ warranty is retained on all copies.

.( fourtap-text... )

needs toolkit
needs Forms
needs fourtap-util

decimal

: u>zstring ( u -- cadr u )
  u>ud <# 0 hold #s #> ;

: u>zstringbuf ( u cadr -- cadr. )
  >r u>zstring r@ swap move
  r> >abs ;
  
: id>index ( ctlID -- n )
  GetObjectIndex ; inline

: id>ControlPtr ( ctlID -- &CtlPtr. )
  GetObjectPtr ; inline

: active-form ( -- &FormPtr. )
  FrmGetActiveForm ;

: show-ctl ( controlID -- )
  id>index
  active-form FrmShowObject
;

: hide-ctl ( controlID -- )
  dup
  id>index
  active-form FrmHideObject
  id>ControlPtr CtlHideControl
;

: set-label ( cadr u controlID -- )
  dup >r
  hide-ctl
  drop >abs
  r@
  active-form FrmCopyLabel
  r> show-ctl
;

: set-label# ( u controlID -- )
  >r u>zstring r> set-label ;



