Update StaticText Gadget



  • 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... :)



  • 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



  • 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");



  • 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



  • 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.


Log in to reply