Page 1 of 1

BlinkCaret not functioning

Posted: Sun Jul 05, 2015 19:46
by Pyrce
I tried using the BlinkCaret property on a <WidgetLook name="MyLookNFeel/Editbox"> element with CEGUI 0.8.4, but it didn't seem to apply. I tried adding a timeout and it still didn't work. I couldn't find a good answer as to why this wasn't working:

Code: Select all

<Property name="BlinkCaret" value="True"/>
<Property name="BlinkCaretTimeout" value="0.6"/>


I ended up using an animation to get the same effect:

Code: Select all

<AnimationDefinition name="CaretBlinker" duration="1.0" replayMode="loop">
  <Affector property="CursorColour" interpolator="Colour">
    <KeyFrame position="0.2" value="FFFFFFFF" />
    <KeyFrame position="0.4" value="00FFFFFF" />
    <KeyFrame position="0.6" value="00FFFFFF" />
    <KeyFrame position="0.8" value="FFFFFFFF" />
  </Affector>
    <Subscription event="Activated" action="Start" />
    <Subscription event="Deactivated" action="Stop" />
    <Subscription event="Hidden" action="Stop" />
</AnimationDefinition>


This did the trick, and albeit I can control the animation in a more precise manner, I wanted to try an leverage the build in functionality. Am I missing some basic assignment or element attribute to make the cursor blinker work?

Also the documentation here http://static.cegui.org.uk/docs/0.8/xml_animation.html lists the interpolator as "colour" but it appears to need the uppercase version: "Colour"

Re: BlinkCaret not functioning

Posted: Sun Jul 05, 2015 20:21
by Ident
Docu fixed: https://bitbucket.org/cegui/cegui/commi ... 4b3698d991

Regarding BlinkCaret: no idea. Did you try it in a Sample of the SampleBrowser?

Re: BlinkCaret not functioning

Posted: Sun Jul 05, 2015 21:37
by Pyrce
Yea I couldn't get any cursor to blink, but maybe I was applying the property in the wrong locations. The only cursor that blinks among the demos is the GameMenu printed text at the base of the app, which appears to just be dynamically generated as it prints and isn't an actual editable box. I tried putting the property into the Vanilla looknfeel to change the font demo without success.

Re: BlinkCaret not functioning

Posted: Sun Jul 05, 2015 23:09
by Ident
Will look at it tomorrow. I dont remember what I did in the GameMenu, could be an animation.

Re: BlinkCaret not functioning

Posted: Wed Jul 08, 2015 21:42
by Ident
I ran into some problems with other fixes. Tomorrow I will look into your problem (this time for real as now I dont have anything started )

Tomorrow is today. I tried it out and it worked right away:

Code: Select all

    CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(WindowManager::getSingleton().createWindow("TaharezLook/Editbox"));
    root->addChild(editbox);
    //This works right away without setting BlinkCaretTimeout
    editbox->setProperty("BlinkCaret", "True");
    // Also works
    editbox->setProperty("BlinkCaretTimeout", "0.2");

Did it in the HelloWorld sample.

Can you please try this out in the SampleBrowser and tell me if it works? Also if you find out what you did wrong please tell us what it was, maybe we can improve things so it wont happen to other people.