import QtQuick 2.0 import "../../eventsList.js" as EventsList import "../../layoutList.js" as Layout import "../../windowsList.js" as WindowsList //import "../com" import Label 2.0 Item{ id: root y:561 width:960 height:399 property string str : "" property int maximumLength property bool isSmall : false property bool isPinyin : true property bool isZifu : false property int iQiehuan : 1 property int ishowStatus : 1 property string searchInfo: "" property bool bFlage : false property bool searchEnable: false property bool deleteEnable: false property alias numberText: number.labelText property alias shiftText: shift.labelText property alias shiftIcon: shift.btnIcon property int iType : 1 property int hanziindex : 1 property string hanziinfo : "" property QtObject listtmp property bool maximumState :false signal clickspell(string spell,bool isPinyin) signal clickspace() signal searchStart() signal handwriteborad() signal searchStarth() signal keyborad(int itype) signal deleteLongPress() signal clickinputtext() signal clickSwtich() //键盘收起开关信号 onVisibleChanged:{ //listView.model = "" *-* } Connections{ target: systemCtrlLink onPinyinAltListChanged:{ listView.model = systemCtrlLink.pinyinAlternateList listView.contentX = 0 listView.currentIndex = 0 } onPinyinPredListChanged:{ listView.model = systemCtrlLink.pinyinPredictList listView.contentX = 0 listView.currentIndex = 0 } onInputInfoToClear:{ clearstring() } } onSearchInfoChanged:{ //listView.contentX = 0 if(searchInfo!=""){ if(isPinyin) { listView.model = listtmp systemCtrlLink.setHanZiListModel(searchInfo) } else { searchInfo="" } } } function clearstring() { listView.model = "" searchInfo="" } Image { x:1 id: image_list_bg //opacity: (listView.count>0&&isPinyin&&ishowStatus)?1:0 //enabled: (listView.count>0&&isPinyin&&ishowStatus)?1:0 source: imagePath+"Common/keyboard/M8X_Candidate-Key_bg.png" /*HMIButton{ id:keyList_l // x: 23 // y: 13 width: 94 height: 78 enabled: (listView.count==1||listView.currentIndex==0)?false:true btnIcon: keyList_l.enabled?(keyList_l.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_ left.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_ left.png"):imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_ left_d.png" btnIconOnPressed: imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_p.png" onClicked: { listView.currentIndex-- } onPressAndHold: { keyList_l_t.restart() } onCanceled: { keyList_l_t.stop() } onReleased: { keyList_l_t.stop() } Timer{ id: keyList_l_t interval:150 repeat:true onTriggered: { if (listView.currentIndex > 0){ listView.currentIndex-- } } } } HMIButton{ id:keyList_r x: 770 //y: 13 width: 94 height: 78 enabled: (listView.count==1||listView.currentIndex==listView.count-1)?false:true btnIcon: keyList_r.enabled?(keyList_r.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_right.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_right.png"):imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Arrow_right_d.png" btnIconOnPressed: imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_p.png" onClicked: { listView.currentIndex++//listView.contentX+=61 } onPressAndHold: { keyList_r_t.restart() } onCanceled: { keyList_r_t.stop() } onReleased: { keyList_r_t.stop() } Timer{ id: keyList_r_t interval:150 repeat:true onTriggered: { if (listView.currentIndex < listView.count-1){ listView.currentIndex++ } } } }*/ } HMIButton{ id:keybrddown x: 865 width: 94 height: 78 enabled: true //btnIcon: imagePath+"Common/keyboard/M8X_Arrow_retract.png" btnImgOnPressed: imagePath + "Common/keyboard/M8X_keyboard_Button_p.png" Image{ x: 890-865 y: 749-721 source:imagePath+"Common/keyboard/M8X_Arrow_retract.png" } onClicked: { clickSwtich() } } Component{ id: recipeDelegate Item{ id: delegateImgMain width: _testLabelbg.width height: _testLabelbg.height Row{ id: _testLabelbg Item{ width:_testLabel.contentWidth+32*2 height: 78 Image { width: _testLabel.contentWidth+32*2 source: m_area.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_p.png":"" } } } HMILabel{ id: _testLabel width: _testLabelbg.width height: _testLabelbg.height text: col0 color:"white" HMIMouseArea{ id: m_area anchors.fill: parent onClicked: { var temp = searchInfo searchInfo = "" hanziindex = index hanziinfo = col0 selecthanzi_timer.restart() } } } } } Timer{ id: selecthanzi_timer interval: 1 onTriggered: { listView.model = listtmp systemCtrlLink.setSelectedHanZiIndex(hanziindex, hanziinfo) clickinputtext() } } ListView{ id:listView x: 0 y: 0 width: 864 height: 78 opacity: (listView.count>0&&isPinyin&&ishowStatus)?1:0 enabled: (listView.count>0&&isPinyin&&ishowStatus)?1:0 flickableDirection:Flickable.HorizontalFlick clip: true snapMode:ListView.SnapToItem orientation:ListView.Horizontal //model:systemCtrlLink.pinyinAlternateList highlightFollowsCurrentItem:true highlightRangeMode: ListView.StrictlyEnforceRange cacheBuffer: listView.width*4 delegate: recipeDelegate spacing:2 onMovementStarted: { refreshList.restart() } onMovementEnded: { refreshList.stop() } onFlickEnded:{ refreshList.stop() } onFlickStarted:{ refreshList.restart() } Timer{ id:refreshList interval: 800 repeat: true running: false onTriggered: { if(listview.visible) { listview.visible = false listview.visible = true } } } } Row { id:firRow x: 1 y: 801-721 spacing: 2 Repeater{ model: { switch(iType) { case 1: ["Q","W","E","R","T","Y","U","I","O","P"] break; case 2: ["q","w","e","r","t","y","u","i","o","p"] break; case 3: ["1","2","3","4","5","6","7","8","9","0"] break; case 4: ["[","]","{","}","#","%","^","*","+","="] break; } } HMIKeyBrdButton{ id:firstRowKey labelText:modelData onPressed: { if(!isPinyin) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } else if(!maximumState) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } } } } } Row { id: secRow spacing: 2 anchors{top:firRow.bottom;topMargin: 2;left: firRow.left;leftMargin: 48} Repeater{ model: { switch(iType) { case 1: ["A","S","D","F","G","H","J","K","L"] break; case 2: ["a","s","d","f","g","h","j","k","l"] break; case 3: ["-","/",":",";","(",")","!","《","》"] break; case 4: ["——","\\","`","~","<",">","$","@","&"] break; } } HMIKeyBrdButton{ id:secondRowKey; labelText: modelData onPressed: { if(!isPinyin) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } else if(!maximumState) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } } } } } Row{ id: thirdRow anchors{top:secRow.bottom;topMargin: 2;left: secRow.left;leftMargin: -48}//{top:parent.top;topMargin:0;horizontalCenter: parent.horizontalCenter} spacing: 2 HMIButton{ id:shift btnImg: pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142.png" btnIcon:iType==3?"":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Shift.png" labelText: iType==3?"#+=":"" labelSize:30 labelPixelSize:30 onClicked: { if(isZifu) { if(isSmall) { iType=4 isSmall=false shift.labelText=("123") shift.btnIcon="" } else { iType=3 isSmall=true shift.labelText=("#+=") shift.btnIcon="" } } else { if(isSmall) { iType=1 isSmall=false } else { iType=2 isSmall=true } } } } Repeater{ model: { switch(iType) { case 1: ["Z","X","C","V","B","N","M"] break; case 2: ["z","x","c","v","b","n","m"] break; case 3: ["、","_","。","?",",","\“","\”"] break; case 4: [".","·","‘","’","|","¥","…"] break; } } HMIKeyBrdButton{ id:thirdRowKey; labelText: modelData onPressed: { if(!isPinyin) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } else if(!maximumState) { str = modelData; clickspell(str,isPinyin); searchInfo = searchInfo + modelData ishowStatus=1 } } } } HMIButton{ id:deleteKey btnImg: pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142.png" //btnIcon:deleteKey.enabled?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_delete.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_delete_d.png" //btnIcon:imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_delete.png" Image{ x:867-817 y:987-961 source:imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_delete.png" } enabled:true onClicked:{ if(deleteEnable){ if(isPinyin) { if (searchInfo.length > 1){ searchInfo = searchInfo.substring(0,searchInfo.length-1) } else { systemCtrlLink.setKeyPress("delete") searchInfo = "" ishowStatus=0 } } else{ systemCtrlLink.setKeyPress("delete") searchInfo = "" ishowStatus=0 } } } onPressAndHold: { if(deleteKey.enabled){ listView.model = "" searchInfo = "" deleteLongPress() } } } } Row{ id: fourRow anchors{top:thirdRow.bottom;topMargin: 2;left: thirdRow.left;}//{top:parent.top;topMargin:0;horizontalCenter: parent.horizontalCenter} spacing: 2 HMIButton{ id:number btnImg: pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142.png" labelText:"123" labelSize:30 labelPixelSize:30 onClicked: { switch(iQiehuan) { case 1: if(!isZifu) { number.labelText=("ABC") isZifu=true iType=3 isPinyin=false shift.labelText=("#+=") shift.btnIcon="" isSmall = true } else { number.labelText=("123") isZifu=false iType=1 isPinyin=true shift.labelText=("") shift.btnIcon=imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Shift.png" isSmall = false } break; case 2: if(!isZifu) { number.labelText=("ABC") isZifu=true iType=3 isPinyin=false shift.labelText=("#+=") shift.btnIcon="" isSmall = true } else { number.labelText=("123") isZifu=false iType=2 isPinyin=false shift.labelText=("") isSmall = true shift.btnIcon=imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Shift.png" } break; } } } HMIButton{ id:pinyin btnImg: pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142.png" //labelText:qsTr("PY") + systemCtrlLink.emptyString labelText: qsTr("全拼") + applinkControl.qsEmptyString labelPixelSize : 30 onClicked: { if(iQiehuan==1) { iQiehuan=2 isPinyin=false isZifu=false searchInfo = "" //pinyin.labelText=qsTr("EN") + systemCtrlLink.emptyString pinyin.labelText=qsTr("英文") + applinkControl.qsEmptyString number.labelText=("123") iType=2 isSmall = true } else { iQiehuan=1 isPinyin=true isZifu=false searchInfo = "" //pinyin.labelText=qsTr("PY") + systemCtrlLink.emptyString pinyin.labelText=qsTr("全拼") + applinkControl.qsEmptyString number.labelText=("123") iType=1 handwriteborad() searchInfo = "" } shift.labelText=("") shift.btnIcon=imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Shift.png" ishowStatus=0 } } HMIButton{ id:ctrlKey; btnImg: ctrlKey.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Space_Button_w526_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Space_Button_w526.png"; //btnIcon:imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Space.png" //btnIconOnDisabled:imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Space_d.png" labelBold : false labelPixelSize : 30 onPressed:str = ""; Image{ x:523-289 y:1075-1041 source:enabled?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Space.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_icon_Space_d.png" } onClicked: { systemCtrlLink.setKeyPress(" ") searchInfo = ""; clickspace() } } HMIButton{ id:search //enabled: search.enabled?true:false btnImg: pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_keyboard_Button_h142.png" enabled:true //labelText: qsTr("Srch") + systemCtrlLink.emptyString labelText: qsTr("检索") + applinkControl.qsEmptyString labelPixelSize : 30 //labelColor: search.enabled?"white":"#646566" labelColor:"white" onClicked: { if(searchEnable){ searchStart() } } // HMILabel{ // id:txt // x:30 // y:106/2 // width:81 // height: 106/2 // color:search.enabled?"white":"#4D4D4D" // text:qsTr("Srch") + systemCtrlLink.emptyString // } // onClicked: { // if(search.enabled) // searchStart() // } } } }