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

    EDITTEXT_HELPTEXT usage [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 424 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 18/11/2014 at 01:49, xxxxxxxx wrote:

      Hi all,

      I am trying to add a text box in my plugin using this

      self.AddEditText(id=SEARCH_BOX, flags=c4d.BFH_SCALEFIT , editflags=c4d.EDITTEXT_HELPTEXT)

      but i have no idea how to initialize this EDITTEXT_HELPTEXT to "Enter your search string here". So can anyone tell me how can i do that.
      Thanks

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

        On 18/11/2014 at 02:41, xxxxxxxx wrote:

        Hello and welcome,

        to set the help text of this gadget simply use the SetStringURL-REMOVED function with the corresponding flag:

          
        editTextGadget = self.AddEditText(id=2000, flags=c4d.BFH_SCALEFIT , editflags=c4d.EDITTEXT_HELPTEXT)  
        self.SetString(id = editTextGadget,value  = "This is the help text",flags = c4d.EDITTEXT_HELPTEXT)  
        

        best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 18/11/2014 at 03:01, xxxxxxxx wrote:

          Thanks a lot.

          I also want to ask one more thing. Can we put an image inside the text box like in search boxes there is a small search icon at the corner?

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

            On 18/11/2014 at 05:47, xxxxxxxx wrote:

            Hello,

            I don't think it is possible to add such an image to the actual edit field. But you can create a bitmap button using such an icon next to your text field.

            Best wishes,
            Sebastian

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

              On 18/11/2014 at 21:02, xxxxxxxx wrote:

              Hi,

              Thanks for the help.
              I have two more queries.

              1. Can we add a label inside a bitmap button along with an image. I know we can give a tool tip but i want to provide a text and an image inside the button. Is it possible? Also we cannot embed an image with a text because we have to support it in different languages.

              2. From the text field how can we get the text entered after enter key is pressed as we have to launch a command after press of enter.

              Thanks
              Nishant

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

                On 19/11/2014 at 05:23, xxxxxxxx wrote:

                Hello,

                the bitmap button custom GUI does not offer such a label. You could use GeGetLanguage()[URL-REMOVED] to get the default language and set the image accordingly.

                To catch the "Enter" event simply listen to the gadgets events in the dialog's Command()[URL-REMOVED] function. You can check if the currently pressed key is "Enter" with GetInputState()[URL-REMOVED] and access the string value of the edit text gadget with GetString()[URL-REMOVED]:

                  
                      if id == 2000:  
                          # check if "Enter" is pressed  
                          resultBaseContainer = c4d.BaseContainer()  
                          self.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ENTER,resultBaseContainer)  
                            
                          if resultBaseContainer[c4d.BFM_INPUT_VALUE]:  
                              #print full text  
                              print self.GetString(2000)  
                

                For questions no longer related to this thread's original topic please open a new thread. Thanks.

                Best wishes,
                Sebastian


                [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                  On 19/11/2014 at 21:37, xxxxxxxx wrote:

                  Thanks 😉

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