local UIMessageInputView = UIViewClass() function UIMessageInputView:OnOpened(context) UTL.String.SetLabelContent(self.lab_Title,context.title) self.event_Gold:SetText(context.okBtnText) self.event_Green:SetText(context.cancelBtnText) self.okCB = context.okCB UTL.String.SetLabelContent(self.Placeholder,context.defaultInputText) end function UIMessageInputView:OnButtonClicked(obj) if obj == self.event_Gold then local msg = self.obj_InputField.text if string.isNilOrEmpty(msg) then CTL.Tips.AddTipsMsg(Const_IDS["IDS_ERRORCODE_1023_InfoCode_CDKey_Invalid"]) return end if self.okCB then self.okCB(msg) end else self:CloseView() end end return UIMessageInputView