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

    Edit C4DGadget on Pluginstart

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 540 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 23/07/2008 at 02:16, xxxxxxxx wrote:

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

      ---------
      Hi!

      I habe a problem with GUIDialog. I want to use SetString in the command-method but it does not work. The GeDialog is created on startup and the adress is stored in a global pointer_var.

      So I send a string in a BaseContainer to the command method and read it out. But SetString() only works, when I opened the dialog one time before. So, what can I do?

      Thanks and 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 23/07/2008 at 03:52, xxxxxxxx wrote:

        Can you please give a more detailed explaination of the problem because I can't quite follow you here.

        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 23/07/2008 at 04:52, xxxxxxxx wrote:

          Hi! 🙂

          I am sorry, I don't know how to explain it very well.

          Imagine I want to write something into a C4DGadget in a GUIDialog thats not opened yet on startup.

          Like the normal c4d console. On startup I can use GePrint() and the text is written into the console altough the console was not opened yet.

          My first-step-solution: "Create a global pointer adress and create a new object of this GUIDialog. The Commanddata calls this global pointer too, that not two seperate windows are created. But after the creation of the GeDialog, it does not know which Gadgets are stored in the Dialog, so, how is it solved in the console that you can write something to the console gadget, thats not in the memory yet on startup?"

          Thanks

          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 23/07/2008 at 06:04, xxxxxxxx wrote:

            You can't. The gadgets come into existence when the dialog is opened and CreateLayout() is (automatically) called.

            You can store the information somewhere in a class member either of the CommandData or the dialog and use that during the call to CreateLayout().

            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 23/07/2008 at 06:35, xxxxxxxx wrote:

              Why not store the text in member variable of the dialog class? Something like this:

              > \> // (c) 1989-2004 MAXON Computer GmbH, all rights reserved // \> ///////////////////////////////////////////////////////////// \> \> // example code for usage of listview elements \> \> // be sure to use a unique ID obtained from www.plugincafe.com \> #define ID_LISTVIEWTEST 1000452 \> \> #include "c4d.h" \> #include "c4d_symbols.h" \> \> class ListViewDialog : public GeDialog \> { \>      private: \>           String mytext; \>      public: \>           ListViewDialog(void); \>           virtual ~ListViewDialog(void); \> \>           virtual Bool CreateLayout(void); \> \>           void SetMyText(String text) { mytext = text; }; \> }; \> \> ListViewDialog::ListViewDialog(void) \> { \>      mytext = ""; \> } \> \> ListViewDialog::~ListViewDialog(void) \> { \> } \> \> Bool ListViewDialog::CreateLayout(void) \> { \>      // first call the parent instance \>      Bool res = GeDialog::CreateLayout(); \> \>      res = LoadDialogResource(DLG_LISTVIEW,NULL,0); \> \>      if (res) \>      { \>           SetString(GADGET_MYTEXT, mytext); \>      } \> \>      return res; \> } \> \> class ListViewTest : public CommandData \> { \>      private: \>           ListViewDialog dlg; \>      public: \>           virtual Bool Execute(BaseDocument \*doc); \>           virtual LONG GetState(BaseDocument \*doc); \>           virtual Bool RestoreLayout(void \*secret); \> }; \> \> LONG ListViewTest::GetState(BaseDocument \*doc) \> { \>      return CMD_ENABLED; \> } \> \> Bool ListViewTest::Execute(BaseDocument \*doc) \> { \>      dlg.SetMyText("hello world"); \>      return dlg.Open(TRUE,ID_LISTVIEWTEST,-1,-1); \> } \> \> Bool ListViewTest::RestoreLayout(void \*secret) \> { \>      return dlg.RestoreLayout(ID_LISTVIEWTEST,0,secret); \> } \> \> Bool RegisterListView(void) \> { \>      // decide by name if the plugin shall be registered - just for user convenience \>      String name=GeLoadString(IDS_LISTVIEW); if (!name.Content()) return TRUE; \>      return RegisterCommandPlugin(ID_LISTVIEWTEST,name,0,NULL,String(),gNew ListViewTest); \> } \>

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

                Hi!

                Yes, a variable stored in the class is a solution, but I thought there is an alternative, because its a lot of text, so I would put it twice in the memory. (variable and the gadget)

                Thank you Matthias, kuroyume0161 for your great help.. 🙂 I will solve it like you suggested it.

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