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

    Update StaticText Gadget

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 514 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 19/12/2008 at 05:49, xxxxxxxx wrote:

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

      ---------
      Hi,

      Can anyone help me? I have a for loop and would like to change the text of a statictext gadget( in a Dialog).

      > \> for(LONG i = 0; i<10000; i++) \> { \>    SetString(gadget, LongToString(i)); \> }

      But in this case, only the last element is written. What can I do to refresh it between the commands? The spin in the statusbar works fine and works without such message.

      Bye... 🙂

      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 19/12/2008 at 06:52, xxxxxxxx wrote:

        Where is the loop located, from which method?

        cheers,
        Matthias

        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 19/12/2008 at 07:02, xxxxxxxx wrote:

          Its outside the dialog. In the example, I forgot to write the pointer.

          I use my_dialog->SetString(my_gadget, "text");

          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 19/12/2008 at 07:19, xxxxxxxx wrote:

            strange, this seems to work fine here:

            > \> #define ID_ASYNCTEST 1000955 \> \> #include "c4d.h" \> #include "c4d_symbols.h" \> \> \> class AsyncDialog : public GeDialog \> { \>      private: \>           C4DGadget \*gadget; \> \>      public: \>           AsyncDialog(void); \>           virtual Bool CreateLayout(void); \> \>           C4DGadget\* GetGadget() { return gadget; } \> }; \> \> AsyncDialog::AsyncDialog(void) \> { \>      gadget = NULL; \> } \> \> Bool AsyncDialog::CreateLayout(void) \> { \>      // first call the parent instance \>      Bool res = GeDialog::CreateLayout(); \> \>      SetTitle("GuiDemo C++"); \> \>      GroupBegin(0,BFH_SCALEFIT,0,0,"",0); \>      { \>           gadget = AddStaticText(1000,BFH_SCALEFIT,0,0,String("hello"),0); \>      } \>      GroupEnd(); \> \>      return res; \> } \> \> \> class AsyncTest : public CommandData \> { \>      private: \>           AsyncDialog dlg; \>      public: \>           virtual Bool Execute(BaseDocument \*doc); \>           virtual Bool RestoreLayout(void \*secret); \> }; \> \> Bool AsyncTest::Execute(BaseDocument \*doc) \> { \>      dlg.Open(TRUE,ID_ASYNCTEST,-1,-1); \> \>      C4DGadget \*gadget = NULL; \>      gadget = dlg.GetGadget(); \> \>      if(gadget) \>      { \>           LONG i=0; \> \>           for(i=0; i<10000; i++) \>           { \>                dlg.SetString(gadget, "number: "+LongToString(i)); \>           } \>      } \> \>      return TRUE; \> } \> \> Bool AsyncTest::RestoreLayout(void \*secret) \> { \>      return dlg.RestoreLayout(ID_ASYNCTEST,0,secret); \> } \> \> \> Bool RegisterAsyncTest(void) \> { \>      // decide by name if the plugin shall be registered - just for user convenience \>      String name=GeLoadString(IDS_ASYNCTEST); if (!name.Content()) return TRUE; \>      return RegisterCommandPlugin(ID_ASYNCTEST,name,0,NULL,String("C++ SDK Menu Test Plugin"),gNew AsyncTest); \> } \>

            cheers,
            Matthias

            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 19/12/2008 at 07:25, xxxxxxxx wrote:

              Hmmn.. when I execute your code. The problem is, I see the last number but I don't see that the number is increased like a counter.

              Over the entire iteration, the static text contains "Hello" and the mouse pointer has the "busy" icon.

              I will check that at home on windows.

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