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

Editor control in a form

Is it possible to insert the editor control in a OI form.
It must look like an editbox.
We want to do this for editing fields, values subvalues in a record.
So the Ctrl-E and Ctrl-Shift-E must be active ....

Regards Ed Keeman


  • Ed,

    It is very possible. The SRP Editor utility itself is an OI form with the SRP Editor control embedded.

    If you are licensed for the SRP Editor utility you are permitted to use the SRP Editor control this way. However, it is not supported. This means we might not be able to give you assistance if you run into problems. We also do not have all of the properties, methods, and events documented. I think there are a few which have been posted on the list, but I have not looked so I might be wrong. The Prog ID is SRP.Editor.1 if you want to experiment.

    A few comments:
    • Ctrl+E/Ctrl+Shift+E are not inherent shortcuts to the SRP Editor control. You must provide this in your form.
    • You will want to use the ExpandCurrLine and CollapseCurrLine methods. These do not take any arguments.
    • The SRP Editor control does not appear to get focus automatically just by tabbing through your form. You may have to figure out a way to force the control to get focus.
    • The SRP Editor control does not lose focus on its own because the tab and enter keys are meaningful to the control.
    • The left side channel, where the line numbers normally appear, cannot be removed AFAIK. So this would take away the edit box appearance.

    If you are motivated to try and make this work we can provide consultancy.
  • We want to use the editor control just for editing configuration records of other srp controls.
    We do this now with the Arev editor.

    Can you please tell me how I can set the delimiter for the lines?
    How do we put text in the control? Is it done with the text property or with the loadtext method?

  • Ed,

    Try this (this is unsupported and untested):
    Ctrl = @Window : ".EDITOR" LenData = Len(Data) RecInfo = Str_Unicode(Data) LockVariable Data as Char Send_Message(Ctrl, "OLE.LoadTextW", GetPointer(Data), LenData, 1) UnlockVariable Data
  • Hi,

    Getting the data out of editor control is another problem.
    The code beneath works for the data but the delimeters become questionmarks.
    How can we get the data out in a proper way?
    Ctrl = @Window : ".EDIT" L = Send_Message(Ctrl, "OLE.GetDataLength") mask = str(' ',L) ; * vul mask met L spaties P = GetPointer(mask) res = Send_Message(Ctrl, "OLE.GetData",L,p) data = mask[1,res]
Sign In or Register to comment.