April 13, 20178 yr Hi all. I am about to start building a user interface to provide text formatting functionality whereby users can format text using buttons I have provided such as Bold, Italic, and so on. Basically buttons for all the text formatting functions FileMaker provides. I specifically need the ability for users to be able to highlight text within a block of text in a text field and add formatting to the highlighted text. Can anyone recommend a source with some examples or video tutorials on how to accomplish this. Thanks in advance
April 13, 20178 yr This has come up several times, here are two I found quickly: http://fmforums.com/topic/38143-buttons-to-apply-text-styles-to-users-selection/?do=findComment&comment=177325 http://fmforums.com/topic/85644-keyboard-shortcut-for-text-color/?do=findComment&comment=393975
April 17, 20178 yr Author Is there any way to detect if formatting is already applied? For instance, if highlighted text is already bold I would like to be able to unbold the text? Trying to approximate known text editing behavior as much as possible.
April 17, 20178 yr Author Thanks Comment. I was able to use GtAsCSS to detect styling. I'm experiencing a strange behavior now though. When I apply a text style using TextStyleAdd ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; Bold ) the highlighted text becomes Bold as desired. Then with the same newly bold text highlighted and using TextStyleRemove ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; Bold ) The Bold styling is not removed. However if I select the same text and include one or more preceding unbolded characters it then removes the Bold style.
April 17, 20178 yr Yes, I remember this has come up before too. Unfortunately, I cannot find the threads (I think there were two of those) and I don't remember if a satisfactory solution was ever found.
Create an account or sign in to comment