Supporting ColorGroup in our controls

How are we supposed to support ColorGroup in our controls when ColorGroup is not available at all in IDE mode ?

REALobject ColorGroup_Create(RBColor defaultColor)
{
	static void (*ColorGroup_Constructor)(REALobject instance, RBColor defaultColor) = NULL;

	ColorGroupRef = REALGetClassRef("ColorGroup");

	if (ColorGroupRef == NULL)
	{
		OutputDebugString("Coult not load ColorGroupRef");
	}

	REALobject instance = REALnewInstanceWithClass(ColorGroupRef);

	if (ColorGroup_Constructor == NULL)
	{
		ColorGroup_Constructor = (void (*)(REALobject, RBColor))REALLoadObjectMethod(instance, "Constructor(defaultColor as Color)");
	}

	ColorGroup_Constructor(instance, defaultColor);

	return instance;
}

The ColorGroupRef will always be NULL there in IDE design mode.

Ok so it does seem to become valid in IDE mode in r3 (even if ColorGroup existed before that)

Having loads of other problems relating to it though will update when I know what to ask…

Ok so this is all bugged more or less for plugins:

  1. Plugin Control creates ColorGroup in its Init method, say Red for Light mode and Green for Dark mode.
  2. I drag new control onto Window. → Designer will show Black RGB 0,0,0

=> Seems I have no way to init this in any meaningful way.

  1. I change the Color group on it in the IDE. The property browser updates and shows the colors. IDE mode for the control seems to have no clue about it and cannot draw the colors.

=> 2nd bug there.

  1. I run the Application, at runtime it was able to resolve the color group correctly. But only if the user had tweaked it in the property browser. What I Created in the Plugin Controls Init is never seen.

  2. I check Xojo’s bevel button since that is a plugin…and it seems they have not used ColorGroups there. (So guessing this is all a mess ?)

Further more how it bounces to Black even if I created instance of Colorgroup class in the Init method, might maybe be related to what users been complaining about on the Forums that their colors randomly bounce to black ?

Little more info.

I decided to try to comment out the Designer property.

So what is connected:

  • My Init of the ColorGroup
  • Resolving color from it to draw.

=> Works in IDE mode and Runtime.

So its somehow the property designer that messes it up so plugin controls cannot use ColorGroup as exposed properties it seems.