On 11/05/2016 at 16:25, xxxxxxxx wrote:
Cinema 4D Version: 16
Platform: Mac ;
Language(s) : C++ ;
Hi, I've been trying to replicate the visual functionality of Reflectance Layers within the Material Editor. When you drag and drop them you get an orange bar to show an indication of where you are going to drop it, how would I replicate that?
I have a GeUserArea with a GeClipMap inside of it to allow DragAndDrop and to draw the text for the name when I receive that it's being moused over I redraw it with an bar overlaid on top of it. But I'm not able to deal with the spacing between elements like Reflectance does, with the orange bar being drawn between elements.
On 12/05/2016 at 02:19, xxxxxxxx wrote:
the reflectance layer GUI is a quite complex custom GUI composed of several elements. The separator you describe is no build in function of any existing GUI element. This separator is created by having user areas between the other GUI elements. Depending on the position of the drag and drop operation these user areas draw an orange rectangle.
On 12/05/2016 at 13:16, xxxxxxxx wrote:
Thanks for the response, it does look complicated! I guess my main question is if there is a way to have no space between different GUI elements, there always seems to be a small one no matter what I do, with control over the space I could do what I want I think. Like between the groups here, I have several subgroups with GeUserAreas but I can't them any closer than this.
On 13/05/2016 at 02:49, xxxxxxxx wrote:
could you share some code that shows how you create this layout?
On 13/05/2016 at 15:29, xxxxxxxx wrote:
Sure, here you go!
GroupBegin(idParentGroup, BFH_SCALEFIT|BFV_TOP, 1, 0, "",0,0);
for (Int32 currentarea =0; currentarea<AreaList.GetCount(); currentarea++)
GroupBegin(idGroup+currentarea, BFH_LEFT|BFV_TOP, 0, 1, "",0,0,15);
C4DGadget* userarea = AddUserArea(idArea+currentarea, BFH_CENTER | BFV_BOTTOM, 0, 0);
if(userarea == nullptr) return TRUE;
AreaList is just a BaseArray of GeUserAreas.
On 17/05/2016 at 02:15, xxxxxxxx wrote:
it seems to work fine if you omit that extra group around your user area in your loop. With only one group there is no extra space.
On 20/05/2016 at 15:59, xxxxxxxx wrote:
Thanks! I had to rework a couple layout things but that did exactly what I needed!