如何在 ChUI 编辑器小部件中更改文本的外观

How to Change Appearance of Text in ChUI Editor Widget

我正在使用编辑器小部件来显示从文本文件中读取的 longchar 值。 Linux.

上的 OpenEdge 11.5 ChUI

类似如下逻辑:

def var mytext as longchar
init "Sample Text.  Sample Text.  Sample Text.".

form mytext view-as editor large inner-chars 30 inner-lines 15
scrollbar-horizontal scrollbar-vertical
with frame frame1 no-labels no-box.

view frame frame1.
display mytext with frame frame1.
mytext:read-only = yes.
enable mytext with frame frame1.
wait-for end-error of mytext.

显示编辑器时,编辑器小部件中的文本为 "highlighted"(即以反白显示)。 (见下面的截图。)

有没有办法在编辑器小部件中显示文本而不是 "highlighted"?

我经常这样做:

/* textedit.p
 *
 * a file viewer
 *
 */

define variable fileName as character no-undo format "x(30)".

define variable fileBody as longchar  no-undo.

fileName = "textedit.p".

file-info:file-name = fileName.
if file-info:full-pathname = ? then
  do:
    message "no such file:" fileName.
    pause.
    quit.
  end.

copy-lob from file file-info:full-pathname to fileBody.

display
  fileBody view-as editor inner-chars 160 inner-lines 52 large no-word-wrap
 with
  no-box
  no-labels
  color display normal prompt normal    /* this changes the coloring */
.

pause.

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvref/color-phrase.html

如果您喜欢的话,您还可以 fiddle 使用框架和小部件属性。