开发者

Get selected text within an text item in Oracle forms

开发者 https://www.devze.com 2023-01-26 03:14 出处:网络
There is following scenario: In Oracle Forms 10, there is a TextItem with text in it. User sel开发者_如何学JAVAects a part of the text using his mouse or keyboard and presses a forms button with trig

There is following scenario: In Oracle Forms 10, there is a TextItem with text in it. User sel开发者_如何学JAVAects a part of the text using his mouse or keyboard and presses a forms button with trigger behind it.

How do I find the portion of the text selected by the user?

In VisualBasic, there is something like SelectionStart, SelectionEnd, SelectionText. What is the equivalent in forms? Is there any chance to do it with WebUtil?

Thanx


There are 3 built-ins in Oracle form for handling this sort of thing:

COPY_REGION
CUT_REGION
PASTE_REGION

They are all restricted built-ins, so you need to be choosy about which trigger you call them in. Refer to the documentation, it will tell you whether restricted built ins are allowed or not in that particular trigger.

They take no parameters, only operating on the currently selected item (see :system.cursor_item). So, the user is in "textfield1" and they select a certain portion of the data. You need to decide which trigger to issue COPY_REGION in (the easy one is KEY-NEXT-ITEM). For your example, when the user would then press the button to copy, your code would navigate to the intented TextItem and issue the PASTE_REGION built-in.

0

精彩评论

暂无评论...
验证码 换一张
取 消