Loading ttcn/LibUserInterface.ttcn +13 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * */ module LibUserInterface { //import from TTlibrary all; type record of charstring ButtonLabels; Loading Loading @@ -44,7 +43,7 @@ module LibUserInterface { type record ShowMessageBox { charstring title, charstring msg, record of charstring buttonLables, ButtonLabels buttonLables, integer defaultSelection, integer msgTimeout optional } Loading @@ -68,14 +67,12 @@ module LibUserInterface { port UIPort uiPort; } function f_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection) return integer { //return messageBox(p_title, p_message, p_buttonLabels, p_defaultSelection); return -1; } // end f_messageBoxYesNo function f_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection := 0, in integer p_msgTimeout := 0) return integer { return fx_messageBox(p_title, p_message, p_buttonLabels, p_defaultSelection, p_msgTimeout); } // end f_messageBox function f_messageBoxYesNo(in charstring p_title, in charstring p_message) return integer { //return messageBox_YesNo(p_title, p_message); return -1; return f_messageBox(p_title, p_message, {"Yes", "No"}); } // end f_messageBoxYesNo Loading @@ -90,10 +87,10 @@ module LibUserInterface { var integer v_selectedButton; if (ispresent(v_showMessageBoxCmd.msgTimeout)) { //v_selectedButton := timedMessageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection, v_showMessageBoxCmd.msgTimeout); v_selectedButton := f_messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection, v_showMessageBoxCmd.msgTimeout); } else { //v_selectedButton := messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection); v_selectedButton := f_messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection); } uiPort.send(MessageBoxSelection:v_selectedButton); Loading @@ -108,4 +105,10 @@ module LibUserInterface { } } } group externalFunctions { external function fx_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection, in integer p_msgTimeout) return integer; } // externalFunctions } Loading
ttcn/LibUserInterface.ttcn +13 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * */ module LibUserInterface { //import from TTlibrary all; type record of charstring ButtonLabels; Loading Loading @@ -44,7 +43,7 @@ module LibUserInterface { type record ShowMessageBox { charstring title, charstring msg, record of charstring buttonLables, ButtonLabels buttonLables, integer defaultSelection, integer msgTimeout optional } Loading @@ -68,14 +67,12 @@ module LibUserInterface { port UIPort uiPort; } function f_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection) return integer { //return messageBox(p_title, p_message, p_buttonLabels, p_defaultSelection); return -1; } // end f_messageBoxYesNo function f_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection := 0, in integer p_msgTimeout := 0) return integer { return fx_messageBox(p_title, p_message, p_buttonLabels, p_defaultSelection, p_msgTimeout); } // end f_messageBox function f_messageBoxYesNo(in charstring p_title, in charstring p_message) return integer { //return messageBox_YesNo(p_title, p_message); return -1; return f_messageBox(p_title, p_message, {"Yes", "No"}); } // end f_messageBoxYesNo Loading @@ -90,10 +87,10 @@ module LibUserInterface { var integer v_selectedButton; if (ispresent(v_showMessageBoxCmd.msgTimeout)) { //v_selectedButton := timedMessageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection, v_showMessageBoxCmd.msgTimeout); v_selectedButton := f_messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection, v_showMessageBoxCmd.msgTimeout); } else { //v_selectedButton := messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection); v_selectedButton := f_messageBox(v_showMessageBoxCmd.title, v_showMessageBoxCmd.msg, v_showMessageBoxCmd.buttonLables, v_showMessageBoxCmd.defaultSelection); } uiPort.send(MessageBoxSelection:v_selectedButton); Loading @@ -108,4 +105,10 @@ module LibUserInterface { } } } group externalFunctions { external function fx_messageBox(in charstring p_title, in charstring p_message, in ButtonLabels p_buttonLabels, in integer p_defaultSelection, in integer p_msgTimeout) return integer; } // externalFunctions }