Textboxes are still writable when memo.readonly is set TRUE

  • Using the OCX version of Textdynamics i use the "editor" as a readonly-viewer of RTF-files from different sources.

    That works pretty good with only one exception.

    Even with shutting off every "interactive" part by setting memo.readonly and several additional Flags with SetBProp(...) so that not even the InsertCaret is visible, Hyperlinks are working with one-click and so on...

    That's great, but there is on flaw i was not able to "shut off".

    Perhaps i overlooked something i should have set too, but i suspect it's somekind of flaw / error.

    When the RTF conversion (using Premium-Lic) brings textboxes or in my case movable-images to the text, theses images or textboxes are not affected by any of the ususal Flags. Even with all flags set to "readonly, no-selection, no-handlemark, no-nothing..." i can still select the images/boxes.

    After selecting the box shows the typical handles and i can move it around and/or resize it any way i like which i should not be allowed according to my settings.

    I use the following settings. THIS is a reference to the TextDynamics element itself.

    Has anyone an idea what's going wrong here? Any suggestions how to shut off this interactivity too?

    Thanks and regards
    Michael

  • My above example sets the flags during the init of the object.

    During runtime i set the content via SetText(...), after which i experienced the problems that the flags for ReadOnly are ignored...

    After playing with it a littlebit more, i found out that using SetText on a MEMO that is flagged READONLY most of the flags originally set to READONLY are automatically resetted which causes the text to be editable again.

    Julian, if this behaviour is on purpose, perhaps you could place a comment in the helpfile to SetBProp() so that this behaviour-info is available to all.

    Not all flags are resetted, e.g. SetBProp(0,7,1) for hyplink-one-click is still set after SetText().

    So, at least under VFP9 SP2 the following sequence in which the flags and text is set is important.


    Using the SetBProp(...) for ReadOnly, DisableSelection... during INIT will NOT work correctly as ReadOnly is (at least partly) resetted to Editable when using SetText(...) on later occasions.

    I don't know if this behaviour is VFP9 only or if it is on purpose, but i can now confirm that with this sequence by setting the readonly-flags again after changing or setting the textcontent a real readonly-display is still possible.

    I hope this helps some of you guys out there, because TextDynamic is by far the best rtf/wordprocessing editor-ocx you can find for using in Microsoft Visual Foxpro. So stay tuned for more info on usage with VFP9 here on the forum. :-)

    • Offizieller Beitrag

    Hi,

    the behaviour is not intended. I can only think that somehow the editor is recreated.

    I have not seen this in my demos here - maybe you can assign some text in Init as well, or at least empty text. A later assignment should not change the flags.

  • Hi Julian,

    thank's for the hint with initially setting the content with an empty string during INIT. That did it.

    So for all you folks out there...

    When you attempt to make an absolut readonly-not-selectable text, you should be sure to initialize the "editor" during the init-phase with an empty string and set the READONLY / Not-Selectable Flags afterwards.

    So in addition to above example code in VFP9 SP2 there is only a minor change:

    So... Problem solved.

    Thanks and best regards
    Michael