Mouse Click not firing?

On windows, it looks like the MouseClick callback of the REALcontrol is not firing. This callback is very important to set the focus on the LexingControl. What do I need to do to get it to fire?

This is what I have for the control definition:

    LexingControl.version = kCurrentREALControlVersion; = "LexingControl";
    LexingControl.dataSize = sizeof(LexingViewData);
    LexingControl.flags = REALcontrolOwnsCursor | REALcontrolAcceptFocus| REALcontrolHandlesKeyboardNavigation | REALcontrolHandlesTabKey | REALdontEraseBackground | REALcontrolIsHIViewCompatible | REALcontrolRequiresComposite;
    LexingControl.toolbarPICT = 132;
    LexingControl.toolbarDownPICT = 132;
    LexingControl.defaultWidth = 266;
    LexingControl.defaultHeight = 133; = LexingControlProperties;
    LexingControl.propertyCount = _countof(LexingControlProperties);
    LexingControl.methods = LexingControlMethods;
    LexingControl.methodCount = _countof(LexingControlMethods); = LexingControlEvents;
    LexingControl.eventCount = _countof(LexingControlEvents);
    LexingControl.behaviour = &LexingBehaviour;
    LexingControl.forSystemUse = 0;
    LexingControl.eventInstances = kDisallowedLexingEventInstances;
    LexingControl.eventInstanceCount = _countof(kDisallowedLexingEventInstances);
    LexingControl.interfaces = NULL;
    LexingControl.attributes = NULL;
    LexingControl.attributeCount = 0;
    LexingControl.constants = Lexing_Constants;
    LexingControl.constantCount= _countof(Lexing_Constants);
    LexingControl.sharedProperties = NULL;
    LexingControl.sharedPropertyCount = 0;
    LexingControl.sharedMethods = NULL;
    LexingControl.sharedMethodCount = 0;
    LexingControl.delegates = NULL;
    LexingControl.delegateCount = 0;
    LexingControl.enums = NULL;
    LexingControl.enumCount = 0;

I am baffled.

Yes. Not sure why it is not called. I found another way to tell the REALcontrol to tell it that it has the focus. First, I removed the following flags:


and implemented the AcceptFocus callback (simply returning true), together with implementing the handleGetter callback. The HWND hosted in the REALcontrol when getting clicked on sends out it had received ::SetFocus, and in the notification you have to tell the REALcontrol that the HWND has the focus by doing:

        case SCN_FOCUSIN: // important, tell Xojo by calling REALSetControlFocus
           XLOG2("NotifyMe: SCN_FOCUSIN", 0, 0);
            REALSetControlFocus(instance, true);// tell Xojo we have focus
            editor->setColorProperty(SCI_SETSELBACK, 1, ::GetSysColor(COLOR_GRADIENTACTIVECAPTION));