/* * Scol Voyager * * Author : The Scol Team : http://www.scolring.org/ * * This file is a part of the Scol Voyager * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt * * For others informations, please contact us from http://www.scolring.org/ * */ var MASTER_GUI_ENABLED = 0;; // actu, pas d'autres choix (cf _saveusmini), mettre à 1 quand résolu var MASTER_GUI_DISABLED = 0;; fun guiCLcreateCancel ()= master_cancel;; fun guiCLcbCancel (obj, win)= _DSwindow win; guiCLcreateCancel;; fun guiCLcbContinue2 (listCheck, listLib)= if listCheck == nil then nil else let hd listCheck -> box in let hd listLib -> [_ _ _ name] in [name _GETcheck box] :: guiCLcbContinue2 tl listCheck listLib;; fun guiCLcbContinue (obj, params)= let params -> [win listCheckBoxes checkedLibraries cFull p] in let guiCLcbContinue2 listCheckBoxes checkedLibraries -> listChoice in let _GETcheck cFull -> cFull in ( _DSwindow win; master_setLibrairies listChoice cFull p );; fun guiCLsetButton (btnCancel, btnLoad, params)= let params -> [win listCheckBoxes checkedLibraries cFull p] in ( _CBbutton btnCancel @guiCLcbCancel win; _CBbutton btnLoad @guiCLcbContinue params; 0 );; fun guiCLsetCheckBox (listBox, listDatas)= if listBox == nil then 0 else let hd listBox -> box in let hd listDatas -> [name flag loading libname] in let if flag == MASTER_CHECK_CRITICAL then " (Critical)" else if flag == MASTER_CHECK_IMPORTANT then " (Important)" else if flag == MASTER_CHECK_OPTIONAL then " (Optional)" else " (Undefined)" -> szFlag in let if loading == MASTER_CHECK_SUCCESS then "success" else if loading == MASTER_CHECK_FAILURE then "failure" else "undefined" -> szLoading in let strcatn name :: szFlag :: " load : " :: szLoading :: nil -> szTitle in ( _SETcheckName box szTitle; if libname != nil then _ENcheck box MASTER_GUI_ENABLED else nil; guiCLsetCheckBox tl listBox tl listDatas );; fun guiCLcreateCheckBox (n, size, win1, win2, w, h, margin)= if n < (0-size/2) then nil else let abs n -> an in (_ENcheck if (n >= 0) then _CRcheck _channel win1 margin (an+1)*margin+(an*20) w-(2*margin) 20 CH_LEFT "" else _CRcheck _channel win2 margin (an-4)*margin+(an*20) w-(2*margin) 20 CH_LEFT "" MASTER_GUI_DISABLED) :: guiCLcreateCheckBox n-1 size win1 win2 w h margin;; fun guiCLsetCheckLoadChoice (box)= let getInfo (strextr _loadusmini nil) "fullLoading" -> loadmode in let if !strcmpi loadmode "0" then 0 else 1 -> mode in _SETcheck box mode; 0;; fun guiCLcreate (size)= let _GETscreenSize -> [ws hs] in let [ws-200 5 100 60] -> [w margin wbutton htext] in let ( set w = if w > 1000 then 1000 else w; 20+htext+20+20+4*margin+(size/2)*20+((size/2)+1)*margin ) -> h in let _TOPMOSTwindow _CRwindow _channel nil (ws/2)-(w/2) (hs/2)-(h/2) w h WN_NORMAL " Scol libraries" 3 1 -> win in let _CRwindow _channel win margin margin (w/2)-(2*margin) (size/2)*20+((size/2)+1)*margin WN_CHILDINSIDE "" -> winChild1 in let _CRwindow _channel win (2*margin)+(w/2)-(2*margin) margin (w/2)-(2*margin) (size/2)*20+((size/2)+1)*margin WN_CHILDINSIDE "" -> winChild2 in let guiCLcreateCheckBox size/2 size winChild1 winChild2 (w/2)-(2*margin) (size/2)*20+((size/2)+1)*margin margin -> listCheckBoxes in let _CRcheck _channel win margin h-20-20-htext-4*margin w-2*margin 20 CH_LEFT "Continue with all succesfully loaded plugins (checked) or with the minimal apis (unchecked) ? (default : checked)" -> cFull in let _CRbutton _channel win w-2*wbutton-2*margin h-20-margin wbutton 20 0 "Cancel" -> btnCancel in let _CRbutton _channel win w-wbutton-margin h-20-margin wbutton 20 0 "Continue" -> btnLoad in let _CRtext _channel win margin h-20-htext-3*margin w-2*margin htext ET_BORDER "Currently, it is not possible to change the loading from this interface. Which is why the checkboxs are disabled above." -> t in [win listCheckBoxes cFull btnCancel btnLoad];; fun guiCLmain (checkedLibraries, p)= let guiCLcreate sizelist checkedLibraries -> [win listCheckBoxes cFull btnCancel btnLoad] in ( guiCLsetCheckBox listCheckBoxes checkedLibraries; guiCLsetCheckLoadChoice cFull; guiCLsetButton btnCancel btnLoad [win listCheckBoxes checkedLibraries cFull p]; 0 );;