/* * ===================================================================================== * * Filename: App_HMIScrollMenu.qml * * Description: * * Version: 1.0 * Created: 2016-1-5 15:50 * Revision: none * Compiler: gcc * * Author: jliu.neu, jliu.neu@neusoft.com * Organization: www.neusoft.com * * ===================================================================================== */ import "../../eventsList.js" as EventsList import "../../windowsList.js" as WindowsList import "../../layoutList.js" as Layout import "../search.js" as Search import QtQuick 2.0 import Label 2.0 Image{ id: scrollMenu property bool bVisible_pop:false property bool bEnabled_aro:true property int iMsgType:0 property bool bIsDestExist:false property int iAddType:0//srchType:0-srch,1-via,2-dest,3-fun,4-mark,5-history,6-via1,7-via2,8-via3 property bool bShutSearch:false property bool bShutDest:false property bool bShutVia:false property bool bEnabled_home:true onVisibleChanged: { if(visible){ bIsDestExist = false bVisible_pop = false } } Image{ id:scrollmenu x:90 y:881 width: 870 height: 78 MouseArea{ id: mapMouseArea anchors.fill: parent } Row{ id:scrollMenu_row spacing: 0 anchors.top: scrollmenu.top //===========================destBtn===========================// HMIButton{ id: destBtn height: 78 visible: !bShutDest//(iAddType==1||iAddType==6||iAddType==7||iAddType==8)?false:true width:bEnabled_home?(bEnabled_aro?(bShutSearch?218:(bShutVia?290:174)):(bShutVia?435:290)):(bEnabled_aro?174:218) btnImg:{ switch(destBtn.width){ case 174: destBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w174_p.png":imagePath_navi+"M8X_NAVI_Button_w174.png" break; case 218: destBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w218_p.png":imagePath_navi+"M8X_NAVI_Button_w218.png" break; case 290: destBtn.pressed?imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290_p.png":imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290.png" break; case 435: destBtn.pressed?imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch_p.png":imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch.png" break; default: break; } } Image{ id:destBtn_icon anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 13 source:destBtn.enabled?imagePath_navi+"M8X_Icon_Dest.png":imagePath_navi+"M8X_Icon_Dest_D.png" } HMILabel{ id:destBtn_Text anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 53 width : parent.width height: 21 font.pixelSize:18 color:destBtn.enabled?"white":"grey" text:qsTr("目的地") + applinkControl.qsEmptyString } onClicked:{ if(iAddType==0||iAddType==3||iAddType==4||iAddType==5){ if(applinkControl.QML_NIF_Cus_SetDest(location_com.sDestName)==0){ applinkControl.QML_NIF_Cus_StartCalc(); iMsgType = 1; msg_PopUp.visible = true } }else if(iAddType==2){ //if(location_com.bMapMove == false){ //applinkControl.QML_NIF_Cus_SetDest(applinkControl.QML_getcomTitle()) //}else{ applinkControl.QML_NIF_Cus_SetDest(location_com.sDestName) //} ScreenManager.backward(Layout.APPLINK,WindowsList.APP_ROUTE_GUIDE) } } } //===========================viaBtn===========================// HMIButton{ id: viaBtn height: 78 visible:!bShutVia//(iAddType==2)?false:true width:bEnabled_home?(bEnabled_aro?(bShutSearch?218:(bShutDest?290:174)):(bShutDest?435:290)):(bEnabled_aro?174:218) btnImg:{ switch(viaBtn.width){ case 174: viaBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w174_p.png":imagePath_navi+"M8X_NAVI_Button_w174.png" break; case 218: viaBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w218_p.png":imagePath_navi+"M8X_NAVI_Button_w218.png" break; case 290: viaBtn.pressed?imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290_p.png":imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290.png" break; case 435: viaBtn.pressed?imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch_p.png":imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch.png" break; default: break; } } Image{ id:viaBtn_icon anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 15 source:viaBtn.enabled?imagePath_navi+"M8X_Icon_Via.png":imagePath_navi+"M8X_Icon_Via_d.png" } HMILabel{ id:viaBtn_Text anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 53 width : parent.width height: 21 font.pixelSize:18 color:viaBtn.enabled?"white":"grey" text:qsTr("途经地") + applinkControl.qsEmptyString } onClicked:{ if(iAddType==0||iAddType==3||iAddType==4||iAddType==5){ bVisible_pop = !bVisible_pop if(bVisible_pop){ applinkControl.QML_NIF_Cus_GetDestAndViaInfo(); } }else if(iAddType==6 || iAddType==7 || iAddType==8){ // if(location_com.bMapMove == false){ // applinkControl.QML_NIF_Cus_SetVia((iAddType-6),applinkControl.QML_getcomTitle()) // }else{ applinkControl.QML_NIF_Cus_SetVia((iAddType-6),location_com.sDestName) // } ScreenManager.backward(Layout.APPLINK,WindowsList.APP_ROUTE_GUIDE) } } } //===========================poiBtn===========================// HMIButton{ id: poiBtn height: 78 width:bEnabled_home?(bEnabled_aro?(bShutSearch?218:(bShutDest||bShutVia?290:174)):(bShutDest||bShutVia?435:290)):(bEnabled_aro?174:218) btnImg:{ switch(poiBtn.width){ case 174: poiBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w174_p.png":imagePath_navi+"M8X_NAVI_Button_w174.png" break; case 218: poiBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w218_p.png":imagePath_navi+"M8X_NAVI_Button_w218.png" break; case 290: poiBtn.pressed?imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290_p.png":imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290.png" break; case 435: poiBtn.pressed?imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch_p.png":imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch.png" break; default: break; } } Image{ id:poiBtn_icon anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 14 source:imagePath_navi+"M8X_Icon_POI.png" } HMILabel{ id:poiBtn_Text anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 53 width : parent.width height: 21 font.pixelSize:18 text:qsTr("兴趣点") + applinkControl.qsEmptyString } onClicked:{ if(applinkControl.compoiCount<100){ var qMarkName = "" // if(location_com.bMapMove == false){ // qMarkName = applinkControl.QML_getcomTitle() // console.log("[aaaaaaaa]-----1----set user mark----name is "+qMarkName) // }else{ qMarkName = location_com.sDestName console.log("[applink]---------set user mark----name is "+qMarkName) // } if(applinkControl.QML_NIF_Poi_SetMark(qMarkName)==0){ iMsgType = 2;//SUCCESS msg_PopUp.visible = true msg_timer.restart() }else{ iMsgType = 19;//FAIL msg_PopUp.visible = true msg_timer.restart() } }else{ iMsgType = 18;//full msg_PopUp.visible = true msg_timer.restart() } } } //===========================aroBtn===========================// HMIButton{ id: aroBtn height: 78 visible: bEnabled_aro width:bShutSearch?218:(bShutDest||bShutVia?290:174) btnImg:{ switch(aroBtn.width){ case 174: aroBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w174_p.png":imagePath_navi+"M8X_NAVI_Button_w174.png" break; case 218: aroBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w218_p.png":imagePath_navi+"M8X_NAVI_Button_w218.png" break; case 290: aroBtn.pressed?imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290_p.png":imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290.png" break; case 435: aroBtn.pressed?imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch_p.png":imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch.png" break; default: break; } } Image{ id:aroBtn_icon anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 13 source:imagePath_navi+"M8X_icon_Around.png" } HMILabel{ id:aroBtn_Text anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 53 width : parent.width height: 21 font.pixelSize:18 text:qsTr("周边") + applinkControl.qsEmptyString } onClicked:{ applinkControl.QML_NIF_Poi_GetQuickKind() applinkControl.QML_SSPLink_iSetSrhArdMode(1) if(ScreenManager.getCurrentFormId()==WindowsList.APP_OPEN_MAP) { ScreenManager.forward(Layout.APPLINK,WindowsList.AP_NAVI_SRCHAROUNDMAIN) } if(ScreenManager.getCurrentFormId()==WindowsList.APP_LOCATION_MOVE) { ScreenManager.forward(Layout.APPLINK,WindowsList.AP_NAVI_SRCHAROUNDMAIN) } } } //===========================searchBtn===========================// HMIButton{ id: searchBtn height: 78 visible:!bShutDest&&!bShutVia&&!bShutSearch && (bEnabled_aro||!bEnabled_home) width:!bEnabled_aro&&!bEnabled_home?218:174 btnImg:{ switch(searchBtn.width){ case 174: searchBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w174_p.png":imagePath_navi+"M8X_NAVI_Button_w174.png" break; case 218: searchBtn.pressed?imagePath_navi+"M8X_NAVI_Button_w218_p.png":imagePath_navi+"M8X_NAVI_Button_w218.png" break; case 290: searchBtn.pressed?imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290_p.png":imagePath_navi+"Navi/Type_B_Location/B_03_Location_information_3button/M8X_NAVI_Button_w290.png" break; case 435: searchBtn.pressed?imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch_p.png":imagePath_navi+"Common/M8X_Function_2_Button_NoSwitch.png" break; default: break; } } Image{ id:searchBtn_icon anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 13 source:iAddType==3?imagePath_navi+"M8X_icon_Function_home.png":imagePath_navi+"M8X_icon_Search.png" } HMILabel{ id:searchBtn_Text anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 53 width : parent.width height: 21 font.pixelSize:18 color:searchBtn.enabled?"white":"grey" text:(iAddType==3)?qsTr("家") + applinkControl.qsEmptyString:qsTr("检索") + applinkControl.qsEmptyString } onClicked:{ if(iAddType==3){//home // if(location_com.bMapMove == false){ // applinkControl.QML_NIF_Poi_SetHome(applinkControl.QML_getcomTitle()) // }else{ applinkControl.QML_NIF_Poi_SetHome(location_com.sDestName) // } if(Search.FromFunctionMain == applinkControl.QML_SSPLink_iGetToKeyCrossMain()) { ScreenManager.backward(Layout.APPLINK,WindowsList.APP_FUNCTION_MAIN) }else if(Search.Fromothersetting == applinkControl.QML_SSPLink_iGetToKeyCrossMain()) { ScreenManager.backward(Layout.APPLINK,WindowsList.APP_OTHER_SETTING) } applinkControl.QML_AddHome() }else{ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NAVI_SRCHKEYCROSSMAIN) } } } } } Connections{ target:applinkControl onSignal_NIF_Cus_GetDestAndViaInforCB:{ if(""===qVia1Name){ qVia1Name = qsTr("未定义") + applinkControl.qsEmptyString }else{ qVia1Name = applinkControl.QML_cutStringForDisplay(qVia1Name, 5) } if((bIsVia1Valid)&&(!bIsVia1Arrived)){ pathWay1_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-1.png" }else{ pathWay1_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-1.png" } if(""===qVia2Name){ qVia2Name = qsTr("未定义") + applinkControl.qsEmptyString }else{ qVia2Name = applinkControl.QML_cutStringForDisplay(qVia2Name, 5) } if((bIsVia2Valid)&&(!bIsVia2Arrived)){ pathWay2_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-2.png" }else{ pathWay2_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-2.png" } if(""===qVia3Name){ qVia3Name = qsTr("未定义") + applinkControl.qsEmptyString }else{ qVia3Name = applinkControl.QML_cutStringForDisplay(qVia3Name, 5) } if((bIsVia3Valid)&&(!bIsVia3Arrived)){ pathWay3_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-3.png" }else{ pathWay3_icon.source = imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-3.png" } if(bIsDestValid && !bIsDestArrived){ bIsDestExist = true } pathWay1_info.text = qVia1Name; pathWay2_info.text = qVia2Name; pathWay3_info.text = qVia3Name; } } //===========================popList===========================// Image{ id:popList x:221 y:835-160 visible: bVisible_pop source:imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button3_bg.png" Column{ id:column spacing: 2 anchors.left: parent.left anchors.leftMargin: 8 anchors.top:parent.top anchors.topMargin: 8 //===========================pathWay1===========================// HMIButton{ id: pathWay1 width:240 height: 62 labelPixelSize:24 btnImg: pathWay1.pressed?imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button_p.png":imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button.png" onClicked:{ applinkControl.QML_NIF_Cus_SetVia(0,location_com.sDestName) bVisible_pop = false if(iAddType==0||iAddType==3||iAddType==4||iAddType==5){ msg_PopUp.visible = true if(bIsDestExist){ applinkControl.QML_NIF_Cus_StartCalc(); iMsgType = 1; }else{ iMsgType = 3; msg_timer.restart() } } } Image{ id:pathWay1_icon x:245-231 y:851-843 source:imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-1.png" } HMILabel{ id:pathWay1_info x:298-231 y:859-843 font.pixelSize: 30 width:150+20 height:30+4 verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft text: qsTr("未定义") + applinkControl.qsEmptyString } } //===========================pathWay2===========================// HMIButton{ id: pathWay2 width:240 height: 62 btnImg: pathWay2.pressed?imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button_p.png":imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button.png" onClicked:{ applinkControl.QML_NIF_Cus_SetVia(1,location_com.sDestName) bVisible_pop = false if(iAddType==0||iAddType==3||iAddType==4||iAddType==5){ msg_PopUp.visible = true if(bIsDestExist){ applinkControl.QML_NIF_Cus_StartCalc(); iMsgType = 1; }else{ iMsgType = 3; msg_timer.restart() } } } Image{ id:pathWay2_icon x:245-231 y:851-843 source:imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-2.png" } HMILabel{ id:pathWay2_info x:298-231 y:859-843 font.pixelSize: 30 width:150+20 height:30+4 verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft text: qsTr("未定义") + applinkControl.qsEmptyString } } //===========================pathWay3===========================// HMIButton{ id: pathWay3 width:240 height: 62 btnImg: pathWay3.pressed?imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button_p.png":imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_popup-menu_Button.png" onClicked:{ applinkControl.QML_NIF_Cus_SetVia(2,location_com.sDestName) bVisible_pop = false if(iAddType==0||iAddType==3||iAddType==4||iAddType==5){ msg_PopUp.visible = true if(bIsDestExist){ applinkControl.QML_NIF_Cus_StartCalc(); iMsgType = 1; }else{ iMsgType = 3; msg_timer.restart() } } } Image{ id:pathWay3_icon x:245-231 y:851-843 source:imagePath_navi+"Navi/Type_B_Location/B_05_Location_tjd_setting/M8X_Icon_Via-3.png" } HMILabel{ id:pathWay3_info x:298-231 y:859-843 font.pixelSize: 30 width:150+20 height:30+4 verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft text: qsTr("未定义") + applinkControl.qsEmptyString } } } } }