summaryrefstree
path: root/usr/bin/qml_link/AppLink/App_Navi_SrchCrossRslt.qml
blob: f416b6d6ee8dba4a10b37139838488417b125bc5 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import QtQuick 2.0
import "../eventsList.js" as EventsList
import "../layoutList.js" as Layout
import "search.js" as Search
import "../windowsList.js" as WindowsList
import "Com"
import Label 2.0
HMIWindow {

    id:app_SrchCrossRslt
    //windowImgSource:imagePath+"Common/M8X_Background.png"
    title: qsTr("道路列表") + applinkControl.qsEmptyString
    property bool btybe: false
    property int iMsgType:0
    property bool bType:false
    property int iupdateing:0
    onVisibleChanged: {
        if(app_SrchCrossRslt.visible == true)
        {
            iMsgType = 0
            applinkControl.QML_SSPLink_iSetSearchKind(Search.SRCH_CROSSROAD,true)
            applinkControl.QML_SSPLink_iSetSrchArdflag(0,true)

            app_HMIListView_search_result.model=applinkControl.roadListModel

            iupdateing = applinkControl.QML_SSPLink_GetSrchRDRsltMove()
            //console.log("----app_SrchCrossRslt-----------iupdateing-------------------",iupdateing)
        }
    }
    onSignal_returnClick:{
        ScreenManager.backward(Layout.APPLINK,WindowsList.APP_NAVI_SRCHKEYCROSSMAIN)
    }

    HMIListView {
        id: app_HMIListView_search_result
        x: 58
        y: 241-160
        width: 842
        height: 80*10
        snapMode:ListView.SnapToItem
        //model:xmldata_search_result
        //model:applinkControl.roadListModel
        //currentIndex:
        delegate:Item{
            id:item_select_search_result
            width: 842
            height: 80
            HMIButton{
                btnImg:pressed?imagePath+"Navi/common/M8X_list_78_p.png":imagePath+"Navi/common/M8X_list_78.png"
                HMILabel{
                    x:84
                    y:10
                    width:510
                    height:30
                    text:col0
                    horizontalAlignment: Label.AlignLeft
                    elide:Label.ElideRight
                }
                HMILabel{
                    x:84
                    y:48
                    width:484
                    height:22
                    text:col4
                    horizontalAlignment: Label.AlignLeft
                    elide:Label.ElideRight
                    font.pixelSize:22
                    color:"#808080"
                }
                onClicked: {
                    bType = false
                    app_HMIListView_search_result.currentIndex=index
                    iMsgType = 5;
                    msg_PopUp.visible = true;
                    msg_PopUp.opacity = 1
                    applinkControl.QML_SSPLink_vsetiSrchTolnum()
                    applinkControl.QML_SSPLink_iSetSearchKind(Search.SRCH_CROSSRST,false)
                    applinkControl.QML_NIF_Poi_SrchRoadCross(index)
                }
                onPressed:{
                    app_HMIListView_search_result.interactive = true
                }

            }
        }
        onMovementEnded: {
            if(app_HMIListView_search_result.contentY==app_HMIListView_search_result.contentHeight-app_HMIListView_search_result.height)
            {
                bType = true
                ++iupdateing
                btybe = true
                applinkControl.QML_NIF_Poi_RequestPoiResult(iupdateing)
            }
        }
    }
    HMIListViewBar
    {
        id:listViewbar
        anchors.left: app_HMIListView_search_result.right
        anchors.leftMargin: 29
        anchors.top: app_HMIListView_search_result.top
        width: 10
        height: 80*10
        listView:app_HMIListView_search_result
        scrollBarX:780
        scrollBarY:59
        visible: app_HMIListView_search_result.count<10?false:true
        clip:true
    }
    HMIButton{
        y: 1041-160
        btnIcon: imagePath+"Navi/common/M8X_icon_close.png"
        btnImg:pressed?imagePath+"Navi/common/M8X_Function_close_Button_p.png":imagePath+"Navi/common/M8X_Function_close_Button.png"
        onClicked:{
            applinkControl.QML_CloseAppLink()
            //ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.APP_NAVI_SRCHCROSSRSLT)
        }
    }
    HMIButton{
        id: allBtn
        x: 90
        y: 1041-160
        enabled: false
        btnImg:  imagePath+"M8X_Function_1_Button_NoSwitch.png"
        btnImgOnPressed:  imagePath+"M8X_Function_1_Button_NoSwitch_p.png"
    }
    App_Com_Newspopup{
        id:msg_PopUp
        z: 3
        labelCount: 1
        newspopText1: qsTr(applinkControl.QML_getMessageString(iMsgType)) + applinkControl.qsEmptyString
        visible:(app_SrchCrossRslt.iMsgType > 0)?true:false
        opacity: 0
        //enabled: false
        bIsTouchClear:applinkControl.QML_getMessageTouchClearFlag(iMsgType)
        onClicked: {
            if(bIsTouchClear){
                msg_timer.stop()
                iMsgType = 0
                msg_PopUp.opacity = 0
                msg_PopUp.visible = false
            }
        }
    }
    Timer{
        id:msg_timer
        interval: applinkControl.QML_getMessageTime(iMsgType)
        onTriggered: {
            iMsgType = 0
            msg_PopUp.opacity = 0
            msg_PopUp.visible = false
        }
    }
    Connections{
        target:applinkControl

        onSignal_updateStartIdx:{
            if(app_SrchCrossRslt.visible == true)
            {
                btybe = false
                iupdateing = iStartIdxnum
                //app_HMIListView_search_result.interactive=true
                //app_HMIListView_search_result.contentY=app_HMIListView_search_result.contentHeight-app_HMIListView_search_result.height
            }
        }

        onSearchRDPageEnd:{
            if(app_SrchCrossRslt.visible == true)
            {
                btybe = false
                if(bType)
                {
                    app_HMIListView_search_result.model = applinkControl.roadListModel
                }
                else
                {
                    iMsgType = 0
                    msg_PopUp.opacity = 0
                    msg_PopUp.visible = false
                    applinkControl.QML_SSPLink_ToSrchRslt(Search.FromSrchCrossRslt)
                    //applinkControl.QML_SSPLink_SetSrchRDRsltMove(iupdateing)
                    applinkControl.QML_SSPLink_SetSrchRsltMove(0)
                    ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NAVI_SRCHRSLT)
                    //app_HMIListView_search_result.contentY=applinkControl.QML_SSPLink_vSrch_Link_Fresh_currentindex()*70;
                }
            }
        }
        onSearchEnd:{
            if(app_SrchCrossRslt.visible == true)
            {
                btybe = false
                if(bType)
                {
                    app_HMIListView_search_result.model = applinkControl.roadListModel
                }
                else
                {
                    iMsgType = 0
                    msg_PopUp.opacity = 0
                    msg_PopUp.visible = false
                    applinkControl.QML_SSPLink_ToSrchRslt(Search.FromSrchCrossRslt)
                    //applinkControl.QML_SSPLink_SetSrchRDRsltMove(iupdateing)
                    applinkControl.QML_SSPLink_SetSrchRsltMove(0)
                    ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NAVI_SRCHRSLT)
                    //app_HMIListView_search_result.contentY=applinkControl.QML_SSPLink_vSrch_Link_Fresh_currentindex()*70;
                }
            }
        }
        onSearchEndNoResult:{
            if(app_SrchCrossRslt.visible == true)
            {
                iMsgType = 4
                msg_PopUp.opacity = 1
                msg_PopUp.visible = true
                msg_timer.restart()
            }
        }
    }
}