openedge - 如何在 ChUI 编辑器小部件中更改文本的外观
问题描述
我正在使用编辑器小部件来显示从文本文件中读取的 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.
当显示编辑器时,编辑器小部件中的文本被“突出显示”(即,以反向视频显示)。(见下面的截图。)
有没有办法在编辑器小部件中显示文本,使其不被“突出显示”?
解决方案
我通常会这样做:
/* 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
如果你喜欢这种东西,你也可以摆弄框架和小部件属性。
推荐阅读
- c# - 实体框架:默认值问题
- java - 带有 Java 14 的 IntelliJ 2020.1 中的“记录”预览功能在 Maven“安装”期间因编译器错误而失败,但以其他方式运行
- r - 将 2 个 DF 匹配 2 列 R
- reactjs - 如何使用 React bootstrap typeahead 清除函数中的输入
- python - 如何动态地知道和实例化在 Python 模块中实现的一个类
- r - 在没有阿拉斯加和夏威夷的 R 中绘制美国地图
- c# - C#如何制作泛型方法
- python - Python list 按所需顺序重新排列元素
- node.js - Sequelize:如何在同一列的 WHERE 中使用 AND 运算符?
- javascript - 如何在脚本中更改 Google Docs 表格单元格中的文本颜色?