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

    Slider length in GeDialog.AddEditSlider [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    9 Posts 0 Posters 640 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 03/03/2015 at 06:38, xxxxxxxx wrote:

      I've been using,

      GeDialog.AddEditSlider
      

      but I don't see how you set the length of the numeric entry field and the length of the slider.
      In the picture here: http://plugincafe.com/python/modules/c4d.gui/GeDialog/index.html#GeDialog.AddEditSlider it shows the slider taking up most of the length.

      How do I achieve that?

      Thanks,

      Chris

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

        On 03/03/2015 at 09:19, xxxxxxxx wrote:

        You can adjust the alignment and scaling of the slider by passing the appropriate flags as second parameter. For your case you can pass BFH_SCALE for horizontal scaling.

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

          On 03/03/2015 at 16:11, xxxxxxxx wrote:

          I don't think that does what I asked.
          I'm asking how to set the ratio of the length of the edit field, to the length of the slider.
          I haven't been able to get a short edit field with a long slider area like in the picture.

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

            On 04/03/2015 at 02:03, xxxxxxxx wrote:

            Ah ok sorry then I got you wrong. Have you tried setting the optional initw parameter?

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

              On 16/03/2015 at 10:58, xxxxxxxx wrote:

              Hi terrachild,

              I'd like to know if you tried what Satara suggested, or otherwise found a solution to your problem?

              Joey Gaspe
              SDK Support Engineer

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

                On 17/03/2015 at 12:13, xxxxxxxx wrote:

                Yes I tried it:

                AddEditSlider(TAB_CAMERA_BACKGROUND_TRANSPARENCY, flags = c4d.BFH_SCALE, initw=400, inith=12)
                

                And all that does is set the length of the entire gizmo.
                In this case it made it equal to 400, but the numeric entry portion took up the majority of the length.
                How do you set it so the slider takes up the majority of the length?

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

                  On 20/03/2015 at 16:15, xxxxxxxx wrote:

                  Hi terrachild,

                  I tried out various possibilities and found the following, please try it out and let me know:

                  AddEditSlider(TAB_CAMERA_BACKGROUND_TRANSPARENCY, c4d.BFH_SCALEFIT, 30, 12)  
                  

                  It seems that by changing the flag to BFH_SCALEFIT, yet reducing the width to 30, the slider is as long as is reasonably possible, yet the numeric entry portion is just big enough to display 100 when set to that value, with the slider all the way to the right.  If I increase the width with the same flag, the numeric part proportionally grows as the slider shrinks.

                  I hope that helps!  Please let me know if it does, and if it doesn't, I'll need your code that sets up that part of the UI to understand the exact context.

                  Joey Gaspe
                  SDK Support Engineer

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

                    On 26/03/2015 at 08:51, xxxxxxxx wrote:

                    Wow, the secret code!
                    I've struggled with that for months.
                    Why isn't this documented somewhere?

                    Just to make clear for others: If you set the flag to 'c4d.BFH_SCALEFIT', then 'initw=25' (or any other values) works to adjust the ratio of the numeric portion length to the slider length.

                    Thanks,

                    Chris

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

                      On 27/03/2015 at 10:02, xxxxxxxx wrote:

                      Hi Chris,

                      Glad to hear it works, and thanks for letting us know!  I'll admit, setting up UI elements to scale properly, especially when they have more than one element like in this case, is not obvious.  I will see about getting this documented properly.  I admit I had to use trial and error to find the solution.  The screenshot in the help docs convinced me there had to be a way, assuming it was showing an actual EditSlider.  I can see why you could have been stuck for a long time on this problem, as the combinations you have to try are not obvious.  I will set this topic as solved.

                      Joey Gaspe
                      SDK Support Engineer

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