Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Multiline / multistring non-editable

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 611 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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"
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post