Multiline / multistring non-editable



  • On 21/11/2013 at 12:57, xxxxxxxx wrote:

    How to make a multiline or a multistring description field readonly, so it cannot be edited.
    I tried following, but in both cases you can delete the text in the field.

    1) self.AddMultiLineEditText(MULTITEXTFIELD, flags=c4d.BFH_MASK, inith=200, style=c4d.DR_MULTILINE_READONLY)
      
    2) resource file:
    STRING DOCUMENT_COLORINFO { ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }
      
    Plugin:
        def Init(self, op) :
            self.InitAttr(op, str, [c4d.MULTISTRING])        
            op[c4d.MULTISTRING]= "Test over multiple lines\n"
    

    Edited By Moderator: Fixed typo in the title.



  • On 21/11/2013 at 13:34, xxxxxxxx wrote:

    I think this is a bug, I tried it here using just some userdata and checking the READONLY option and I was still able to delete the text.

    A way you could go around this is to have the text input from somewhere else, that when if you "delete it" it will just reappear.



  • On 21/11/2013 at 23:25, xxxxxxxx wrote:

    Hi,

    Have you tried to call GeDialog.Enable(gadget, enable) with the MultiLineEditText ID and false?



  • On 22/11/2013 at 00:38, xxxxxxxx wrote:

    Hi Yannick, thanks for the reply.

    It is working, but that gives another issue.
    Because you "disable" it, the multiline field is totally not accessible anymore.
    So, also the scroll sliders at the right site or at the bottom do not appear.
    Meaning you cannot scroll anymore.

    Also, I'm using a ObjectPlugin with in fact no dialog / description.
    So I am using a InitAttr to set the About text.
    I do not call or use GeDialog in the plugin, so I cannot use GeDialog.Enable(gadget, enable)
    All I want to do is add a About tab with About information on the plugin.

    Resource file:
    
    STRING MULTILINESTRING{ ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }
    
      
    
    
    Plugin:
    
        def Init(self, op) :
    
            self.InitAttr(op, str, [c4d.MULTILINESTRING])        
    
            op[c4d.MULTILINESTRING]= "Test over multiple lines\n"
    


  • On 22/11/2013 at 01:16, xxxxxxxx wrote:

    Hi Pim,

    when I checked your plugin, I was thinking the Multiline field was editable because I was able to
    delete character from the field. It is obviously a bug that you can remove characters from the field
    when the READONLY flag is set.

    You could do something like this instead, using multiple static text fields:

    Best,
    -Niklas



  • On 22/11/2013 at 01:24, xxxxxxxx wrote:

    Hi Niklas,

    Thanks, I agree that it is possible work around.
    But to prevent sleepless nights over this issue, I asked the question.
    But I agree, it seems a bug.
    Even the warning field in the Preferences > OpenGL is not readonly.


Log in to reply