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

    Change icon in command data

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 194 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 10/06/2011 at 08:46, xxxxxxxx wrote:

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

      ---------
      hello i have a command data plugin and i need to if command id pressed to change the icon in menu and tool bar.

      i registered an icon with a plugin id and i use MSG_GETCUSTOMICON in command message but it wont work here some code:

      virtual Bool Message(LONG type, void* data)
           {
                BaseContainer * bc = SpeedMudSh::GetSpeedMudContainer(GetActiveDocument());
                if (!bc) return FALSE;
                LONG mode = bc->GetLong(ID_COORDMODE);
                if (type == MSG_GETCUSTOMICON)
                {
                          if (mode == COORDMODE_ABSOLUTE)
                          {
                               GetCustomIconData *icon =((GetCustomIconData* )data);
                               if (!GetIcon(ICON_WORLD,icon->dat)) GePrint("geticon error!");
                               icon->filled=TRUE;
                               return TRUE;
                          }
                }
                return TRUE;
           }

      Bool RegisterCoorSpaceCommand(void)
      {
           String name="Coordinate Space"; if (!name.Content()) return TRUE;
           
           Filename fn = GeGetPluginPath()+"res"+"coord_world.tif";
           AutoAlloc<BaseBitmap> bmp;
           if (IMAGERESULT_OK!=bmp->Init(fn)) return FALSE;
           
           RegisterIcon(ICON_WORLD,bmp);

      return RegisterCommandPlugin(COORD_SPACE_COMMAND,name,0,AutoBitmap("coord_rel.tif"),String("Toggle Coordinate Space"),gNew CoorSpaceCommand);
      }

      any suggestion ?

      Thanks
      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 15/06/2011 at 07:11, xxxxxxxx wrote:

        It's strange, I can change the bitmap with SetPixel etc. but changing the bitmap pointer or the whole icon data doesn't work. I'll try to find a solution.

        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 15/06/2011 at 13:33, xxxxxxxx wrote:

          hello Matthias,
          thanks for reply .... i was trying to allocate some basebitmap for each icon and work on that but without any result.... we will see if there are any solution
          Thanks
          Franz 🙂

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