Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Open Insight Copy From Edit Box Glitch

edited May 2021 in OpenInsight
If you have an edit box with text in it you can copy the text in two ways:

1. CTRL-C
2. Context Menu

When I copy via the context menu, it works fine. But when I copy via CTRL-C, the new lines in the text are copied as this character û, which I am pretty sure is the @fm character (or one of the other ones).

Is this normal, or is there something wrong I am doing?

I guess to fix I need to capture the copy event and then swap the û with \r\n...but this shouldn't even be happening to begin with, right?

Comments

  • That is likely the text mark (@TM), which is how edit box controls store line breaks internally. To the outside world, however, that should appear as CR/LF. I had never experienced what you described so I did a quick test. In both instances I get CR/LF copied to the clipboard.

    Are you handling Ctrl+C yourself? If so, how are you doing this?
  • edited May 2021
    Hi, yes I can see that we are handling it ourselves.

    value = get_property(focusField, 'DEFPROP') selection = get_property(focusField, 'SELECTION') iF selection<2> > 0 THEN value = value[selection<1>, selection<2>] end oryxlib_copy_to_clipboard(value)


    oryxlib_copy_to_clipboard
    --------------------------------------
    if value then convert @vm to ',' in value swap @fm with crlf$ in value set_property('CLIPBOARD', 'TEXT', value) // srp_set_clipboard_text end

    So I need to make it swap @tm with \r\n, i think. But I'd rather not do anything. I would have assumed that ctrl-c would just work without us having to do anything. is this not true?
  • Ctrl+C will work for most controls but not for edit tables. Having said that, I don't see any logic that mines edit tables for data so I am not sure why you have custom code for this.
  • I'd hazard a guess that at some time in the distant Oryx past, someone wanted to convert edittable data into a csv via copy/paste thus the above was added to the oryx library and it gradually weaved it's way into generic use.

    @Josh, you could risk removing the logic (risk if it's part of promoted events, not so much if it's a direct call for that function only) or you could probably get the result you're looking for by adding

    swap @tm with crlf$ in value
  • I will just put a check in place that if the control is an edit box, it should do this:

    swap @tm with crlf$ in value
    thanks
Sign In or Register to comment.