summaryrefstree
path: root/usr/bin/qml/com/neusoft/auto/widgets/HMILabelInput.qml
blob: 69c40d660255a6a88c4b7c36b26465e7c7394d41 (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
/*
*   Copyright (C) 2013 by Neusoft
*   Author : Jia Zhao <zhao-jia@neusoft.com>
*
*/

import QtQuick 2.0
import LabelInput 2.0
/**
 * This is a Text component from QtQuick.
 *
 * You can use all elements of the QML Text component, in particular the "text"
 * property to define the label text.
 */
Item
{
    id:labelInputItem
    property alias labelInputAssembly : labelInput
    property bool lableBeep: true//add #176279 2017/5/22 ld
    signal lableTextChanged()
    signal lableMaxLengthSignal()
    signal lableSingleClickSignal()
    signal lableDoubleClickSignal()
    x:0
    y:0
    clip: true
    LabelInput
    {
        id: labelInput
        x:0
        y:0
        color: "white"
        verticalAlignment: LabelInput.AlignLeft
        horizontalAlignment: LabelInput.AlignVCenter
        width: labelInputItem.width
        height: labelInputItem.height
        font.pixelSize:30
        //FOD by lishunan for KB start
        font.family:"Montserrat"//"方正兰亭黑简体"
        //FOD by lishunan for KB end
        onXuanzhongClose:
        {
            if(labelInput.visible)
            {
                systemCtrl.pinyinsreachclear()
            }
        }
        onContentWidthChanged:
        {
//            console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ labelInput.contentWidth = "+labelInput.contentWidth)
//            console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ labelInput.width = "+labelInput.width)
            if(labelInputItem.width > labelInput.contentWidth)
            {
                labelInput.width = labelInputItem.width
                labelInput.x =0;
            }
            else
            {
                labelInput.width = labelInput.contentWidth+2
                labelInput.x = labelInputItem.width - labelInput.contentWidth-2
            }
        }
	//add #176279 2017/5/22 ld
        onSinglePressSignal:{
            console.log("lableinput onSinglePressSignal")
            if (lableBeep)
            {
                //console.log("lableinput onSinglePressSignal lableBeep="+lableBeep)
                systemCtrl.touchBeep(0)
            }
        }
	//add #176279 2017/5/22 ld

        onSingleClickSignal:
        {
            lableSingleClickSignal();
        }
        onDoubleClickSignal:
        {
            //lableDoubleClickSignal();
            labelInput.selectAllTex = 0;
        }
        onMaxLengthSignal:
        {
            lableMaxLengthSignal();
        }
    }
    function setTextInputHandle()
    {
        systemCtrl.setTextInputHandle(labelInput);
    }
}