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 QtQuick.Controls 1.0 import Label 2.0 HMIWindow { id:msg_View_Answer //y:128 property int curMsgIndex: 0 Component.onCompleted: { windowID = WindowsList.CARLINK_CONTACTS_SMS_VIEW } onVisibleChanged: { bFullWindow = true msglist.model=carlinkCtrl.getcarlinkContactsMsgDiaListModel() msglist.positionViewAtEnd() systemCtrl.setTextInputHandle(answerInput) answerInput.text = "" if(keyBoard.visible == true) { keyBoard.visible = false } if(input_bar.visible == true) { input_bar.visible = false } if(icon_Send.visible == true) { icon_Send.visible = false } if(answer_btn.visible == false) { answer_btn.visible = true } } Timer{ id:listtimer interval: 1 repeat : false running : true triggeredOnStart : false onTriggered: { msglist.positionViewAtEnd() } } HMILabel { x:24 y:128-128 width:700 height:56 text:"Interact" color: "white" font.pixelSize: 28 verticalAlignment: Label.AlignVCenter horizontalAlignment: Label.AlignLeft } HMILabel { id:view_Name x:79 y:20 width:610 height:62 text:carlinkCtrl.carlinkselectContactsmsgphone+" "+carlinkCtrl.carlinkselectContactsmsgname//"SMS List" color: "white" font.pixelSize: 28 horizontalAlignment: horizontalAlignment verticalAlignment: verticalAlignment } HMIButton { id:icon_return x:689 y:151-128 width: 31 height: 21 btnImg:icon_return.pressed?("qrc:MATERIAL/MATERIAL_M8X_ICON_BACK_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle) onClicked: { ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.CARLINK_CONTACTS_SMS_VIEW) ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_ALL_LIST) } } Item { id:readmsg x:24 y:190-128 width:700 height: (keyBoard.visible == true)?180:640-6-3 HMIListView { id:msglist anchors.fill: parent clip:true model:carlinkCtrl.getcarlinkContactsMsgDiaListModel() delegate: msg_View keyNavigationWraps: true orientation: ListView.Vertical highlightFollowsCurrentItem: true snapMode: ListView.SnapOneItem scrollBar:true scrollBar_edge:0 scrollBar_width:4 scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+bgImageStyle } Component { id:msg_View Item { width: 700 height: (60+msgtext.height)<160?160:(60+msgtext.height) HMILabel { id:msgtime x:79 y:0 width:610 height:60 text:model.modelData.ContactsDiaMsg_Date//carlinkCtrl.getContactsMsgDate() color: "#545454" font.pixelSize: 24 horizontalAlignment: horizontalAlignment verticalAlignment: verticalAlignment } Rectangle { id:msgpic x:230-24//254-24//col2 == "0"?34-24:254-24 y:254-200 width: 470//480 height:(msgtext.height+10)<100?100:(msgtext.height+10) color: "#8A0000"//(col2 == "0")?"#262626":"#8A0000" } Text { id:msgtext visible: false x:254-24//col2 == "0"?34-24:254-24 y:254-188+4-13 width: 450//480 font.family: "方正兰亭黑简体" font.pixelSize:24 text:model.modelData.ContactsDiaMsg_Content//col0 color:"white" wrapMode:Label.WrapAnywhere } HMILabel { id:msgLabel x:msgtext.x y:msgtext.y width: msgtext.width height: msgtext.height+6//*0.860 font.pixelSize:24 text:model.modelData.ContactsDiaMsg_Content//col0 color:"white" wrapMode:Label.WrapAnywhere verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft } Image { id:sms_failed x:128-34 y:254-200 width: 30 height: 30 visible:model.modelData.ContactsDiaMsg_Status == "0"//col1 == "0"?true:false//(((col1 == "1")&&(col4 == "0"))||(col1 == "1"))?true:false source:"qrc:MATERIAL/MATERIAL_M8X_ICON_SMS-FALLURE"+bgImageStyle } } } } HMILabel { id:answer x:20 y:250 width:120 height:60 font.pixelSize: 24 text:"Answer" visible: keyBoard.visible } Item { id:input_bar x:30 y:254+20+50 width: 698 height: 126 visible: keyBoard.visible HMIButton { x:24-30 y:518-254-150-128 btnImg: (keyBoard.visible == true)?("qrc:MATERIAL/MATERIAL_M8X_SMS_BK_WIDE700"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_SMS_BK_WIDE700_HIGH382"+bgImageStyle) } Flickable { id: flick x:0 y:254-90-128-50 width: 698 height: 126 flickableDirection:Flickable.VerticalFlick contentWidth: answerInput.paintedWidth contentHeight: answerInput.paintedHeight clip: true function ensureVisible(r) { if (contentX >= r.x) contentX = r.x; else if (contentX+width <= r.x+r.width) contentX = r.x+r.width-width; if (contentY >= r.y) contentY = r.y; else if (contentY+height <= r.y+r.height) contentY = r.y+r.height-height; } TextEdit { id: answerInput width: 698 height: answerInput.contentHeight//flick.height focus: true font.pixelSize: 24 color:"white" cursorVisible:true wrapMode: TextEdit.Wrap onCursorRectangleChanged: flick.ensureVisible(cursorRectangle) onLengthChanged: { if(length > 80) { console.debug("lengthlengthlengthlengthlengthlengthlengthlength") remove(80, 82) } } } } } /*---------------------------------------------Key Board Start----------------------------------------*/ HMIKeyBoard { id:keyBoard x:0 y:380+60 visible: false iSerach: false onVisibleChanged: { msglist.positionViewAtEnd() } onClickspell: { if(!keyBoard.isPinyin) systemCtrl.setKeyPress(spell) } } /*---------------------------------------------Key Board Over----------------------------------------*/ Image{ id:answer_btn x:60 y:822-128 width: 124 height: 66 visible:!keyBoard.visible source:icon_Answer.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle) HMILabel{ color: "white" font.pixelSize: 28 horizontalAlignment:horizontalAlignment verticalAlignment: verticalAlignment anchors.fill: parent text: "Answer" } HMIMouseArea{ id:icon_Answer anchors.fill: parent onClicked: { keyBoard.visible = true icon_Send.visible = true answer_btn.visible = false input_bar.visible = true } } } HMIButton { id:icon_Send x:60 y:822-128 width: 124//100 height: 66 labelText: "Send" btnImg:icon_Send.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle) visible: false onClicked: { console.log("[Carlink_Contacts_SMS_View]---------icon_Send clicked") carlinkCtrl.carLinkContactsMsgSend(answerInput.text); carlinkCtrl.setDiaSend(true); answerInput.text = "" keyBoard.visible = false input_bar.visible = false answer_btn.visible = true icon_Send.visible = false } } Connections { target: carlinkCtrl onCarLinkselectContactsmsgnameChanged://onCarlinkselectmsgnameChanged: { console.debug("[Carlink_Contacts_SMS_View.qml]---------------------------onCarLinkselectContactsmsgnameChanged") view_Name.text = carlinkCtrl.carlinkselectContactsmsgphone+" "+carlinkCtrl.carlinkselectContactsmsgname//carlinkselectmsgname() } onSigMsgFailedChanged: { sms_failed.visible = ture } onSigIsDiaSendOkChanged: { console.debug("----------------------------------------") msglist.model=carlinkCtrl.getcarlinkContactsMsgDiaListModel() } } }