summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
blob: 082ebdf881185986b334eb09f9ada025fa8d8fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
import QtQuick 2.0
import com.ford.hmiframework 1.0
import "../WidgetLayouts"

FWidget {
    property alias focusNext: _focusNext
    property alias focusPrevious: _focusPrevious
    property alias selectElement: _selectElement

    property alias list: l.list
    property alias list_itemWidget: l.list_itemWidget
    property alias list_data: l.list_data
    property alias listWrap: l.listWrap

    FEvent { id: _focusNext; }
    FEvent { id: _focusPrevious; }
    FEvent { id: _selectElement; }

    layout: FocusListViewLayout {
        id: l
        anchors.fill: parent
    }

    triggers: [
        FTrgEvent { event: _focusPrevious
            FActScriptCall { onScript: {
                    l.list.decrementCurrentIndex();
                }
            }
        },
        FTrgEvent { event: _focusNext
            FActScriptCall { onScript: {
                    l.list.incrementCurrentIndex();
                }
            }
        },
        FTrgEvent { event: _selectElement
            FActScriptCall { onScript: {
                    list_data.selectElement(l.list.currentIndex);
                }
            }
        }
    ]
}