【问题标题】:How to Change Appearance of Text in ChUI Editor Widget如何在 ChUI 编辑器小部件中更改文本的外观
【发布时间】:2019-10-01 22:16:01
【问题描述】:

我正在使用编辑器小部件来显示从文本文件中读取的 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.

当显示编辑器时,编辑器小部件中的文本被“突出显示”(即,以反向视频显示)。 (见下面的截图。)

有没有办法在编辑器小部件中显示文本,使其不被“突出显示”?

【问题讨论】:

  • 突出显示是什么意思。附上截图。这可能是您终端中的设置?
  • 我认为这不是终端设置问题。进度只是像对任何其他输入字段一样突出显示该字段(例如,使用帧 a 更新 tvar。)我希望将编辑器小部件设置为只读可以防止这种情况发生,但事实并非如此。基本上,我希望用户能够在编辑器小部件中移动,不更新任何内容,并且不突出显示小部件中的文本。
  • 对我来说,您的确切代码只会加下划线,而不是倒置。也许它是您终端软件中的一个设置...

标签: openedge progress-4gl


【解决方案1】:

我通常会这样做:

/* 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

如果你喜欢这种东西,你也可以使用框架和小部件属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-19
    • 1970-01-01
    • 2011-09-17
    • 1970-01-01
    • 2013-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多