How to set a slider?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/01/2008 at 06:46, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.5 
    Platform:      Mac OSX  ; 
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hi,

    How can I set a value in a slider? With
    > GetFloat(SLIDER);
    I can read out the slider value but
    > SetFloat(SLIDER, x);
    doesn't work.

    Thanks in advance!!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/01/2008 at 14:31, xxxxxxxx wrote:

    This should be the same in C++, no?

    BTW, how do you know how to access GUI elements? They are not documented in the SDK...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/01/2008 at 18:47, xxxxxxxx wrote:

    Yes ...

    I also found out it's not working in the way it should (or we hope it will) ...

    I tried this tricky way ... but in C++ ...
    But it may not be a good way ...

    Code In CreateLayout

    AddEditNumber(9990,0,100,10);
    SetReal(9990,50,0,200);

    GroupBegin(9991,0,1,1,"",0);
         AddSlider(9992,0);
         SetReal(9992,50,0,200);
    GroupEnd();

    Code In Command

    case 9992:
         {
              Real r;
              GetReal(9992,r);
              SetReal(9990,r);
         }
         break;

    case 9990:
         {
              Real r;
              GetReal(9990,r);
              LayoutFlushGroup(9991);
              AddSlider(9992,0);
              SetReal(9992,r,0,200);
              LayoutChanged(9991);
         }
         break;

    Just try to use the slider and the text will change on the fly ...
    But type in the text ... you need to press ENTER to see the change in SLIDER ...

    So I think you can do it the same way in COFFEE ...
    Put your slider in a group ... and refresh the layout after changing its value ...

    Wishing you can do it ...
    Zaw Min Tun



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/01/2008 at 16:38, xxxxxxxx wrote:

    You used a Slider and transformed it into some sort of EditSlider?

    Well, I tried this with a simple Slider component:

    > value = GetInt(IDC_SLIDER);

    This returns the actual value of the slider. But the reverse:

    > SetInt(IDC_SLIDER, 50);

    Does not work. I get the error: "Too few parameters". How do I know how many parameters the Slider wants? I can't find anything in the sdk manual.

    BTW, I also tried:

    > SetInt(IDC_SLIDER, 50, 0, 100);


Log in to reply