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

    Toggle bitmap button on .res file

    Cinema 4D SDK
    python
    2
    4
    747
    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.
    • mfersaouiM
      mfersaoui
      last edited by mfersaoui

      Hello,

      Is it possible to create a toggle bitmap button using only the .res file?
      I tried with the GetDDescription function its work well, but when I use .res file this doesn't work.
      Also, when I use the FORCE_SIZE on .res file I get an error.

      BITMAPBUTTON BUTTON_ID
      {
          TOGGLE;
          BUTTON;
          FORCE_SIZE 16;
          ICONID1 5160;
          ICONID2 5159;
      }
      

      Thanks

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        something like this will work as you expect (i hope)
        The trick is to create a two columns group and a dummy statictext so the button will have the "right" size.

        	GROUP
        		{
        			COLUMNS  2;
        
        			BITMAPBUTTON BUTTON_ID
        			{
        
        				SIZE 32;
        			    TOGGLE;
        			    BUTTON;
        			    ICONID1 5160;
        			    ICONID2 5159;
        			}
        			STATICTEXT { DUMMY; }
        		}
        

        One side effect is the icon will not be centered. You can see on this thread why.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        mfersaouiM 1 Reply Last reply Reply Quote 0
        • mfersaouiM
          mfersaoui @Manuel
          last edited by mfersaoui

          hi @m_magalhaes,

          Thank you much, that works.

          I have an another question concerning Description Resource, I don't know if I post it here or I must create a new post.

          Here is the code:

          GROUP
          {
              REAL MYOBJECT_PITCH { UNIT DEGREE; CUSTOMGUI REALSLIDER; MIN -360; MAX 360; STEP 1; }
              BITMAPBUTTON MYOBJECT_STRAIGHTEST_PITCH
              {
                  SIZE 16;
                  BUTTON;
                  ALIGN_LEFT;
                  ICONID1 5160;
              }
          
              REAL MYOBJECT_ROTATION { UNIT DEGREE; CUSTOMGUI REALSLIDER; MINSLIDER -90; MAXSLIDER 270; STEP 1; }
              STATICTEXT { JOINENDSCALE; }
          }
          

          And here screenshot of what I want to do:
          puch_icon_right.jpg
          Thanks

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            Group is the key in UI. Simply add a SCALE_H; property for your slider. so for that two columns group, the slider will take all the place minus the button.

            	GROUP
            		{
            			COLUMNS  2;
            			REAL ONEFLOAT { CUSTOMGUI REALSLIDER; SCALE_H;}
            			BITMAPBUTTON BUTTON_ID
            			{
            
            				SIZE 16;
            			    TOGGLE;
            			    BUTTON;
            			    ICONID1 5160;
            			    ICONID2 5159;
            			}
            		}
            

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

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