Usage This EditField subclass lets you convert styled text to HTML. Its superclass has been set to EditField for backwards compatibility with older versions of REALbasic. If you are using a newer version of REALbasic or REAL Studio, you should change its Super to TextArea in the REALbasic/REALStudio IDE Property list panel. Do not rely on an automatic conversion to make the correct change. PWStyleHTMLField has built-in support for hyperlinks. It also allows you to insert any custom HTML as unformatted text in the styled-text field, and will render that as part of your HTML. This allows you to include things like tables, images, and CSS-based formatting that cannot be added to a RS TextArea or EditField. Escaping the "<" character Because it renders HTML text you enter, it assumes that anywhere it encounters a "<" character, it is the beginning of an HTML tag. You can get around that by escaping the < character with a "\" character (e.g. "\<spanner>" to display "<spanner>"). To use a PWStyleHTMLField instance in your REALbasic/REALStudio project, drag a TextArea or Multiline EditField into a window and set its super to PWStyleHTMLField. If you want to take advantage of PWStyleHTMLField's built-in Undo support, you need to make sure you have an Edit>Undo menu item (and Edit>Redo if you want to offer that functionality), and enable the menubar for your App class and editing window. (For more on the built-in Undo support, see the Undo Support section of the documentation.) Then of course you'll need to add controls for styling text you enter in it. You may be tempted to paste styled text into your styled text field. Unfortunately, that can result in font name differences that are not apparent from looking at the text on screen, but create issues with rendering the text as HTML. |