THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/10/2012 at 14:45, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
I've got another strange one.
With most built in dialog gizmos you can enable and disable them with "Enable( Gizmod ID, 0 )" & "Enable( Gizmod ID, 1 )"
But I'm having trouble using that on custom Buttons.
Not only does it not disable the custom buttons.
But it also has this really strange side effect of disabling the other gizmos in my GeDialog plugin!
Here's a bit of code stripped out from my plugin:
Bool myDialog::CreateLayout(void)
{
Bool res = TRUE;
res = LoadDialogResource(IDS_RESDIALOG,NULL,0);
//This is an example of creating a custom button with AddCustomGui()
GroupBegin(0,BFH_LEFT,2,0,"MySecondGroup",0);
{
BaseContainer bbc; //Create a container to hold our custom button gizmo
bbc.SetLong(BITMAPBUTTON_BORDER, BORDER_OUT); //Make the button style raised so it looks like a button
bbc.SetBool(BITMAPBUTTON_BUTTON, TRUE);
myButton = (BitmapButtonCustomGui* )AddCustomGui(10001,CUSTOMGUI_BITMAPBUTTON,"MY BUTTON", 0L,80,80,bbc); //Adds the BitmapButton GUI to the dialog
bbc.SetLong(BITMAPBUTTON_TOGGLE, TRUE);
myButton->SetImage(200000000, FALSE); //Adds our custom registered icon using it's ID#...Be sure to get a real ID# from c4dcafe.com. DON'T use this one in your public projects!
}
GroupEnd();
return res;
}
Bool myDialog::Command(LONG id,const BaseContainer &msg) //This is where the code that does something goes
{
BaseDocument *doc = GetActiveDocument(); //Get the active document
AutoAlloc<BaseBitmap> myicon;
IconData idata; //Create an IconData type variable to hold our custom registered icon's ID#
idata.w = myicon->GetBw(); //Get the width of the Icon if needed later on
idata.h = myicon->GetBh(); //Get the height of the Icon if needed later on
GetIcon(200000000,&idata); //Get our custom registered icon. The ID# is set up in the "RegistermyResDialog(void)" function
GetCustomIconData *myIconData =((GetCustomIconData* )&idata); //Create a CustomIconData type variable called "myicon"
myIconData->filled=TRUE; //Tells C4D that the state of the icon is "filled"
switch (id)
{
case 10001:
Enable( 10001, 0 ); //<--Does not work!? It also hides many of my other gizmos too!!!?
break;
}
EventAdd();
return TRUE;
}
How do we enable/disable CUSTOMGUI_BITMAPBUTTON's?
-ScottA