Setting field in TexturenameCustomGui



  • On 26/12/2013 at 03:32, xxxxxxxx wrote:

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

    ---------
    I have a dialog with a TexturenameCustomGui.
    It is all working perfectly. I can Drop&drag or selecting is ok, but init the field does not work.
    SetString or SetFilename does not work.

    I think the field (ID_HDR1) is updated, but not displayed.
    So, how to tell cinema to display / show the value?

    Bool MainDialog::CreateLayout(void)
    {
    	GroupBegin(2001, BFH_SCALEFIT, 2, 0, "Layer Shader", 0,600,0);		//initial width = 600
    	{
    		GroupBegin(ID_FOLD1, BFH_LEFT | BFV_TOP, 1, 0, "Fold/Unfold", 0,0,0);
    			AddArrowButton(ID_ARROWHDR1, BFH_LEFT | BFV_TOP, 0,0, ARROW_RIGHT);
    		GroupEnd();
      
    		BaseContainer textgui;	//image + icon below
    		myHDR1 = (TexturenameCustomGui* )AddCustomGui(ID_HDR1, CUSTOMGUI_TEXTURENAME, "", BFH_SCALEFIT, 0, 0, textgui);
    	}
    	GroupEnd();
      
    	return true;
    }
      
    Bool MainDialog::InitValues(void)
    {
    	foldStatus1 = true;
    	myHDR1->SetLayoutMode(LAYOUTMODE_MINIMIZED);		//initially folded
      
    	//Filename fname = "c:/temp/rgb32.hdr";
    	//SetFilename(ID_HDR1, fname);
    	String fname = "c:/temp/rgb32.hdr";			// result is not shown in cinema
    	SetString(ID_HDR1, fname);
      
    	return true;
      
    }
    


  • On 29/12/2013 at 06:10, xxxxxxxx wrote:

    I tried SendMessage() and [LayoutChanged](file:///D:/Users/pgrooff/Documents/pim/c4d/c++%20R15%20sdk/help/pages/customgui_base/class_BaseCustomGui65.html#layoutchanged3)(), no luck yet.

    Any other hints?



  • On 30/12/2013 at 05:10, xxxxxxxx wrote:

    Ok, I stopped using TexturenameCustomGui and do it now using (workaround) the FilenameCustomGui and BitmapButtonCustomGui scaling the given filename into the bitmap.



  • On 30/12/2013 at 07:56, xxxxxxxx wrote:

    I'm kinda sad that you're not pursuing this problem. Because it's something I'm also having trouble with.
    But I can understand you moving on when there's no support staff to help you out.

    The texturename gizmo does not use the BaseContainer parameter when it's constructed. So we can't use SetString() to insert an image into it.
    There's very little code in it's .cpp file. And it seems to be storing the images through one of the base classes somehow.
    But worst of all, it's using the Tristate class. Which is one of the most confusing classes in the SDK for me to understand. 😵
    I've seen people post code like this.
    Which is supposed to remove the current item from a gizmo and replace it with something else:

        BaseContainer bc( msg );  
      bc.SetLong(BFM_ACTION_ID, GetId());  
      bc.RemoveData(BFM_ACTION_VALUE);  
      bc.SetData(BFM_ACTION_VALUE, GetData().GetValue());  
      SendParentMessage(bc);
    

    But I've had a very hard time using this code myself.
    I was hoping the answer you got here would shed some light on some of my own Tristate questions.

    -ScottA



  • On 31/12/2013 at 00:56, xxxxxxxx wrote:

    Well hopefully we get an answer from the support staff after the holidays in the new year.
     I try the code you showed us.

    Have a very good 2014!



  • On 12/01/2014 at 02:04, xxxxxxxx wrote:

    Hi Pim,

    use

    myHDR1->SetData(GeData(fname));
    

    Best,
    -Niklas



  • On 19/01/2014 at 10:54, xxxxxxxx wrote:

    Sorry for the late reply.
    And yes it works (fname is a String).

    Thanks, Pim


Log in to reply