如何防止选择行时某些列突出显示
我有一个半动态创建的窗口(并使用 PowerBuilder 10.5 )。现在有几列可以有不同的颜色,我想在选择一行时看到这些颜色。但是我不知道如何取消选择这些列并使前几列保持选中状态。 我们应用程序中的突出显示功能仅执行 dw.selectrow( x, true )。
问候, 马里努斯
I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect these columns and have the first couple of columns remain selected.
The highlight function in our application just does a dw.selectrow( x, true ).
Regards,
Marinus
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为使用
selectrow
不会得到你想要的东西。如果您不需要多个选择,您可以使用数据窗口中的表达式更改当前行的背景。如果您希望某些列保持正常,您可以在要突出显示的列后面添加一个矩形,而不是更改行颜色。如果您需要突出显示多行,则必须通过添加虚拟列并使用它来控制背景来模拟多选,当然您需要在clicked
事件中处理选择和取消选择。如果您有处理选定行的代码,则必须更改它们以使用新方案,例如通过检查虚拟列中的值。I don't think you'll get what you want using
selectrow
. If you don't need multiple selections you could change the background of the current row with an expression in the datawindow. If you want some columns to stay normal you could do that with a rectangle behind the ones you want to highlight instead of changing the row color. If you need multiple rows highlighted you will have to simulate multi-select by adding a dummy column and using that to control the background, and of course you need to handle the selecting and deselecting in theclicked
event. If you've got code that deals with selected rows you'll have to change them to use the new scheme, for example by checking the value in your dummy column.如果您想使用 SelectRow(),也许使用 SetRowFocusIndicator() 会有所帮助。 IIRC(自从我使用它以来已经接近十年*s*),它禁用行着色以支持新方法。
我想到的另一种方法是使用 GetRow() 和 CurrentRow() 设置背景颜色表达式。这不是我的第一选择,因为它不允许有视力障碍的用户通过标准 Windows 颜色选择来选择他们可以处理的颜色,但如果您对选择性列上的颜色指示一意孤行,这将是是要走的路。
祝你好运,
特里。
If you want to use SelectRow(), maybe use of SetRowFocusIndicator() would help. IIRC (it's been pretty close to decade*s* since I've used it), it disables the row colouring in favour of the new method.
The other way that comes to mind is setting an expression for background colour that uses GetRow() and CurrentRow(). This wouldn't be my first choice, as it doesn't let users with vision impairment choose their colours through standard Windows colour selection to something they can deal with, but if you're dead set on colour indications on selective columns, this would be the way to go.
Good luck,
Terry.