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

    Popup desctiption

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 304 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 09/12/2010 at 08:47, xxxxxxxx wrote:

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

      ---------
      Hello all,
      i am trying to create a popup description (CUSTOMGUI_POPUP) in GetDDescription of tagdata.
      i can create popup but i can't find the way to add the element inside popup.
      any help ?
      Franz

      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 14/12/2010 at 03:26, xxxxxxxx wrote:

        You have to react to the MSG_DESCRIPTION_POPUP message to fill the menu structure.

        Here is a simple example of a popup menu with a sub-menu and some separators.

          
        Bool MorphMixerObject::Message(GeListNode *node, LONG type, void *data)  
        {  
          if (type==MSG_DESCRIPTION_POPUP)  
          {  
              DescriptionPopup *dp = (DescriptionPopup* )data;  
          
              if (dp->id[0]==MORPHMIXER_PRESET)  
              {  
                  if (dp->chosen==0)    //fill menu  
                  {  
                      dp->popup.InsData(MORPHMIXER_PRESET+1,"hello");  
                      dp->popup.InsData(MORPHMIXER_PRESET+2,"world");  
                      dp->popup.InsData(0,String());    //separator  
                        
                      BaseContainer child;    //sub-container for sub-menu  
                      child.InsData(MORPHMIXER_PRESET+3,"CINEMA 4D");  
                      child.InsData(0,String());    //separator  
                      child.InsData(MORPHMIXER_PRESET+4,"BodyPaint 3D");  
                      child.InsData(1,"Sub-Menu");    //sub-menu name  
                      dp->popup.InsData(0,child);        //insert sub-menu  
                      child.FlushAll();  
                  }  
                  else    //menu item was chosen  
                  {  
                      GePrint(LongToString(dp->chosen));  
                  }  
              }  
          }  
          
          return TRUE;  
        }  
          
        Bool MorphMixerObject::GetDDescription(GeListNode *node, Description *description,DESCFLAGS_DESC &flags)  
        {  
          if (!description->LoadDescription(node->GetType())) return FALSE;  
          
          // important to check for speedup c4d!  
          const DescID *singleid = description->GetSingleDescID();  
          
          LONG index = MORPHMIXER_PRESET;  
            
          BaseContainer bc2;  
          
          DescID cid = DescLevel(index,DTYPE_POPUP,0);  
          if (!singleid || cid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!  
          {  
              bc2 = GetCustomDataTypeDefault(DTYPE_POPUP);  
              bc2.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_POPUP);  
              bc2.SetLong(DESC_ANIMATE,DESC_ANIMATE_OFF);  
              bc2.SetBool(DESC_REMOVEABLE,FALSE);  
              bc2.SetString(DESC_NAME,"Preset");  
              bc2.SetString(DESC_SHORT_NAME,"Preset");  
              if (!description->SetParameter(cid,bc2,DescLevel(ID_OBJECTPROPERTIES))) return FALSE;  
          }  
          
          flags |= DESCFLAGS_DESC_LOADED;  
          
          return SUPER::GetDDescription(node,description,flags);  
        }  
        

        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 14/12/2010 at 08:03, xxxxxxxx wrote:

          thans ... very useful
          Franz

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