Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Button scaled unexpectedly when it is in the same row with an expanded linkbox

    Cinema 4D SDK
    c++
    2
    3
    539
    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.
    • B
      BruceC
      last edited by

      I have a button and a linkbox placed in the same row, however I found the button is always scaled horizontally when the linkbox is expanded.
      Could you please help me find out how to stop the button being scaled horizontally?
      I have tried applying DESC_SCALEH to FALSE and DESC_FITH to TRUE, but it doesn't work after the linkbox is expanded.

      Before the linkbox is expanded, the button's width is expected.
      ce8c622f-59bb-47da-a5d3-c6bf25da6ffe-image.png
      After the linkbox is expanded, the button is scaled unexpected.
      6dd4884c-6b85-494b-b4eb-22395c2953cd-image.png

      I essentially used the below code snippet to create the button and linkbox in NodeData::GetDDescription()

      Int32 groupID = xxgroupIdxx;
      const DescID groupDescID = CreateDescID(DescLevel(groupID, DTYPE_GROUP, 0));
      {
          BaseContainer bc = GetCustomDataTypeDefault(DTYPE_GROUP);
          bc.SetInt32(DESC_COLUMNS, 2);
          bc.SetInt32(DESC_SCALEH, TRUE);
          description->SetParameter(groupDescID, bc, CreateDescID(DescLevel(AOV_COMP_PARAMS_GRP)));
      }
      
      {
          DescID id = CreateDescID(DescLevel(xxButtonIdxx, DTYPE_BUTTON, 0));
          BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BUTTON);
          bc.SetString(DESC_NAME, "test"_s);
          bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BUTTON);
          bc.SetBool(DESC_SCALEH, FALSE);   //// <<<<<<<<<<<
          bc.SetBool(DESC_FITH, TRUE);      ////  <<<<<<<<<<<< I have tried using these two flags, but they don't help
          description->SetParameter(id, bc, groupDescID);
      }
      
      {
          const DescID id = CreateDescID(DescLevel(xxLinkIdxx, DTYPE_BASELISTLINK, 0));
          BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BASELISTLINK);
          bc.SetString(DESC_NAME, "test"_s);
          bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LINKBOX);
          bc.SetData(DESC_SCALEH, TRUE);
          bc.SetContainer(DESC_ACCEPT, accept);
          description->SetParameter(id, bc, groupDescID);
      }
      

      Thanks!

      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @BruceC
        last edited by

        Hi @BruceC!

        The expandable UIs like COSTOMGUI_LINKBOX are not designed to be used with other elements on the same row, hence can lead to the undefined behavior like what you're experiencing. I suppose the workaround for you would be to put the linkbox on the row below the button.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • B
          BruceC
          last edited by

          Thanks for the reply @i_mazlov. Yeah, I already tried the workaround, it worked.

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