summaryrefstree
path: root/usr/bin/qml/Bluetooth/BTmessage/BTM_Search.qml
blob: 652d7f47217829532364439c50890975e844cb45 (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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
import QtQuick 2.0
import "../../eventsList.js" as EventsList
import "../../com/neusoft/auto/widgets"
import "../../layoutList.js" as Layout
import "../../windowsList.js" as WindowsList
import "../../Setting/Settinglist.js" as Settinglist
import Label 2.0
HMIWindow
{
    id: btNameSearchWindow
    property int curContactIndex: 0
    Component.onCompleted:
    {
        windowID = WindowsList.BTM_SEARCH
    }
    onVisibleChanged:
    {
        bNoSwitchBarVisiable = true
        bKeyboardVisiable = true
        bFullWindow = true
        systemCtrl.setTextInputHandle(nameSearchInput)
        nameSearch_keyBoard.visible = true
        nameSearch_list_view.visible = false
        if(visible == false)
        {
            btCtrl.btpMsgSearchSavedState = nameSearchInput.text
            nameSearchInput.text = ""
        }
	//ADD #105313 2016/12/07 liduo begin
        if(handWrite.visible==true)
            bhandwritebar=true
        if(keyBoard.visible==true)
            bhandwritebar=false
        if(handWrite.changecanvas==false){
            handWrite.changecanvas=true
        }
	//ADD #105313 2016/12/07 liduo begin
    }
    HMIButton
    {
        id:nameSearchBack_button
        x: 0//3
        y: 5//-4
        width: 138//130
        height: 70//80
        btnImg:nameSearchBack_button.pressed?("qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON_P"+bgImageStyle)
                                            :("qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON"+bgImageStyle)
        Image
        {
            id:nameSearchBack_image
            x:20//12
            //y:20
            width: 20//24
            height:34//40
            source: "qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle
            anchors.verticalCenter:parent.verticalCenter
        }
        HMILabel
        {
            id:nameSearchBack_label
            x:58//36
            //y:25
            //Fod #F0017 2016/10/11 wangshuang begin
            width: 64//60//98
            //Fod #F0017 2016/10/11 wangshuang end
            height:30//35
            text: qsTr("Back")+ systemCtrl.emptyString
            font.pixelSize: 30
            anchors.verticalCenter:parent.verticalCenter
        }
        onClicked:
        {
            ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.BTM_SELECT_CONT)
        }
    }
    Image
    {
        id: nameSearchInput_bg
	//Fod #F0008 2016/10/10 wangshuang begin
        x: 58//55
        y: 81//73
        width:842
	//Fod #F0008 2016/10/10 wangshuang end
        height:78
        //Fod #141091 2016/12/29 wangshuang begin
        source: "qrc:MATERIAL/MATERIAL_M8X_LIST_78"+bgImageStyle//"qrc:MATERIAL/MATERIAL_M8X_LIST_78_P"+bgImageStyle
        //Fod #141091 2016/12/29 wangshuang end
    }
    TextInput
    {
        id: nameSearchInput
        x: 143//134
	//Fod #F0008 2016/10/10 wangshuang begin
        y: 81//73
	//Fod #F0008 2016/10/10 wangshuang end
        anchors.verticalCenter: nameSearchInput_bg.verticalCenter
        width: 632
        font.pixelSize: 30//24
        readOnly: false
        enabled: true
        clip: true
        horizontalAlignment: Text.AlignLeft
        text:""
        color:"white"
        //ADD #F0148 2017/1/10 wangshuang begin
        selectionColor: "#676767"
        //ADD #F0148 2017/1/10 wangshuang end
        cursorVisible:true
        HMIMouseArea{
           anchors.fill: parent
	   //DEL #105313 2016/12/07 liduo begin
           //visible: !nameSearch_keyBoard.visible
           //enabled: !nameSearch_keyBoard.visible
           //DEL #105313 2016/12/07 liduo end
	   onClicked: {
               if(false == nameSearch_keyBoard.visible)
               {
//                   console.debug("2$$$$$$$$$$$$")
                   nameSearch_keyBoard.visible = true
                   bKeyboardVisiable = true
		   //ADD #105313 2016/12/07 liduo begin
                   if(handWrite.visible==true)
                       bhandwritebar=true
                   if(keyBoard.visible==true)
                       bhandwritebar=false
                   if(handWrite.changecanvas==false){
                       handWrite.changecanvas=true
                   }
		   //ADD #105313 2016/12/07 liduo end
               }
	       //ADD #105313 2016/12/07 liduo begin
               if(handWrite.visible==true)
                   bhandwritebar=true
               if(keyBoard.visible==true)
                   bhandwritebar=false
               if(handWrite.changecanvas==false){
                   handWrite.changecanvas=true
               }
	       //ADD #105313 2016/12/07 liduo end
	       //ADD #105313 2016/12/07 liduo begin
               nameSearchInput.cursorPosition = nameSearchInput.positionAt(mouseX,mouseY)
		//ADD #105313 2016/12/07 liduo end
               //ADD #145225 2017/01/18 wangs begin
               systemCtrl.pinyinsreachclear()
               //ADD #145225 2017/01/18 wangs end
           }
        }
    }
    HMIButton
    {
        id:nameSearchClear_button
        x: 835
        anchors.verticalCenter: nameSearchInput_bg.verticalCenter
        btnImg:nameSearchClear_button.pressed?"qrc:MATERIAL/MATERIAL_M8X_ICON_CLEAR_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_ICON_CLEAR"+bgImageStyle
        onClicked:
        {
            nameSearchInput.text = ""
	    //ADD #145225 2017/1/22 ld begin
            systemCtrl.clearPinyinSearchInfo()
	    //ADD #145225 2017/1/22 ld end
        }
    }


    HMIListView
    {
        id: nameSearch_list_view
	//Fod #F0008 2016/10/10 wangshuang begin
        x: 58//55
        y: 161//152
	//Fod #F0008 2016/10/10 wangshuang end
        //Fod #F0144 2016/12/22 wangshuang begin
        width: 895//892//922
        //Fod #F0144 2016/12/22 wangshuang end
		//Fod #121463 2016/10/13 wangshuang begin
        height: (true == nameSearch_keyBoard.visible)?320:720//326:731//574
        //Fod #121463 2016/10/13 wangshuang end
        spacing: 2
        rightMargin:16
        scrollBar:true
        scrollBar_edge:0
        scrollBar_width:8//4
        scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+bgImageStyle
        model:btCtrl.btPhoneBookSearchListModel
        delegate: phone_Number
        snapMode:ListView.SnapToItem
        boundsBehavior: Flickable.StopAtBounds
        focus: true
    }
    Component
    {
        id: phone_Number
        HMIButton
        {
            id:contact_List
            enabled: col1=='1'?false:true
            y:12
            height: 78
//Fod #F0018 2016/10/11 wangshuang begin
            btnImg:(contact_List.pressed)?("qrc:MATERIAL/MATERIAL_M8X_LIST_78_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_M8X_LIST_78"+bgImageStyle)//"qrc:MATERIAL/MATERIAL_M8X_LIST_78"+bgImageStyle
//            Image
//            {
//                height: 78
//                visible: (curContactIndex == index) ? true:false
//                source:(contact_List.pressed)?("qrc:MATERIAL/MATERIAL_M8X_LIST_78_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_M8X_LIST_78_P"+bgImageStyle)
//            }
//Fod #F0018 2016/10/11 wangshuang end
            Item
            {
                //Fod #F0013 2016/10/11 wangshuang begin
		x:84//80
		//Fod #F0013 2016/10/11 wangshuang end
                y:7
                width: 610
                height: 37
                HMILabel
                {
                    anchors.fill: parent
                    horizontalAlignment: Text.AlignLeft
                    elide: Label.ElideRight
                    font.pixelSize:30
                    text:col7//(col1 == '3')?(col0):(col7==""?col0:(col7+" "+col0))//col0
                }
            }
            Item
            {
                //Fod #F0013 2016/10/11 wangshuang begin
		x:84//80
                y:39//36
		//Fod #F0013 2016/10/11 wangshuang end
                width: 610
                height: 37
                HMILabel
                {
                    anchors.fill: parent
                    font.pixelSize:22
                    wtitesize:1
                    text:col0//(col1 == '3')?(col0):(col7==""?col0:(col7+" "+col0))
		    //Fod #F0013 2016/10/11 wangshuang begin
                    color:(contact_List.pressed)?"white":"#808080"
		    //Fod #F0013 2016/10/11 wangshuang end
                    horizontalAlignment: Label.AlignLeft
                    elide:Label.ElideRight
                }
            }
            HMIButton
            {
                id:checkbox_List1
                x: 710
                y: 6
                width: 64
                height: 62
                //Fod #F0060 2016/10/19 wangshuang begin
                visible: ((col1=='1')||(col0=="")||(col2 == "1"))?false:true//((col1=='1')||(col0==""))?false:true
                //Fod #F0060 2016/10/19 wangshuang end
                btnImg:checkbox_List1.pressed?("qrc:MATERIAL/MATERIAL_M8X_CHOICE_BOX_PUSHED"+bgImageStyle)
                                             :("qrc:MATERIAL/MATERIAL_M8X_CHOICE_BOX"+bgImageStyle)
                onClicked:
                {
                    if(col2 == "0")
                    {
                        btCtrl.setBtMsgSearchContactSelected(index)
                    }
                    else{
                        btCtrl.setBtMsgSearchContactUnSelected(index)
                    }
                }
            }
            HMIButton
            {
                id:checkbox_List2
                x: 710
                y: 6
                width: 64
                height: 62
                visible: ((col1=='1')||(col0=="")||(col2 == "0"))?false:true
                btnImg: checkbox_List2.pressed?("qrc:MATERIAL/MATERIAL_M8X_CHOICE_BOX_CHECK_PUSHED"+bgImageStyle)
                                              :("qrc:MATERIAL/MATERIAL_M8X_CHOICE_BOX_CHECK"+bgImageStyle)
                onClicked:
                {
                    if(col2 == "0")
                    {
                        btCtrl.setBtMsgSearchContactSelected(index)
                    }
                    else{
                        btCtrl.setBtMsgSearchContactUnSelected(index)
                    }
                }
            }
            onPressed:
            {
                if( true == btCtrl.btConnectState )
                {
                    if (curContactIndex != index)
                    {
                        curContactIndex = index
                    }
                }
            }
            onClicked:
            {
//                console.debug("setBtMsgContactSelected col2="+col2+"col1"+ col1)
                if(col1 == "1")
                {
//                    console.log("[BTM_Select_Cont]btCtrl.setBtMsgContactSelected()------")
                }
                else
                {
                    if(col2 == "0")
                    {
                        btCtrl.setBtMsgSearchContactSelected(index)
                    }
                    else{
                        btCtrl.setBtMsgSearchContactUnSelected(index)
                    }
                }
            }
        }
    }
    //Add #129445 2016/11/30 wangs begin
    MouseArea
    {
        id:scroolbarcover
        x:58+842
        y:161
        width:60
        height: (true == nameSearch_keyBoard.visible)?320:720
    }
    //Add #129445 2016/11/30 wangs end
    Item
    {
        id:nameSearch_keyBoard
        x: -2
        y: 562
        HMIKeyBoard
        {
            id: keyBoard
            enabled:true
            iSerach: true
            onClickspell:
            {
                if(!keyBoard.isPinyin)
                    systemCtrl.setKeyPress(spell)
            }
            onSearchStart:
            {
                nameSearch_keyBoard.visible = false
                btCtrl.btPhoneBookSearchInfo(nameSearchInput.text)
                nameSearch_list_view.visible = true
                bKeyboardVisiable = false
            }
            onHandwriteborad:
            {
                keyBoard.visible=false
                handWrite.visible=true
		//ADD #105313 2016/12/07 liduo begin
                bhandwritebar=true
		//ADD #105313 2016/12/07 liduo end
            }
            onCloseKeyBoardSignal:
            {
                nameSearch_keyBoard.visible=false;
                bKeyboardVisiable = false
		//ADD #105313 2016/12/07 liduo begin
                bhandwritebar=false
		//ADD #105313 2016/12/07 liduo end
            }
        }
        HMIHandWrite{
            id:handWrite
            y: 0
            iSerach: true
            visible: false
            onKeyborad:
            {
//                console.log("#############################################")
                keyBoard.iType=itype
                keyBoard.visible=true
                handWrite.visible=false
		//ADD #105313 2016/12/07 liduo begin
                bhandwritebar=false
		//ADD #105313 2016/12/07 liduo end
            }
            onCloseKeyBoardSignal:
            {
                nameSearch_keyBoard.visible=false;
                bKeyboardVisiable = false
		//ADD #105313 2016/12/07 liduo begin
                bhandwritebar=false
		//ADD #105313 2016/12/07 liduo end
            }
            onSearchStart:
            {
                nameSearch_keyBoard.visible = false
                btCtrl.btPhoneBookSearchInfo(nameSearchInput.text)
                nameSearch_list_view.visible = true
                bKeyboardVisiable = false
            }
        }
    }
    Connections
    {
        target:btCtrl
        onBtConnectStatusChanged:
        {
            if( false == btCtrl.btConnectState )
            {
                if(btNameSearchWindow.visible == true)
                {
                    ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.BTP_HOME)
                }
            }
        }
    }
    Connections{
        target:ScreenManager
//        onBtHungupPageReset:{//del by lium for screenchange begin
//            nameSearchInput.text=btCtrl.btpMsgSearchSavedState
//        }//del by lium for screenchange end
    }
}