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
    • Register
    • Login

    CheckValueRanges()?

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 214 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

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

      On 02/01/2005 at 21:27, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.012 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Okay, strangeness.

      Here's my code, called from iPDialog::Command() :

        
      // CMD: Set FPS  
      void iPDialog::SetFPS(LONG value)  
      {  
           //if ((value < FPS_MIN) || (value > FPS_MAX))   
           if (CheckValueRanges()) SetLong(IP_SET_FPS, settings.GetFPS(), FPS_MIN, FPS_MAX, 1);  
           else settings.SetFPS(value);  
      }  
      

      1. Note that checking for the opposite return works (TRUE = bad value, FALSE = good value). This is not what the documentation says. Maybe I'm not implementing it correctly - how should I know since there are no examples or explanations.

      2. When there is a bad value in this case, it doesn't set it to the previous value (settings.GetFPS()), it makes it a part of the value (501 > 50, 600 > 60, etc.).

      I could use my own check (commented out), but can't get the gadget to update and cannot find a proper method/message to do this. Appreciate some explanations.

      Thanks,
      Robert

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

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

        On 03/01/2005 at 00:41, xxxxxxxx wrote:

        Figured it out:

          
        settings.SetFPS(value);  
        SetLong(IP_SET_FPS, settings.GetFPS(), FPS_MIN, FPS_MAX, 1);  
        

        The value is always within bounds, so I just need to grab it and then set the EditNumber gadget to show the bounded value instead of the typed-in one.

        Robert

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