Latest messages

584 topics, 1891 messages
Kuix technical support » Any way of making list wrap around?

At present only a FocusManager can drive the focus. Then the list doesn't manage it's own items focus.

Else, FocusManager could be created with a 'loop' parameter. But in 0.9.1 the Screen widget automaticaly create its FocusManager and set this parameter to false. The true value is used in PopupMenu.

I will add a way to manipulate this paramter in the next Kuix release.

 

Kuix technical support » Any way of making list wrap around?

Is there any way to make the list widget to wrap back to the first list item when the end of the list is reached and down is pressed ? I know that kind of messes up the whole focused widget idea if there are buttons etc. under the list. But maybe make it a style setting for a list ?

Kuix technical support » A bug in RadioGroup ?

The bug will be solved in the 0.9.2

Thank for your bug report ;)

Kuix technical support » A bug in RadioGroup ?

All right, I think there is a bug there. At parse time when the value si set, the RadioGroup contains no RadioButton. Then no one is selected. I will try to look at that.

I think you can solve temporarily the problem by doing this (put the <_value> tag after <radioButton> tags) :

<radioGroup>

    <radioButton value="value1"/>

    <radioButton value="value2"/>

    <_value>${foobar}</value>

</radioButton>

Kuix technical support » A bug in RadioGroup ?

I meant the default value for the radio group. So when the radio buttons are initially displayed, I want to set the value that will initially be selected.

Kuix technical support » A bug in RadioGroup ?

For RadioGroup sue, the value need to be set on the RadioButtons.

Example :

<container>

    <radioGroup id="myRadioGroup">

        <radioButton value="${foo1}">Choice 1</RadioButton>

        <radioButton value="${foo2}">Choice 2</RadioButton>

    </radioGroup>

    <button onAction="processChoice(myRadioGroup.value)"/>

</container>

 

In this example, the value is set on each radio button by calling the data provider at parse time. By default the value of the radio group is null and automaticaly set to the selected radio button value.

In this case you can invoke your own action (processChoice on the button in this example) by forwarding the radio group value.

A radio group could give its value by calling myRadioGroupInstance.getValue() or myRadioGroupInstance.getAttribute("value").

getAttribute("attributeName") permit to extract a String value from a widget directly in xml (like myRadioGroup.value in this example). Check the javadoc to see what widget can give what attribute. (For example all AbstractTextWidget return the text value ...)

 

Kuix technical support » A bug in RadioGroup ?

Is this a bug, or have I missed something (again) ? If I specify the value of a radio group as &lt;_value&gt;@{foobar}&lt;/_value&gt;, the value is set correctly from the data provider, but if I use ${foobar} as the value, nothing is set. I need to set the value only once. And also, if that screen and later I want the screen to get the value again from the data provider, is there a way to do it ? If I use the @{foobar}, the value gets constantly updated, but I'd rather want the value updated every time I show the screen.

Kuix technical support » Creating custom widgets

To be sure to understand properties and DataProvider, look at Kaprice source code.

Kuix technical support » Creating custom widgets

%I18N_KEY% will be replace by it's i18n corresponding value in /i18n/message.properties or /i18n/message.XX.properties

${myProperty} and @{myProperty} do basicly the same thing : extract a value from a DataProvider given while calling loadScreen or loadXml methods by invoking myDataProvider.getValue("myProperty"). The main difference reside in the life time of the linkage between the widget where to put the value and the DataProvider.

${propertyName} is converted to its value only at parse time. No linkage between the Widget and the DataProvider is kept.

@{propertyName} is converted to its value at parse time and a the widget is binded to the DataProvider if not nul. The main goal of this feature is to be able to change the value directly in the DataProvider and it generate automaticaly the update on all binded widgets. THe concept go forward because you can mix more than one property in an attribute definition.

For exemple :

<text>

<_text>${prop1} any text @{prop2} any text @{prop3}</_text>

</text>

In this example prop1 was converted at parse time. And the Text widget is binded to the DataProvider on prop2 and prop3. Then if one of the two properties change the text is updated.

Kuix technical support » Creating custom widgets
Thank you very much for the quick reply. I'll try this out tomorrow. A follow-up question came to mind. What is the difference of parsed properties, I mean the difference of @{...}, ${...} and %...% ?
Kuix technical support » Creating custom widgets
With 0.9.1 there's two way to use your own widgets.
  • Override the KuixConverter and override the convertWidgetTag() method as you did. And in your widget class override the setAttribute() method to catch your special attributes.
  • Simply add the custom widget name (case sensitive) in the xml like that : In this case the class org.mypackage.TestWidget will be automaticaly created. And like the way 1 override the setAttribute() method to catch yout own attributes.

CAUTION : parsed properties like @{...}, ${...}, %...% are ignored while use this syntax : You need to use this syntax : <widget>
<_myAttribute>@{value}</_myAttribute>
</widget>
Kuix technical support » Creating custom widgets
Aah.. Sorry, seems that the xml tags got stripped.. The widget in xml was: <testwidget value="@{customvalue}" />
Kuix technical support » Creating custom widgets
I've managed to create my own custom widget by extending the Widget class and adding my on custom KuixConverter class which returns the correct widget from convertWidgetTag. But how can I add support for custom attributes which use a DataProvider to the widget defined via the xml file ? For example a widget . How can I get the value attribute updated via the DataProvider ?
Kuix technical support » Possible memory leak ?
Today the a new release of Kuix (0.9.1) is out. It is not decribe in change log, but it fix a bug with sub menu that can produce memory leaks.
Kuix technical support » Possible memory leak ?
Urgh.. Sorry about that. Posted a bit too soon. It seems that when I called the removeFrame(instance), and then pushed it again, the onAdded - method gets called each time. And the screen object was loaded each time it was called. Just changed the method so that it only loads the screen from the xml file the first time onAdded is called.. Sorry for the confusion.