/* ======================= Prime Graphic User Interface Custom Box Extension Framework Library V1.0 Author: Francesco Di Giorgio Date: 2019-14-06 MosaicoGroup Copyright 2019 ======================= */ if ($MWGUI != null) { function TMWGUICustomBox(Rows,Column) { switch(parseInt(Rows)) { case 2:{ this.Row = "resgui-2row"; break;} case 3:{ this.Row = "resgui-3row"; break;} case 4:{ this.Row = "resgui-4row"; break;} case 5:{ this.Row = "resgui-5row"; break;} case 6:{ this.Row = "resgui-6row"; break;} case 7:{ this.Row = "resgui-7row"; break;} case 8:{ this.Row = "resgui-8row"; break;} case 9:{ this.Row = "resgui-9row"; break;} case 10:{ this.Row = "resgui-10row"; break;} case 11:{ this.Row = "resgui-11row"; break;} case 12:{ this.Row = "resgui-12row"; break;} case 13:{ this.Row = "resgui-13row"; break;} case 14:{ this.Row = "resgui-14row"; break;} case 15:{ this.Row = "resgui-15row"; break;} case 16:{ this.Row = "resgui-16row"; break;} case 17:{ this.Row = "resgui-17row"; break;} case 18:{ this.Row = "resgui-18row"; break;} default:{ this.Row = "resgui-19row"; break;} } switch(parseInt(Column)) { case 2:{ this.Column = "resgui-2column"; break;} case 3:{ this.Column = "resgui-3column"; break;} case 4:{ this.Column = "resgui-4column"; break;} case 5:{ this.Column = "resgui-5column"; break;} case 6:{ this.Column = "resgui-6column"; break;} case 7:{ this.Column = "resgui-7column"; break;} case 8:{ this.Column = "resgui-8column"; break;} case 9:{ this.Column = "resgui-9column"; break;} case 10:{ this.Column = "resgui-10column"; break;} case 11:{ this.Column = "resgui-11column"; break;} case 12:{ this.Column = "resgui-12column"; break;} case 13:{ this.Column = "resgui-13column"; break;} case 14:{ this.Column = "resgui-14column"; break;} case 15:{ this.Column = "resgui-15column"; break;} case 16:{ this.Column = "resgui-16column"; break;} case 17:{ this.Column = "resgui-17column"; break;} case 18:{ this.Column = "resgui-18column"; break;} case 19:{ this.Column = "resgui-19column"; break;} case 20:{ this.Column = "resgui-20column"; break;} case 21:{ this.Column = "resgui-21column"; break;} case 22:{ this.Column = "resgui-22column"; break;} case 23:{ this.Column = "resgui-23column"; break;} case 24:{ this.Column = "resgui-24column"; break;} case 25:{ this.Column = "resgui-25column"; break;} case 26:{ this.Column = "resgui-26column"; break;} case 27:{ this.Column = "resgui-27column"; break;} case 28:{ this.Column = "resgui-28column"; break;} case 29:{ this.Column = "resgui-29column"; break;} case 30:{ this.Column = "resgui-30column"; break;} default:{ this.Column = "resgui-31column"; break;} } this.Background = parent.$MWGUI.MainDocument.createElement("div"); this.Background.className ="CustomBoxMain"; this.Background.Me = this; this.CustomBox = $MWGUI.MainDocument.createElement("div"); this.CustomBox.className = this.Row + " " + this.Column + " column-direction CustomBoxForm CustomBoxFormEntry"; this.Background.appendChild(this.CustomBox); this.Title = $MWGUI.MainDocument.createElement("div"); this.Title.className = "CustomBoxTitleRow"; this.CustomBox.appendChild(this.Title); this.Body = $MWGUI.MainDocument.createElement("div"); this.Body.className =" relative-full-width"; this.Body.style.height = "calc(100% - var(--resgui-1row))"; this.CustomBox.appendChild(this.Body); this.CustomBoxIsOpen = false; this.Open = function(Callback) { $MWGUI.MainBody.appendChild(this.Background); this.CustomBoxIsOpen = true; this.CallbackResult = Callback; } this.Close = function(Result, sender) { this.CustomBox.className = this.CustomBox.className.replace(new RegExp(" CustomBoxFormEntry","g"),""); this.CustomBox.className += " CustomBoxFormExit"; var Reference = this; setTimeout(function(){ if (Reference.Background && Reference.CustomBoxIsOpen) { $MWGUI.MainBody.removeChild(Reference.Background); } Reference.CustomBoxIsOpen = false; },350); if (this.CallbackResult != null) { this.CallbackResult(this,Result); } } } } else console.log("This library is an extention of MW.GUI.js Framework. Add script reference to this library!!!");