Commit ab1c5558 authored by berge's avatar berge
Browse files

Added external function in LibUserInterface to replace TT_Library

Compilation successful (/!\ with RELATIVE-OID issue in ASN.1 module ignored) on ttwb, titan, testcast and danet 
parent 9fef66f4
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
 *  
 */
module LibUserInterface {
    //import from TTlibrary all;

    type record of charstring ButtonLabels;

@@ -44,7 +43,7 @@ module LibUserInterface {
    type record ShowMessageBox {
        charstring title,
        charstring msg,
        record of charstring buttonLables,
        ButtonLabels buttonLables,
        integer defaultSelection,
        integer msgTimeout optional
    }
@@ -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


@@ -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);
@@ -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
}