iCustomGui and Gui Colours

On 05/06/2014 at 00:51, xxxxxxxx wrote:

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

Dear Maxon,
I know a few of us have been over this before, but the lack of any proper working iCustomGui-related example is clearly impeding on some of our plugin development. This has got to change.
What I'd like to see is a simple working example of how to attach an iCustomGui-related element to the description of an object/tag etc - i.e. how to attach a GeUserArea so that it shows in the attributes manager, that works and responds in the same way that it would in a GeDialog. The user area does not need to do anything in particular, though drawing a few lines or something when it's mouse'd over might help to show it works and is responsive.
It's becoming quite critical for me that this is available because the standard gui gizmos don't do what I need, or more to the point, simply don't exist. That itself is fine so long as we can make our own, but trying to work it out through the documentation (and all the previous postings on this subject) is just hopeless!
Could someone from Maxon please provide us with one of these? I'm quite struck at there being no proper documentation or examples on what could be quite a critical element for us to work with, that no one seems to know how to use properly!!
Also, could we please have some proper documentation on the gui colours, how and where to get them (for all plugin types - dialogs, objects etc), so that our custom gui elements can visually play along with the native Cinema layout.
Kind regards,

On 05/06/2014 at 05:11, xxxxxxxx wrote:

Hi WP,

what's wrong with my Tristate GUI example? It uses a GeUserArea.

PS: Yeah, I know the name is confusing. Gotta change it, maybe "Traffic Light GUI".


On 05/06/2014 at 18:32, xxxxxxxx wrote:

Hi Niklas!
The problem with all the examples I've got and seen so far (unless I've misread them - possible!), is that they're adding elements to the user data section. I don't want that - I want to code directly into the tag/object AM tabs themselves. 
The main problem I'm having is this: I can get a registered custom gui to show up using something like the following in an object's GetDDescription() :

cid_Tab_Gui = DescLevel(ID_CUSTOM_TAB_GUI,DTYPE_LONG,0);
if(!id_Tab_c || cid_Tab_Gui.IsPartOf(*id_Tab_c,NULL))
    BaseContainer bc = GetCustomDataTypeDefault(DTYPE_LONG);
    bc.SetString(DESC_NAME,"Custom Gui");
    if(!description->SetParameter(cid_Tab_Gui,bc,DescLevel(ID_TAB_CUSTOM_GROUP))){return TRUE;}

But no user areas are drawn and custom bitmap buttons don't display their set images. There's just something not right about it - a missing link if you like.
For note's sake, the code I use in the iCustomGui's CreateLayout() is the same as what I use in GeDialog's, and they work fine. But in the AM tabs, no GePrint's are made from any of the user area's functions. It's this link that I'm after. Also worth noting too that the group housing the user area in the iCustomGui has a border drawn, despite having the BORDER_NONE flag set.
Anyway, point being, the posted example works fine for it's purpose, that's all good! But there's nothing available on building it directly into the plugin itself. Hope that makes some sense!

On 06/06/2014 at 08:39, xxxxxxxx wrote:

There are only two examples of custom gui's that I know of in this forum.
The one Niklas posted and the one I posted.
This is how you would dynamically load them into a tag plugin's AM:

Bool MyTag::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)  
  if(!description->LoadDescription(node->GetType())) return FALSE;  
  //#define CUSTOMGUI_TRISTATE 1030913    //<--Important!! We need to have this here so the compiler can find Nicklas's tristate Custom GUI   
  #define LIBRAY_ID 1031835               //<--Important!! We need to have this here so the compiler can find Scott's slider Custom GUI  
  DescID triCid = DescLevel(1,DTYPE_LONG,0);    //We will load the custom GUI into the first description level(much like loading UD entries into levels)  
  BaseContainer bc;  
  bc = GetCustomDataTypeDefault(DTYPE_LONG);  
  bc.SetLong(DESC_CUSTOMGUI, LIBRAY_ID);  //<--- Use CUSTOMGUI_TRISTATE here instead of "LIBRARY_ID" if using Nicklas's tristate gizmo  
  if (!description->SetParameter(triCid,bc,DescLevel(ID_OBJECTPROPERTIES))) return FALSE;  
  //Make sure you comment out this flags line of code if you don't use the GetDDescription() method  
  //Or else your resources will not load properly from your .res file  
  return TRUE;  

That should make the gizmos show up in the AM (you might have to select the object the tag's on to update the changes).


On 09/06/2014 at 17:58, xxxxxxxx wrote:

Hi Scott,
that seems to be about what I have, albeit with a few code-style differences. My custom gui(s) show up, but the user areas don't draw and things like bitmap buttons don't display their images.
For some reason, whenever they're hard-coded in, they just don't work properly. Same code (literally copy and paste) just doesn't want to work unless it's a user data addition. Niklas' example does the same thing at my end. It just doesn't work properly when hard-coded in. Even the user data entry doesn't show properly.
Bare with me, I'm trying all sorts of things to see if I can find out what's going on.