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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Modal dialog closing too fast...

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 372 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 18/04/2006 at 09:01, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.5 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hello everybody.
      I've just begun to try to make modal dialogs in COFFEE, so I've made a test plugin which creates a single ComboBox in a dialog window. But, my problem is that the dialog closes immediately after the user selects an item of the ComboBox.
      Here is my code :

      class myDialog : GeModalDialog  
      {  
      public:  
          myDialog();  
          CreateLayout();  
          Command(id,msg);  
      }  
        
      myDialog::myDialog()  
      {  
          super();  
      }  
        
      myDialog::CreateLayout()  
      {  
          AddComboBox(1,0,0,0);  
              AddItem(1,1,"Button A");  
              AddItem(1,2,"Button B");  
              AddItem(1,3,"Button C");  
      }  
        
      myDialog::Command(id,msg)  
      {  
      }  
        
      class myPlugin : MenuPlugin  
      {  
      public:  
          myPlugin();  
          GetID();  
          GetName();  
          GetHelp();  
          Execute(doc);  
      }  
        
      myPlugin::myPlugin()  
      {  
          super();  
      }  
        
      myPlugin::GetID()  
      {  
          return 1000001;  
      }  
        
      myPlugin::GetName()  
      {  
          return "myPlugin";  
      }  
        
      myPlugin::GetHelp()  
      {  
          return "Something";  
      }  
        
      myPlugin::Execute(doc)  
      {  
          var d=new(myDialog);  
          d->Open(-1,-1);  
          return;  
      }  
        
      main()  
      {  
          Register(myPlugin);  
      }
      

      I would appreciate your help. Thank you.

      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 18/04/2006 at 17:43, xxxxxxxx wrote:

        I wouldn't use '1' as an active gadget's id. Best to start at a value of '10000'. See the documentation under "Dialog Layout" subheading "Manual Layout" for an example of suggested numbering (or check out some of the example sources linked as well). For non-active gadgets, such as StaticText used solely as labels, '0' is fine.

        Your gadget id may be conflicting with the default OK/Cancel id's which may explain the odd behaviour. I see that the Calculator example uses '1' to '14', but I wouldn't start that small. 🙂

        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/04/2006 at 00:04, xxxxxxxx wrote:

          You're right. Changing my gadget id to a value of 200 makes my dialog working.
          Thanks a lot for your help.

          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/04/2006 at 00:35, xxxxxxxx wrote:

            you should really use values greater than 1000 as lower values are used by Cinema 4D in some areas afaik.

            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/04/2006 at 01:16, xxxxxxxx wrote:

              Okay, thanks, I didn't know that.

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