Skip to content

Instantly share code, notes, and snippets.

@gla-chk
Created November 28, 2019 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gla-chk/c61ec272a556ebec573aa1733fc5a79d to your computer and use it in GitHub Desktop.
Save gla-chk/c61ec272a556ebec573aa1733fc5a79d to your computer and use it in GitHub Desktop.
Example usage of RTF control read / write to BLOB field
! Definition of TEXT control
! --------------------------
TEXT,AT(6,143,359,201),USE(?RtfMissionDescription),FONT('Arial',12,,,CHARSET:ANSI), |
RTF(TEXT:Field),VSCROLL,BOXED,#ORIG(?RTFTextBox),#SEQ(20),#ORDINAL(87)
! Embed point Local Objects -> Abc Objects -> Window Manager -> Init
! ------------------------------------------------------------------
!
! [Priority 8410]
! RTF ?RtfMissionDescription Initialize
RTFControl20.Init(?RtfMissionDescription)
!
! [Priority 9001]
! ===== Read current mission description from BLOB field =====
! st is a StringTheory object
! see https://capesoft.com/docs/StringTheory3/StringTheory.htm#FromBlob
st.Start()
st.FromBlob(Mission.Description)
RTFControl20.SetText(st.GetValuePtr())
st.Free()
! Embed point Local Objects -> Abc Objects -> Window Manager -> TakeCompleted
! before Parent Call
! ------------------------------------------------------------------
!
! ===== Save current mission description from BLOB field =====
! st is a StringTheory object
! see https://capesoft.com/docs/StringTheory3/StringTheory.htm#ToBlob
st.Start()
st.SetValue(?RtfMissionDescription{PROP:Text})
st.ToBlob(Mission.Description)
st.Free()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment