Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    ProgressDialog and SetTitle()

    Cinema 4D SDK
    sdk c++
    2
    3
    590
    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.
    • WickedPW
      WickedP
      last edited by

      Hi folks,

      is it possible to update a ProgressDialog's title inside the Main() function? I'm wanting to make the title "x of y complete". Doing this doesn't work:

      // pseudo code
      .. Main()
      {
      SetPercent(0.0);
      for(int i = 0; i < 100;)
      {
      String title = String("Processing i+1 of 100");
      SetTitle(title);
      SetPercent((i + 1) / 100);
      ++i;
      }
      SetPercent(1.0);
      }
      

      I'm guessing because Main() is on another thread. Is this possible?

      WP.

      wickedp.com

      1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov
        last edited by

        Hi @WickedP,

        The assumption would be that the execution of the main function happens too early, when there's no GUI yet available. Please, consider executing your implementation inside the PluginMessage() function, using one of the messages: C4DPL_STARTACTIVITY or C4DPL_PROGRAM_STARTED.

        Let me know if you have any further questions.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • WickedPW
          WickedP
          last edited by

          Hi @i_mazlov

          The dialog/gui is open. It's a progress dialog that I use to run an export function.

          I did some more digging, and I believe I've solved it. I had to put the SetTitle() into the dialog's Timer() function. So, something like this:

          virtual void MyProgressDialog::Timer(const BaseContainer& msg)
          {
              // 'title' is a class-level string variable
              SetTitle(title);
          
              return ProgressDialog::Timer(msg);
          }
          

          Seems to work as expected.

          WP.

          wickedp.com

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