On 30/01/2017 at 01:00, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
---------
Hello everyone,
I'm new to C4D C++ plugin dev, and I have a small checkbox problem. Inside the cinema4dsdk project, in gedialog_gadgets.cpp there is this code :
{...} case(DIALOGELEMENTS::RADIO_TEXT) :
{
Bool checked;
if (GetBool(ID_DYMAMIC_GADGET, checked))
{
if (checked)
SetString(ID_CONSOLE, "checked");
else
SetString(ID_CONSOLE, "not checked");
}
break;
}{...}
It's called whenever you click a "Read Data" button. In my own plugin, i have a similar setup, but the code gets called from the Command() function override of my GeDialog :
virtual Bool Command(Int32 id, const BaseContainer &msg)
{
switch (id)
{
case (DLG_CHK_ACTIVE) :
{
Bool checked;
if (GetBool(DLG_CHK_ACTIVE, checked))
{
if (checked)
{
WriteLineToConsole("Active.");
}
else
{
WriteLineToConsole("Inactive.");
}
}
}
break;
}
return TRUE;
}
My problem is that whether i check or uncheck the checkbox, I get an "Inactive." line on my console. My WriteLineToConsole() function works as expected and its purpose is just to add a little prompt (later a timestamp and useful info) to the line.
Here is what i get after clicking 6 times on my checkbox :
I would expect something like :
"-> Active.
-> Inactive.
-> Active.
-> Inactive.
-> Active.
-> Inactive."
Is there anything I am doing wrong?