使用案例敏感性复选框自定义nstextfinder

发布于 2025-02-13 06:26:01 字数 969 浏览 0 评论 0原文

我希望在我的nstextview中添加一个复选框,以供病例敏感搜索。我已经阅读了Apple文档,但是nstextViewnsscrollviewnstextfinder最好将其描述为混淆。我正在使用performTextFinderAction:通过查找操作。

有没有办法在查找栏中添加其他按钮或视图,还是我必须替换整个内容?仅添加一个选项似乎有点过分杀伤。

病例敏感性也通过粘贴板属性传递,尽管在阅读文档后,我仍然感到困惑文本视图实际检查属性的位置和何时。 nstextFinderClient仅提供匹配的子字符串的范围和矩形。
https://developer.apple.com/documentation/appkit/nstextfindercaseinsensitivekey

I've紧随其后使用此示例创建我自己的文本查找器方法:
nstextfinder + nstextfinder + prograponmatemationmatematematematemation + programmatity在nstextview中更改nstextview

任何,任何 nstextfinder 文档仅使用其提供的基本查找栏覆盖,也从不触摸自定义或完全更换它。

任何帮助或指出更好的文档的帮助将不胜感激。

I'm looking to add a checkbox for case-sensitive searches in my NSTextView. I've read through the Apple documentation, but the relationship between NSTextView, NSScrollView and NSTextFinder is best described as obfuscated. I am using performTextFinderAction: to pass the find actions.

Is there a way to add additional buttons or views to the find bar, or do I have to replace the whole thing? Seems a bit overkill for just adding a single option.

Case-sensitivity is also passed through a pasteboard attribute, although after reading through the documentation, I'm still confused where and when the text view actually checks for the attributes. NSTextFinderClient only provides ranges and rects for the matched substrings.
https://developer.apple.com/documentation/appkit/nstextfindercaseinsensitivekey

I've followed creating my own text finder method using this example:
NSTextFinder + programmatically changing the text in NSTextView

However, any NSTextFinder documentation only covers using the basic find bar it provides, and never touches the subject of customizing it or replacing it altogether.

Any help or pointing to better documentation would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文