Custom ticker

4 messages - 86 views

Is there any ticker class in KUIX such that i can place that ticker anywhere in the canvas(top or bottom)?

There's no notive ticker widget. But you can inspire the Text widget which slide text if it is too long to create your own tocker widget.

I created a customWidget which extends Text.also i assigned some lengthy string to the text filed.But its not scrolling.!

 

public class MessageBarWidget extends Text {

public static final String MESSAGEBAR_WIDGET_TAG = "messagebar";

public MessageBarWidget() {
        super(MESSAGEBAR_WIDGET_TAG);
       
    }

public TextWidget setText(String text) {
        return super.setText(text);
    }

}

 

and the xml file...

 

 

<screen style="align:center;" title="sample">
    <screenTopBar><picture src="icon.gif" style="layout-data:sld(left,-1,-1)"/></screenTopBar>
    <container>
       <container>
               <map/>              
       </container>
       <container>
               <messagebar text="0123456789 qwertyuiop asdfghjkl zxcvbnm"/><!--custom-->
       </container>      
      
       <container style="layout:tablelayout;gap:8 8">
            <button onAction="action1"  >button1</button>
            <button onAction="action2" >button2</button>           
            <button onAction="action3" >button3</button>   
            <button onAction="action4" >button4</button>                  
       </container>
      
    </container>
    <screenFirstMenu onAction="exit">Exit</screenFirstMenu>
    <screenSecondMenu>
        More...
        <menuPopup><menuItem onAction="about">About</menuItem>
        <menuItem onAction="exitConfirm">Exit</menuItem>
        </menuPopup>
    </screenSecondMenu>
</screen>

Text content in Text widget only slide if one of Text ancestror is focused (isFocusWidgetChild() resturns true)

Then you can override the isFocusWidgetChild() function in you custom widget and force it to return true.