ok=%f
end
if ~ok then
- message(mess)
+ messagebox(mess,"modal")
else
rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
model.rpar=rpar;
//import all data in xml/tex files
//from data files
if %already_import then
- irr=message([" WARNING";
+ irr=messagebox([" WARNING";
"";
"You have already import data in xml/tex files by";
"running this script.";
"By importing data now, you can earase locally";
"the modifications that probably you have just made !";
""
- " Do you really know what you are doing ?"],["yes","no"]);
+ " Do you really know what you are doing ?"],"modal",["yes","no"]);
if irr==1 then, import_data_to_file('all',%gendoc), end;
clear irr;
else
%scicos_contrib_d ] = initial_scicos_tables() ;
if exists('scicos_pal')==0 then
- message(["scicos_pal not defined"; "using default values"])
+ messagebox(["scicos_pal not defined"; "using default values"],"modal")
scicos_pal = scicos_pal_d ;
end
if exists('%scicos_menu')==0 then
- message(["%scicos_menu not defined"; "using default values"])
+ messagebox(["%scicos_menu not defined"; "using default values"],"modal")
%scicos_menu = %scicos_menu_d ;
end
if exists('%scicos_short')==0 then
- message(["%scicos_short not defined"; "using default values"])
+ messagebox(["%scicos_short not defined"; "using default values"],"modal")
%scicos_short = %scicos_short_d ;
end
if exists('%scicos_help')==0 then
- message(["%scicos_help not defined"; "using default values"])
+ messagebox(["%scicos_help not defined"; "using default values"],"modal")
%scicos_help = %scicos_help_d ;
end
if exists('%scicos_display_mode')==0 then
- message(["%scicos_display_mode not defined"; "using default values"])
+ messagebox(["%scicos_display_mode not defined"; "using default values"],"modal")
%scicos_display_mode = %scicos_display_mode_d ;
end
if exists('modelica_libs')==0 then
- message(["modelica_libs not defined"; "using default values"])
+ messagebox(["modelica_libs not defined"; "using default values"],"modal")
modelica_libs = modelica_libs_d ;
end
if exists('scicos_pal_libs')==0 then
- message(["scicos_pal_libs not defined"; "using default values"])
+ messagebox(["scicos_pal_libs not defined"; "using default values"],"modal")
scicos_pal_libs = scicos_pal_libs_d ;
end
if exists('%scicos_lhb_list')==0 then
- message(["%scicos_lhb_list not defined"; "using default values"])
+ messagebox(["%scicos_lhb_list not defined"; "using default values"],"modal")
%scicos_lhb_list = %scicos_lhb_list_d ;
end
if exists('%CmenuTypeOneVector')==0 then
- message(["%CmenuTypeOneVector not defined"; "using default values"])
+ messagebox(["%CmenuTypeOneVector not defined"; "using default values"],"modal")
%CmenuTypeOneVector = %CmenuTypeOneVector_d ;
end
if exists('%scicos_gif')==0 then
- message(["%scicos_gif not defined"; "using default values"])
+ messagebox(["%scicos_gif not defined"; "using default values"],"messagebox")
%scicos_gif = %scicos_gif_d ;
end
if exists('%scicos_contrib')==0 then
- message(["%scicos_contrib not defined"; "using default values"])
+ messagebox(["%scicos_contrib not defined"; "using default values"],"modal")
%scicos_contrib = %scicos_contrib_d ;
end
end //** ... of the initialization variable
//end of for backward compatibility for scifunc
if ierr <>0 then
- message(['Error occur when evaluating context:' lasterror() ]) ;
+ messagebox(['Error occur when evaluating context:' lasterror() ],"modal") ;
else
deff('%fonct()',scs_m.props.context)
%outfun = macrovar(%fonct);
execstr('ierr=exec(OpenSet_,''errcatch'',-1)')
//execstr('exec(OpenSet_,-1)')
//**---------------------------------------------------
- if ierr<>0 then message(lasterror()),end
+ if ierr<>0 then messagebox(lasterror(),"modal"),end
if isequal(%diagram_path_objective,super_path) then // must add after testing &%scicos_navig<>[]
if ~or(curwin==winsid()) then
gh_current_window = scf(curwin);
end
if ~ok then
- message(["Problem saving a backup; I cannot activate Scilab.";
- "Save your diagram scs_m manually."]);
+ messagebox(["Problem saving a backup; I cannot activate Scilab.";
+ "Save your diagram scs_m manually."],"modal");
pause ;
end
end
if size(k,'*')>1 then //** if found more than one command
- message('Warning '+string( size(k,'*'))+' menus have identical name '+Cmenu);
+ messagebox('Warning '+string( size(k,'*'))+' menus have identical name '+Cmenu,"modal");
k = k(1); //** extract the index
end
if toremove<>[] then
rmpal=scicos_pal(toremove,:)
rmpal(:,1)=part(rmpal(:,1),1:max(length(rmpal(:,1))))
- message(['Following palette(s) ignored (associated file(s) no more exist):';
+ messagebox(['Following palette(s) ignored (associated file(s) no more exist):';
' '
rmpal(:,1)+': '+rmpal(:,2)
' '
- ' To avoid this message, please update the ""'+pwd()+filesep()+'.scicos_pal"" file'])
+ ' To avoid this message, please update the ""'+pwd()+filesep()+'.scicos_pal"" file'],"modal")
scicos_pal(toremove,:)=[];
end
endfunction
if Scicos_is_active then
- message(["You can run ONLY one Scicos demo at time.";..
+ messagebox(["You can run ONLY one Scicos demo at time.";..
"Please close any previous Scicos diagram";..
- "before choose a new demo. "]);
+ "before choose a new demo. "],"modal");
return
else
//** with no Scicos previous active, you can start Scicos
if scicos_ver <> current_version then
ierr = execstr('scs_m = do_version(scs_m, scicos_ver)','errcatch')
if ierr <> 0 then
- message("Can''t convert old diagram (problem in version)")
+ messagebox("Can''t convert old diagram (problem in version)","modal")
return
end
end
function AboutScicos_()
Cmenu=[] ; %pt=[];
- message([strsubst(get_scicos_version(),"scicos","Scicos -")+"-";...
+ messagebox([strsubst(get_scicos_version(),"scicos","Scicos -")+"-";...
"For more information visit:";...
- " www.scicos.org "]);
+ " www.scicos.org "],"modal");
endfunction
function AnalyzeDiagram_()
Cmenu = [] ;
if needcompile>0 then
- message("You must first compile the diagram.")
+ messagebox("You must first compile the diagram.","modal")
else
do_analyze_diagram(%cpr)
end
if curwin==%win then
scf(%win);
else
- message("Only current window can be edited.")
+ messagebox("Only current window can be edited.","modal")
end
[edited,options] = do_options(scs_m.props.options,"Background");
'%diagram_path_objective='+sci2exp(super_path)+';%scicos_navig=1';
'Cmenu='"Place in Browser'";%scicos_navig=[]'
] // not really needed to return anymore, may remove last line
-// message("Browser can only be launched from main diagram.") ;
+// messagebox("Browser can only be launched from main diagram.","modal") ;
end
endfunction
'ppprot=funcprot();funcprot(0);';
'ierr=execstr(''exec('''''+gui_path+''''');'',''errcatch'');';
'funcprot(ppprot);clear ppprot;';
- 'if ierr<> 0 then message(''Cannot load the '''''+gui_path+''''' file'');end';
+ 'if ierr<> 0 then messagebox(''Cannot load the '''''+gui_path+''''' file'',''modal'');end';
'%diagram_path_objective='+sci2exp(super_path)+';%scicos_navig=1;'
'Cmenu='"Replot'"']
else
//elseif scs_m.objs(i).model.dep_ut(2)==%t then
//check for time dependency PAS IICI
//ok=%f;%cpr=list()
- //message('a block have time dependence.')
+ //messagebox('a block have time dependence.','modal')
//return
elseif scs_m.objs(i).gui=='CLKOUTV_f' then
scs_m.objs(i).gui='EVTOUT_f';
if ~ok then
%cpr=list()
- message('Sorry: problem in the pre-compilation step.')
+ messagebox('Sorry: problem in the pre-compilation step.','modal')
return
end
ind = find(bllst(i).sim(1)==sim_to_be_removed(:,1))
if ind<>[] then
mess=mprintf("%s block is not allowed.\nIt will be not called.',sim_to_be_removed(ind,2))
- okk=message(mess,[_('Ok');_('Go Back')])
+ okk = messagebox(mess,[_('Ok');_('Go Back')],'modal')
if okk==1 then
bllst(i).sim(1)='bidon'
if type(bllst(i).sim(1))==13 then
elseif (clkptr(i+1)-clkptr(i))<>0 &funtyp(i)>-1 &funs(i)~='bidon' then
//Alan //msg=[msg;'Regular block generating activation not allowed yet']
end
- if msg<>[] then message(msg),ok=%f,return,end
+ if msg<>[] then messagebox(msg,'modal'),ok=%f,return,end
end
//********************************************************
end
%mprt=funcprot()
funcprot(0)
- deff('message(txt)',' ')
+ deff('messagebox(txt)',' ')
funcprot(%mprt)
in=0
for i=In_blocks'
if ~or(winsid()==%now_win) then
Cmenu="Quit",
txtedit.clos=1
- message('Diagram has been closed. That context is no more valid.')
+ messagebox('Diagram has been closed. That context is no more valid.','modal')
[rep,Quit] = scstxtedit(context,txtedit);
return,
end
//end of for backward compatibility for scifunc
if ierr <>0 then
- message(['Error occur when evaluating context:'
- lasterror() ]);
+ messagebox(['Error occur when evaluating context:';lasterror() ],'modal');
else //** if the first check is ok
scs_m_save = scs_m
if ok then
if needcompile<>4 & size(%cpr)>0 then %state0=%cpr.state, end
else
- message(['Error during Eval operation.';
- 'Please re-examine the content of the context.'])
+ messagebox(['Error during Eval operation.';
+ 'Please re-examine the content of the context.'],'modal')
scs_m=scs_m_save
scs_m.props.context = context;
enable_undo=%f
Select=[];
else
//** no object
- message(['No block is selected';
- 'click on a block or select a region first.'])
+ messagebox(['No block is selected';'click on a block or select a region first.'],'modal')
Cmenu=[]; %pt=[]; %ppt=[]
end
endfunction
if typeof(o)=='Block' then
if o.model.sim=='super' then
[o,needcompile,ok]=do_CreateAtomic(o,i,scs_m)
- if ~ok then message('Error in Creating Atomic');return ;end
+ if ~ok then messagebox('Error in Creating Atomic','modal');return ;end
scs_m = update_redraw_obj(scs_m,list('objs',i),o)
else
- message('Atomic can only be affected to Non Atomic Super Blocks.');
+ messagebox('Atomic can only be affected to Non Atomic Super Blocks.','modal');
end
else
- message('Atomic can only be affected to Non Atomic Super Blocks.');
+ messagebox('Atomic can only be affected to Non Atomic Super Blocks.','modal');
end
end
endfunction
K=find(Select(:,2)==curwin)
if K==[] then return,end
if size(K,'*')>1 then
- message("Create Mask applies to a single selected SuperBlock")
+ messagebox("Create Mask applies to a single selected SuperBlock",'modal')
return
end
gh_axes=gca()
update_gr(gh_k,o)
drawnow();
else
- message("Mask can only be created for Super Blocks.")
+ messagebox("Mask can only be created for Super Blocks.",'modal')
end
else
- message("Mask can only be created for Super Blocks.")
+ messagebox("Mask can only be created for Super Blocks.",'modal')
end
endfunction
end
kc=find(%win==windows(:,2))
if kc==[] then
- message('This window is not an active scicos window')
+ messagebox('This window is not an active scicos window','modal')
%pt=[];return
elseif windows(kc,1)<0 then //click dans une palette
kpal=-windows(kc,1)
elseif slevel>1 then
execstr('k=getobj(scs_m_'+string(windows(kc,1))+',%pt)')
else
- message('This window is not an active scicos window')
+ messagebox('This window is not an active scicos window','modal')
%pt=[];return
end
edited=%t
end
else
- message('This block is not masked.')
+ messagebox('This block is not masked.','modal')
end
else
- message('Select a block.')
+ messagebox('Select a block.','modal')
end
endfunction
if needcompile<>4&size(%cpr)>0 then %state0=%cpr.state,end
alreadyran=%f
else
- message(['Incorrect context definition, ';lasterror()] )
+ messagebox(['Incorrect context definition, ';lasterror()],'modal' )
end
endfunction
compile_modelica(scs_m.props.title(2)+name+'.mo')
Cmenu=[]
else
- message('Generation Code only work for a Superblock ! ')
+ messagebox('Generation Code only work for a Superblock ! ','modal')
break
end
end
%r = 2 ; //** preload the default answer
if edited then
- %r = message(["Diagram has not been saved";
- "Are you sure you want to proceed ?"],['No';'Yes'])
+ %r = messagebox(["Diagram has not been saved";
+ "Are you sure you want to proceed ?"],'modal',['No';'Yes'])
else
%r = 2 ;
end //** No -> %r = 1 ; Yes -> %r = 2
end
end
if ierr<>0 then
- message(['This window is not active anymore or';
- 'the browser is not up-to-date.'])
+ messagebox(['This window is not active anymore or';
+ 'the browser is not up-to-date.'],'modal')
%scicos_navig=[] // stop navigation
Scicos_commands=[]
Cmenu=[];%pt=[]
//** end of for backward compatibility for scifunc
if ierr<>0 then
- message(["Error occur when evaluating context:" lasterror()])
+ messagebox(["Error occur when evaluating context:" lasterror()],'modal')
else
deff('%fonct()',scs_m.props.context)
%outfun = macrovar(%fonct);
tt = "No"
end
- rep1 = message(["Use orthogonal links?" ; "current choice is " + tt], ["Yes" ; "No"])
+ rep1 = messagebox(["Use orthogonal links?" ; "current choice is " + tt], 'modal', ["Yes" ; "No"])
if rep1==1 then
SL_mode = 1;
scicos_pal = scicos_palnew
if execstr('save(''.scicos_pal'',scicos_pal)','errcatch')<>0 then
- message('Cannot save .scicos_pal in current directory')
+ messagebox('Cannot save .scicos_pal in current directory','modal')
end
end
//** Verify window and last mouse "click" position
if %win<>curwin then
- message(["Paste operation is not possible in this window"]);
+ messagebox(["Paste operation is not possible in this window"],'modal');
Cmenu = []; %pt = []; %ppt = [] ;
return
end
end
else
- message(["Paste -> Source / Destination incompatible"]);
+ messagebox(["Paste -> Source / Destination incompatible"],'modal');
Cmenu=[]; %pt = []; %ppt = [] ; return ; //** EXIT point
end
//**------------------ Multiple object selected ---------------
if kc==[] then
//** ------------- It's NOT a Scicos window -------------------
- message("This window is not an active scicos window")
+ messagebox("This window is not an active scicos window",'modal')
Cmenu = []; %pt=[]; %ppt=[]; Select=[] ;
scf(gh_winback); //** restore the active window
return ; //** ---> Exit point
//** read only operation
else
//**---- ... in any other case -------------------------------
- message("This window is not an active scicos window")
+ messagebox("This window is not an active scicos window",'modal')
Cmenu=[]; %pt=[]; %ppt=[]; Select=[];
scf(gh_winback); //** restore the active window
return ; //** ---> Exit point
//**------------------- Zero or one single object selected by pop up ------------
if kc==[] then
//** ------------- It's NOT a Scicos window -------------------
- message("This window is not an active scicos window")
+ messagebox("This window is not an active scicos window",'modal')
Cmenu = []; %pt=[]; %ppt=[]; Select=[] ;
scf(gh_winback); //** restore the active window
return ; //** ---> Exit point
else
//**---- ... in any other case -------------------------------
- message("This window is not an active scicos window")
+ messagebox("This window is not an active scicos window",'model')
Cmenu=[]; %pt=[]; %ppt=[]; Select=[];
scf(gh_winback); //** restore the active window
return ; //** ---> Exit point
i=Select(1)
o=scs_m.objs(i)
[o,needcompile,ok]=do_RemoveAtomic(o)
-if ~ok then message('Error in removing atomic');return; end
+if ~ok then messagebox('Error in removing atomic','modal');return; end
scs_m = update_redraw_obj(scs_m,list('objs',i),o)
end
endfunction
enable_undo = %t
edited=%t
else
- message('This block is not masked.')
+ messagebox('This block is not masked.','modal')
end
else
- message('Select a block.')
+ messagebox('Select a block.','modal')
end
endfunction
// -fix a bug un case there are selected objects in other windows
K=find(Select(:,2)==curwin)
if size(K,'*')<>1 then
- message('Select one and only one block in the current window.')
+ messagebox('Select one and only one block in the current window.','modal')
Cmenu=[]
return
else
else
Cmenu=[]
if scs_m.objs(Select(K,1)).gui<>'DSUPER' then
- message('Only Masked blocks can be saved.')
+ messagebox('Only Masked blocks can be saved.','modal')
else
fname=do_saveblockgui(scs_m.objs(Select(K,1)))
if fname<>emptystr() then
case 'sci' then
ok=%t
else
- message('Only *.sci files allowed');
+ messagebox('Only *.sci files allowed','modal');
ok = %f
end
else
if %path<>[] then
if execstr('getf(%path)','errcatch')<>0 then
- message([name+': error:'
- lasterror()])
+ messagebox([name+': error:'
+ lasterror()],'modal')
end
end
end
pal_mode = %t
ierr=execstr('blk_tmp=PAL_f(''define'')','errcatch')
if ierr<>0 then
- message('Block palette not found.')
+ messagebox('Block palette not found.','modal')
clear numk
return
end
function ScicosDocumentation_()
if execstr('help(''scicos'');' , 'errcatch') <>0 then
- message("No help available.");
+ messagebox("No help available.",'modal');
end
//** Clear state machine variables
//** case 0 : is not an active SCICOS window
if kc==[] then
//** This message has been suppressed : have a good day :)
- //** message("1 - This window is not an active scicos window");
+ //** messagebox("1 - This window is not an active scicos window","modal");
Cmenu=[]; %pt=[]; return
//** case : kc index a "negative" windows id --> the user has clicked in a palette window
//** case : This window is not an active scicos window
else
- message('2 - This window is not an active scicos window')
+ messagebox('2 - This window is not an active scicos window','modal')
Cmenu=[];%pt=[];return
end
kc = find(%win==windows(:,2))
if kc==[] then
- message("This window is not an active palette");
+ messagebox("This window is not an active palette",'modal');
return ; //** Exit point
elseif windows(kc,1)<0 then //click inside a palette window
if txt<>[] then
if txt<>emptystr() then txt=part(txt(1),1);end
if find(txt==%scicos_short(:,1))<>[] then
- message(txt+_(' is already in use for ')+..
- %scicos_short( find(txt==%scicos_short(:,1)),2))
+ messagebox(txt+_(' is already in use for ')+ ..
+ %scicos_short( find(txt==%scicos_short(:,1)),2), 'modal')
elseif txt==emptystr() then
%scicos_short=[%scicos_short(1:%koko-1,:);
%scicos_short(%koko+1:$,:)];%okay=%t;
elseif (ascii(txt)>122|ascii(txt)<97)&(ascii(txt)>90|ascii(txt)<65) then
- message(txt+_(' is not a letter'))
+ messagebox(txt+_(' is not a letter'), 'modal')
else
%scicos_short(%koko,1)=txt;%okay=%t;
end
if txt<>[] then
txt=part(txt(1),1)
if find(txt==%scicos_short(:,1))<>[] then
- message(txt+_(' is already in use for ')+..
- %scicos_short( find(txt==%scicos_short(:,1)),2))
+ messagebox(txt+_(' is already in use for ')+..
+ %scicos_short( find(txt==%scicos_short(:,1)),2) ,'modal')
elseif (ascii(txt)>122|ascii(txt)<97)&(ascii(txt)>90|ascii(txt)<65) then
- message(txt+_(' is not a letter'))
+ messagebox(txt+_(' is not a letter'),'modal')
else
%scicos_short=[%scicos_short;..
[part(txt(1),1),%cor_item_exec(%koko,1)]];
end
if %okay then
if execstr('save(''.scicos_short'',%scicos_short)','errcatch') <>0 then
- message(msprintf(_('Cannot save ""%s"" in current directory'),'.scicos_short'))
+ messagebox(msprintf(_('Cannot save ""%s"" in current directory'),'.scicos_short'),'modal')
end
%tableau=emptystr([1:100]);
for %Y=1:size(%scicos_short,1)
if enable_undo==2 then // open SB's may have been affected
%r=2
- %r=message(['Undo operation undoes changes in a subdiagram';
- 'These changes will be lost for ever'],['Proceed'; ...
+ %r=messagebox(['Undo operation undoes changes in a subdiagram';
+ 'These changes will be lost for ever'], 'modal', ['Proceed'; ...
'Cancel'])
if %r==2 then
return,
Cmenu='Replot'
enable_undo = %f ; //** "Undo" is a single level function
else
- message('No more undo available.')
+ messagebox('No more undo available.','modal')
end
endfunction
'xselect()'
]
else
- message('This is already the main diagram;')
+ messagebox('This is already the main diagram;','modal')
end
endfunction
if ok then return, end //if ok then exit adjust
end
//if failed then display message and set flag ok to false
- message(['Not enough information to determine port sizes';
- 'Compile the diagram before running.']);
+ messagebox(['Not enough information to determine port sizes';
+ 'Compile the diagram before running.'],"modal");
ok=%f
endfunction
[bllst,connectmat,clkconnect,cor,corinv,ok]=c_pass1(scs_m_temporary);
if ~ok then
- message('The pre-compilation has failed; the scs_m will not be adjust');
+ messagebox('The pre-compilation has failed; the scs_m will not be adjust',"modal");
ok=%f;
end
cin,cout,...
in_implicit,out_implicit)
else
- message(mess)
+ messagebox(mess,"modal")
end
if ok then
case 'OUT_f' then
nb=nb-1
else
- message('Non linear systems are not implemented yet')
+ messagebox('Non linear systems are not implemented yet','modal')
syst(nb)=list('transfer',o.gui_name)
corresp(k)=nb
end
//** hilite_obj(scs_m.objs(path_out)); //**
hilite_obj(path_out); //** new
if typ==0 then
- message(['Hilited block has connected ports ';
- 'with incompatible sizes'])
+ messagebox(['Hilited block has connected ports ';'with incompatible sizes'],"modal")
else
- message(['Hilited block has connected ports ';
- 'with incompatible types'])
+ messagebox(['Hilited block has connected ports ';'with incompatible types'],"modal")
end
unhilite_obj(path_out); //** new
return;
end
if typ==0 then
- message(['Hilited block(s) have connected ports ';
+ messagebox(['Hilited block(s) have connected ports ';
'with incompatible sizes';
' output port '+string(prt_out)+' size is :'+sci2exp(nout);
- ' input port '+string(prt_in)+' size is :'+sci2exp(nin)]);
+ ' input port '+string(prt_in)+' size is :'+sci2exp(nin)],"modal");
else
- message(['Hilited block(s) have connected ports ';
+ messagebox(['Hilited block(s) have connected ports ';
'with incompatible type';
' output port '+string(prt_out)+' type is :'+sci2exp(outtyp);
- ' input port '+string(prt_in)+' type is :'+sci2exp(intyp)]);
+ ' input port '+string(prt_in)+' type is :'+sci2exp(intyp)],"modal");
end
unhilite_obj(path_out);
end
//*****************************************
if typ==0 then
- message(['Hilited block(s) have connected ports ';
+ messagebox(['Hilited block(s) have connected ports ';
'with incompatible sizes';
string(prt_out)+' output port size is :'+sci2exp(nout);
- string(prt_in)+' input port size is :'+sci2exp(nin)]);
+ string(prt_in)+' input port size is :'+sci2exp(nin)],"modal");
else
- message(['Hilited block(s) have connected ports ';
+ messagebox(['Hilited block(s) have connected ports ';
'with incompatible type';
' output port '+string(prt_out)+' type is :'+sci2exp(outtyp);
- ' input port '+string(prt_in)+' type is :'+sci2exp(intyp)]);
+ ' input port '+string(prt_in)+' type is :'+sci2exp(intyp)],"modal");
end
for k=size(path,'*'):-1:1
//** select the mxwin+k window and get the handle
else // connected links do not verify block contraints
mess=prt_out;
if type(path_out)==15 then //problem with implicit block
- message('Problem with the block generated from modelica blocks')
+ messagebox('Problem with the block generated from modelica blocks','modal')
else
path=path_out(1:$-1) // superbloc path
path_out=path_out($) // block number
if path==[] then
//** hilite_obj(scs_m.objs(path_out)) ;//** set
hilite_obj(path_out) ;//** set
- message(mess)
+ messagebox(mess,'modal')
//** hilite_obj(scs_m.objs(path_out)) //** clear
unhilite_obj(path_out) ;
else
end
//** hilite_obj(scs_m.objs(path_out)) //**
hilite_obj(path_out) ; //**
- message(mess)
+ messagebox(mess,'modal')
for k=size(path,'*'):-1:1
//**WARNING: xdel(mxwin+k) //** delete (mxwin+k) graphic window
//** select the mxwin+k window and get the handle
if exists('%scicos_solver')==0 then %scicos_solver=0,end
if max(funtyp)>10000 &%scicos_solver==0 then
- message(['Diagram contains Implicit blocks,'
- 'Compiling for implicit Solver'])
+ messagebox(['Diagram contains Implicit blocks,'
+ 'Compiling for implicit Solver'],'modal')
%scicos_solver=100
end
clkin=int(clkin(:));nclkin=size(clkin,1);
if nclkin>0 then
if mini(clkin)<1 then
- message('Event input ports sizes must be positive')
+ messagebox('Event input ports sizes must be positive','modal')
ok=%f
return
end
clkout=int(clkout(:));nclkout=size(clkout,1);
if nclkout>0 then
if mini(clkout)<1 then
- message('Event output ports sizes must be positive')
+ messagebox('Event output ports sizes must be positive','modal')
ok=%f
return
end
n1=size(in1(:,1),'*');n=size(in(:,1),'*')
if n1>n then
if or(ip1(n+1:$)>0) then
- message('Connected ports cannot be suppressed')
+ messagebox('Connected ports cannot be suppressed','modal')
ok=%f
return
end
n1=size(out1,'*');n=size(out,'*')
if n1>n then
if or(op1(n+1:$)>0) then
- message('Connected ports cannot be suppressed')
+ messagebox('Connected ports cannot be suppressed','messagebox')
ok=%f
return
end
n1=size(clkin1,'*');n=size(clkin,'*')
if n1>n then
if or(cip1(n+1:$)>0) then
- message('Connected ports cannot be suppressed')
+ messagebox('Connected ports cannot be suppressed','modal')
ok=%f
return
end
n1=size(clkout1,'*');n=size(clkout,'*')
if n1>n then
if or(cop1(n+1:$)>0) then
- message('Connected ports cannot be suppressed')
+ messagebox('Connected ports cannot be suppressed','modal')
ok=%f
return
end
k=find(ip1<>0) //connected links
k=k(find(k<=kk));
if or(graphics.in_implicit(k)<>in_impl(k)) then
- message('Connected ports types cannot be changed')
+ messagebox('Connected ports types cannot be changed','modal')
ok=%f
return
end
k=find(op1<>0) //connected links
k=k(find(k<=kk));
if or(graphics.out_implicit(k)<>out_impl(k)) then
- message('Connected ports types cannot be changed')
+ messagebox('Connected ports types cannot be changed','modal')
ok=%f
return
end
//errcatch doesnt work poperly
ok=%t
if execstr('comp(mac)','errcatch')<>0 then
- message(['Incorrect syntax: ';
- lasterror()])
+ messagebox(['Incorrect syntax: ';lasterror()],'modal')
ok=%f
end
endfunction
end
//**-------------------- atomic superblock (asuper) -----------------------------
elseif (o.model.sim(1)=="asuper") then
- message(['This is an atomic superblock';..
- 'To edite it, you must first remove the atomicity']);
+ messagebox(['This is an atomic superblock';..
+ 'To edite it, you must first remove the atomicity'],'modal');
//**--------------------- Standard block -------------------------------
else
//** hilite entities k
hilite_obj(k)
//** display an error message
- message(['Hilited block(s) or link(s) are ignored because of'
- 'undefined input(s)'])
+ messagebox(['Hilited block(s) or link(s) are ignored because of'
+ 'undefined input(s)'],'modal')
//** unhilite entities k
unhilite_obj(k)
end
XX = o;
[params,param_types]=FindSBParams(model.rpar,[])
if params<>[] then
- message('The parameter ""'+params+'"" must be defined in the context of the atomic super block.')
+ messagebox('The parameter ""'+params+'"" must be defined in the context of the atomic super block.',"modal")
return;
end
ALL=%f;
if ~ok then return; end
if freof <> [] then
- message('An Atomic Superblock cannot contain sample clocks')
+ messagebox('An Atomic Superblock cannot contain sample clocks','modal')
return
end
needcompile=4;
// needcompile=resume(needcompile)
else
- message('Remove Atomic can only be affected to Atomic Super Blocks.');ok=%f; return
+ messagebox('Remove Atomic can only be affected to Atomic Super Blocks.','modal');ok=%f; return
end
else
- message('Remove Atomic can only be affected to Atomic Super Blocks.');ok=%f; return
+ messagebox('Remove Atomic can only be affected to Atomic Super Blocks.','modal');ok=%f; return
end
endfunction
\ No newline at end of file
ok = %t
frmt = 'xmlformatted'
else
- message("Only *.cos binary or cosf ascii files allowed");
+ messagebox("Only *.cos binary or cosf ascii files allowed",'modal');
return //** EXIT Point
end
[u,err] = mopen(fname,'wb')
end
if err<>0 then
- message("File or directory write access denied")
+ messagebox("File or directory write access denied",'modal')
return
end
elseif ext=="xml" then
[ok,t]=cos2xml(scs_m,'',%f)
if ~ok then
- message("Error in xml format")
+ messagebox("Error in xml format",'modal')
file('close',u)
return
end
ierr = cos2cosf(u,do_purge(scs_m));
if ierr<>0 then
- message("Directory write access denied")
+ messagebox("Directory write access denied",'modal')
file('close',u) ;
return
end
name = stripblanks(name);
if name==emptystr() then
- message("No block name specified");
+ messagebox("No block name specified",'modal');
return
end ; //** --> Exit point
if to_get then // try to get it
- message(['Problem loading block '+name+'.';
- 'Use Activate_Scilab_Window and redefine it in Scilab.'] ) ;
+ messagebox(['Problem loading block '+name+'.';
+ 'Use Activate_Scilab_Window and redefine it in Scilab.'], 'modal' ) ;
return;
//path = name+'.sci'
//if length(path)<=0 then return,end
//[u,err]=file('open',path,'old','formatted')
//if err<>0 then
- // message(path+' file, Not found')
+ // messagebox(path+' file, Not found','modal')
// return
//end
//if execstr('getf(u)','errcatch')<>0 then
// file('close',u)
- // message([name + " erroneous function:"; lasterror()])
+ // messagebox([name + " erroneous function:"; lasterror()],'modal')
// return
//end
//file('close',u)
//define the block
ierror = execstr('blk='+name+'(''define'')','errcatch')
if ierror <>0 & ierror <>4 then
- message([ "Error in GUI function"; lasterror() ])
+ messagebox([ "Error in GUI function"; lasterror() ],'modal')
fct = [] ;
return
end
if ierror == 4 then
- irr=message(['Error in GUI function--The error was:';
+ irr = messagebox(['Error in GUI function--The error was:';
lasterror();'It could be an old GUI';
- 'Should I try to translate (no guarantee)?'],['yes','no'])
+ 'Should I try to translate (no guarantee)?'],'modal',['yes','no'])
if irr==2 then
ierror=execstr('blk='+name+'(''define'')','errcatch')
if ierror <>0 then
- message("Translation did not work, sorry")
+ messagebox("Translation did not work, sorry","modal")
fct=[]
return
end
ierror = execstr('blk=up_to_date(blk)','errcatch');
if ierror <>0 then
- message("Translation did not work, sorry")
+ messagebox("Translation did not work, sorry","modal")
fct=[]
return
end
[ierr,scicos_ver,scs_m_super]=update_version(scs_m_super)
if ierr<>0 then
- message("Can''t import block in scicos, sorry (problem in version)")
+ messagebox("Can''t import block in scicos, sorry (problem in version)","modal")
fct=[]
return
end
//**------ R@min's update ---------/////////////
[u,err]=file('open',TMPDIR+'/'+name+'.sci','unknown')
if err<>0 then
- message('The file '+TMPDIR+'/'+name+'.sci'+' cannot be opened.')
+ messagebox('The file '+TMPDIR+'/'+name+'.sci'+' cannot be opened.',"modal")
return
end
];
ierr=execstr('write(u,Txte,''(a)'')','errcatch','n')
if ierr<>0 then
- message('Impossible to write in '+TMPDIR+'/'+name+'.sci'+'; possibly locked.')
+ messagebox('Impossible to write in '+TMPDIR+'/'+name+'.sci'+'; possibly locked.','modal')
file('close',u)
return
end
//**-------------------------------/////////////
end
nam_file=strcat([name,name+'_new']+'.sci',' ')
- message(["Old csuper/super block have been detected !";
+ messagebox(["Old csuper/super block have been detected !";
"New interfacing functions "+nam_file;
" have been re-generated in "+TMPDIR+".";
"Please save and edit the generated file at your convenience";
- "to have an updated interfacing function of that block."])
+ "to have an updated interfacing function of that block."],"modal")
end
end
//**------------------------------------/////////////
K=find(Select(:,2)==%win)
if K==[] then return, end //** if no selected object in current window--> EXIT
if size(K,'*')>1 then
- message("Only one block can be selected in current window for this operation.") ;
+ messagebox("Only one block can be selected in current window for this operation.","modal") ;
return ; //** EXIT
end
if typeof(scs_m.objs(K))<>'Block' then
- message("Icon menu applies only to blocks.") ;
+ messagebox("Icon menu applies only to blocks.","modal") ;
return,
end
%pt=[]
//** Object selected
if size(Select,1)>1 then
- message("Only one block can be selected for this operation.")
+ messagebox("Only one block can be selected for this operation.","modal")
Cmenu=[]; %pt=[]; return
end
IN=-sort(-IN);
if or(IN<>[1:size(IN,'*')]) then
ok=%f;%cpr=list()
- message("Input ports are not numbered properly.")
+ messagebox("Input ports are not numbered properly.","modal")
return
end
OUT=-sort(-OUT);
if or(OUT<>[1:size(OUT,'*')]) then
ok=%f;%cpr=list()
- message("Output ports are not numbered properly.")
+ messagebox("Output ports are not numbered properly.","modal")
return
end
//** --------------------------- in all the other possibles cases -----------------------
else
- message("This object can''t be deleted");
+ messagebox("This object can''t be deleted","modal");
end //** link / Block / Text / Deleted / other...
elseif typ=='Deleted' then
//**-------------------------------- U.F.O. ----------------------------------------
else
- message('This object can''t be deleted')
+ messagebox('This object can''t be deleted','modal')
end
end
if Select==[] then // nothing selected return details on current diagram
o = scs_m;
elseif size(Select,1)>1 then
- message(_("Multiple selection cannot be used here"))
+ messagebox(_("Multiple selection cannot be used here"),"modal")
return
else //a single object is selected
cwin = Select(1,2)
if kc==[] then
//** -----> It is NOT a Scicos window
- message("This window is not an active palette");
+ messagebox("This window is not an active palette","modal");
k=[]; //** this means that not valid objet was found; used as flag for the rest of the code
//** -----> It is a PALETTE window
end
else // in all the other cases
- message("This window is not an active palette")
+ messagebox("This window is not an active palette","modal")
k=[];
end //** end of the filter on windows
n=strindex(txtnew(i),'.cosf')
if n=[] then n=strindex(txtnew(i),'.cos');end
if n=[] then
- message('All files must end with .cos or .cosf')
+ messagebox('All files must end with .cos or .cosf','modal')
scicos_palnew=[]
ld=%f;break
end
n=strindex(txtnew(i),'.cosf')
if n==[] then n=strindex(txtnew(i),'.cos');end
if n==[] then
- message('All files must end with .cos or .cosf')
+ messagebox('All files must end with .cos or .cosf','modal')
scicos_palnew=[]
break
end
%mprt=funcprot()
funcprot(0)
getvalue=setvalue;
-deff('message(txt)',['messagebox(''In block ''+o.gui+'': ''+txt,''Warning'',''info'',''modal'');'
+deff('scicosmessage(txt)',['messagebox(''In block ''+o.gui+'': ''+txt,''Warning'',''info'',''modal'');'
'global %scicos_prob;'
'%scicos_prob=resume(%t)'])
[scicos_context1,ierr]=script2var(context,%scicos_context)
if ierr <>0 then
%now_win=xget('window')
- message(['Cannot evaluate a context';lasterror()])
+ scicosmessage(['Cannot evaluate a context';lasterror()])
xset('window',%now_win)
else
[sblock,%w,needcompile2,ok]=do_eval(sblock,list(),scicos_context1)
end
end
- message(mess); //** show the message
+ messagebox(mess,'modal'); //** show the message
end
K=Select(:,1)';%pt=[];
end
if size(K,'*')>1|%win<>Select(1,2) then
- message(_("Only one block can be selected in current window for this operation."))
+ messagebox(_("Only one block can be selected in current window for this operation."),'modal')
Cmenu=[];%pt=[];return
end
//instr=strsubst(gr_i(1),'xstringb','xstringb3')
instr=gr_i(1)
if execstr(instr,"errcatch")<>0 then
- message(msprintf(_("The current icon depends on block parameter\n"+..
+ messagebox(msprintf(_("The current icon depends on block parameter\n"+..
"part of the icon cannot be imported here\n"+..
- "Use icon menu to check the content")))
+ "Use icon menu to check the content")),'modal')
end
clearfun('xstringb3')
///remove unused default menus
//** Filter out the "mutiple object selected" case
if size(k,'*')>1 | %win<>Select(1,2) then
- message("Only one block can be selected in current window for this operation.")
+ messagebox("Only one block can be selected in current window for this operation.","modal")
Cmenu=[]; %pt=[]; return
end
end
else
//** It is NOT a Block AND it is NOT a Link: for any other object type
- message("It is impossible to set ID for this type of object")
+ messagebox("It is impossible to set ID for this type of object",'modal')
end
//
else
K=Select(:,1)';%pt=[]
if size(K,'*')>1 | curwin<>Select(1,2) then
- message("Only one block can be selected in current window for this o"+...
- "peration.")
+ messagebox("Only one block can be selected in current window for this operation.","modal")
Cmenu=[];return
end
end
o = scs_m.objs(K)
// avoid error with links
if typeof(o)<>'Block' then
- message("No label can be placed on Links.")
+ messagebox("No label can be placed on Links.","modal")
return,
end
model = o.model
//check extensions
ext=convstr(ext)
if and(ext<>['cos','cosf','xml']) then
- message(_('Only *.cos (binary), *.cosf or *.xml (formatted) files\n'+..
- 'are allowed'))
+ messagebox(_('Only *.cos (binary), *.cosf or *.xml (formatted) files\n'+'are allowed'),'modal')
if file_is_given then
//open an empty diagram
scs_m = get_new_scs_m();
stacksize(2*x(1))
end
else
- message(msprintf(_('%s file cannot be loaded.\nOpening a new empty diagram'),fname))
+ messagebox(msprintf(_('%s file cannot be loaded.\nOpening a new empty diagram'),fname),'modal')
ext='new'
end
if ierr<>0 then
if ext=='xml' then
- message(msprintf(_('An error has occured during parsing of file %s.\n'+..
- 'Please check the format of your XML file\n'),fname))
+ messagebox(msprintf(_('An error has occured during parsing of file %s.\n'+..
+ 'Please check the format of your XML file\n'),fname),'modal')
else
- message(msprintf(_('An error has occured during loading of file %s.\n'),fname))
+ messagebox(msprintf(_('An error has occured during loading of file %s.\n'),fname),'modal')
end
ok=%f
scs_m=get_new_scs_m();
//##update version
[ierr,scicos_ver,scs_m]=update_version(scs_m)
if ierr<>0 then
- message('An error has occured during the update of '+name+'.')
+ messagebox('An error has occured during the update of '+name+'.', 'modal')
ok=%f
scs_m = get_new_scs_m();
//scs_m=scicos_diagram(version=current_version)
%mprt=funcprot()
funcprot(0)
getvalue=setvalue;
-deff('message(txt)',['messagebox(''In block ''+o.gui+'': ''+txt,''Warning'',''info'',''modal'');'
+deff('scicosmessage(txt)',['messagebox(''In block ''+o.gui+'': ''+txt,''Warning'',''info'',''modal'');'
'global %scicos_prob;'
'%scicos_prob=resume(%t)'])
with3d = With3D
end
if with3d then tt = "Yes", else tt = "No", end
- rep1 = message(["Use 3D aspect?" ; "current choice is " + tt], ["Yes" ; "No"])
+ rep1 = messagebox(["Use 3D aspect?" ; "current choice is " + tt], 'modal', ["Yes" ; "No"])
if rep1 <> 1 then rep1 = 0, end
if rep1 then
reg = list(); rect = []
kc = find (win==windows(:,2) )
if kc==[] then
- message('This window is not an active palette') ;
+ messagebox('This window is not an active palette','modal') ;
return ; //** ---> Exit point
elseif windows(kc,1)<0 then // click inside a palette window
kpal = -windows(kc,1) ;
elseif slevel>1 then
execstr('scs_m=scs_m_'+string(windows(kc,1))) ;
else
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
return ;
end
drawnow(); //** this calling look unuseful
K = Select(:,1)';
%pt = [] ;
if size(K,'*')>1 | %win<>Select(1,2) then
- message("Only one block can be selected in current window for this operation.")
+ messagebox("Only one block can be selected in current window for this operation.",'modal')
Cmenu=[]; %pt=[]; return ; //** ---> EXIT
end
end
else
//** nor Block nor Link
- message("Resize is allowed only for Blocks or Links.")
+ messagebox("Resize is allowed only for Blocks or Links.",'modal')
end
else
//** switch appropriate solver
if %cpr.sim.xptr($)-1<size(%cpr.state.x,'*') & solver<100 then
- message(['Diagram has been compiled for implicit solver'
- 'switching to implicit Solver'])
+ messagebox(['Diagram has been compiled for implicit solver'
+ 'switching to implicit Solver'],'modal')
solver=100
tolerances(6)=solver
elseif (%cpr.sim.xptr($)-1==size(%cpr.state.x,'*')) & ..
(solver==100 & size(%cpr.state.x,'*')<>0) then
- message(['Diagram has been compiled for explicit solver'
- 'switching to explicit Solver'])
+ messagebox(['Diagram has been compiled for explicit solver'
+ 'switching to explicit Solver'],'modal')
solver=0
tolerances(6)=solver
end
global Scicos_commands
Scicos_commands=cmd;
else //** simulator error
- message(['End problem:';str_err])
+ messagebox(['End problem:';str_err],'modal')
scf(curwin);
end
ok=%f
global Scicos_commands
Scicos_commands=cmd;
else //** simulator error
- message(['End problem:';str_err])
+ messagebox(['End problem:';str_err],'modal')
scf(curwin);
end
end
Scicos_commands=cmd;
else //** simulateur error
- message(['Simulation problem:';str_err])
+ messagebox(['Simulation problem:';str_err],'modal')
scf(curwin);
end
ok=%f
[u,err] = mopen(fname,'wb') ;
if err<>0 then
- message("Directory write access denied") ;
+ messagebox("Directory write access denied",'modal') ;
ok = %f;
return ;
end
// save
if execstr('save(u,scs_m,%cpr)','errcatch')<>0 then
- message(["Save error:";lasterror()]) ;
+ messagebox(["Save error:";lasterror()],'modal') ;
ok = %f ;
mclose(u) ;
return ;
[u,err]=file('open',fname,'unknown')
if err<>0 then
- message(path+': Directory or file write access denied')
+ messagebox(path+': Directory or file write access denied','modal')
return
end
' break'
' end'
' else'
- ' message(lasterror())'
+ ' messagebox(lasterror(),''modal'')'
' ok=%f'
' end'
' end']
ierr=execstr('write(u,txt,''(a)'')','errcatch','n')
if ierr<>0 then
- message('Impossible to write in this file; possibly locked.')
+ messagebox('Impossible to write in this file; possibly locked.','modal')
file('close',u)
fname=emptystr()
end
'CLKOUT_f'
'INIMPL_f'
'OUTIMPL_f']) then
- message('Input/Output ports are not allowed in the region.')
+ messagebox('Input/Output ports are not allowed in the region.','modal')
return ; //** Exit point !
end //** check block type
[string([tf;scale;atol;rtol;ttol;deltat;solver;hmax])])
if ~ok then break,end
if or([tf,atol,rtol,ttol,deltat]<=0) then
- message('Parameter must be positive')
+ messagebox('Parameter must be positive','modal')
else
wpar.tol=[atol;rtol;ttol;deltat;scale;solver;hmax]
wpar.tf=tf
if type(path)==15 then //** modelica block
spec_err='The modelica block returns the error :';
- message([title_err;spec_err;str_err]);
+ messagebox([title_err;spec_err;str_err],'modal');
else //** all other type of blocks
obj_path=path(1:$-1)
[title_err;spec_err;str_err],0,1,0,-1,0,1)
end
else//** simulateur error
- message(['End problem:';str_err])
+ messagebox(['End problem:';str_err],'modal')
end
end
//**---------------------------------
end
end
if obsolete then
- message(['Diagram contains obsolete signed blocks sum'
+ messagebox(['Diagram contains obsolete signed blocks sum'
'They are drawn in brown, they work as before but,'
- 'please replace them with the new block sum'])
+ 'please replace them with the new block sum'],'modal')
end
endfunction
//** Block rotation end
if ierr<>0 then
- message(['Problem loading block '+o.gui'; lasterror();
- 'Use Activate_Scilab_Window and redefine it in Scilab.'] ) ;
+ messagebox(['Problem loading block '+o.gui'; lasterror();
+ 'Use Activate_Scilab_Window and redefine it in Scilab.'],'modal' ) ;
gh_blk = [];
end
for k=1:size(blklst)
o=blklst(k);
if and(getfield(1,o)<>'equations')
- message('block numbered '+string(k)+' is not a Modelica block')
+ messagebox('block numbered '+string(k)+' is not a Modelica block','modal')
txt=[]
return
end
if typeof(o.equations)<>'modelica' then
- message('block numbered '+string(k)+' is not a Modelica block')
+ messagebox('block numbered '+string(k)+' is not a Modelica block','modal')
txt=[]
return
end
if ~and(w) then
k1=find(~w)
w=[];for k=1:size(k1,'*'),w=[w;'y'+string(k)+' (size: '+string(out(k))+')'],end
- message('You did not define '+strcat(w,',')+' !')
+ messagebox('You did not define '+strcat(w,',')+' !','modal')
else
break
end
if or(vars(5)=='xd') then
break,
else
- message('You did not define xd !')
+ messagebox('You did not define xd !','modal')
end
end
end
if ~and(w) then
k1=find(~w)
w=[];for k=1:size(k1,'*'),w=[w;'y'+string(k)+' (size: '+string(out(k))+')'],end
- message('You did not define '+strcat(w,',')+' !')
+ messagebox('You did not define '+strcat(w,',')+' !','modal')
else
break
end
if or(vars(5)=='xd') then
break,
else
- message('You did not define xd !')
+ messagebox('You did not define xd !','modal')
end
end
end
if strindex(libss,'''')<>[] | strindex(libss,'""')<>[] then
ierr=execstr('libss=evstr(libss)','errcatch')
if ierr<>0 then
- message(['Can''t solve other files to link'])
+ messagebox(['Can''t solve other files to link'],"modal")
chdir(cur_wd);
ok=%f;
end
for i=1:size(libss,'*')
lib_dll=libss(i) + getdynlibext();
ifexst=fileinfo(lib_dll)
- if ifexst==[] then message ('the library '+lib_dll+' doesn''t exists');ok=%f;end
+ if ifexst==[] then messagebox ('the library '+lib_dll+' doesn''t exists','modal');ok=%f;end
end
end
chdir(cur_wd);
spec_err='The modelica block returns the error :';
//** create cmd
- cmd=['message(['''+title_err+''';'+...
+ cmd=['messagebox(['''+title_err+''';'+...
''''+spec_err+''';'+...
- strcat(''''+mess_err+'''',";")+']);']
+ strcat(''''+mess_err+'''',";")+'],''modal'');']
//** ************************
//** all other type of blocks
//** create cmd
cmd=['%diagram_path_objective='+sci2exp(obj_path)+';%scicos_navig=1;'
'hilite_obj('+string(blk)+');'+...
- 'message(['''+title_err+''';'+...
+ 'messagebox(['''+title_err+''';'+...
''''+spec_err+''';'+...
- strcat(''''+mess_err+'''',";")+']);'+...
+ strcat(''''+mess_err+'''',";")+'],''modal'');'+...
'unhilite_obj('+string(blk)+');']
end
[ox,oy,w,h,win]=SelectRegion(:)
kc=find(win==windows(:,2))
if kc==[] then
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
return
elseif windows(kc,1)<0 then //click dans une palette
kpal=-windows(kc,1)
elseif slevel>1 then
execstr('scs_m=scs_m_'+string(windows(kc,1)))
else
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
return
end
[keep,del]=get_blocks_in_rect(scs_m,ox,oy,w,h)
[ox,oy,w,h,win]=SelectRegion(:)
kc=find(win==windows(:,2))
if kc==[] then
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
return
elseif windows(kc,1)<0 then //click dans une palette
kpal=-windows(kc,1)
elseif slevel>1 then
execstr('scs_m=scs_m_'+string(windows(kc,1)))
else
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
return
end
[keep,del]=get_blocks_in_rect(scs_m,ox,oy,w,h)
'CLKOUT_f'
'INIMPL_f'
'OUTIMPL_f']) then
- message('Input/Output ports are not allowed in the region.')
+ messagebox('Input/Output ports are not allowed in the region.','modal')
prt=[];rect=[];return
end
end
kc = find(win==windows(:,2))
if kc==[] then
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
//** xset('window',wins)
scf(wins);
//** xset('alufunction',alu)
execstr('scs_m=scs_m_'+string(windows(kc,1)))
else
- message('This window is not an active palette')
+ messagebox('This window is not an active palette','modal')
//** xset('window',wins)
scf(wins);
//** xset('alufunction',alu)
reg = list(); rect = []
kc = find (win==windows(:,2) )
if kc==[] then
- message("This window is not an active palette") ;
+ messagebox("This window is not an active palette",'modal') ;
return ; //** ---> Exit point
elseif windows(kc,1)<0 then // click inside a palette window
kpal = -windows(kc,1) ;
elseif slevel>1 then
execstr('scs_m=scs_m_'+string(windows(kc,1))) ;
else
- message("This window is not an active palette")
+ messagebox("This window is not an active palette",'modal')
return ;
end
'CLKOUT_f'
'INIMPL_f'
'OUTIMPL_f']) then
- message('Input/Output ports are not allowed in the region.')
+ messagebox('Input/Output ports are not allowed in the region.','modal')
prt=[];rect=[];return
end //** some 'Block' are not allowed
end //** look for dangerous 'Block'
if xout==[] then
hilite_obj(kfrom);
- message("This block has no output port");
+ messagebox("This block has no output port",'modal');
unhilite_obj(kfrom);
return ; //** EXIT
end
port_number = k ;
if op(port_number)<>0 then
hilite_obj(kfrom)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom);
return
end
port_number = k ;
if op(port_number)<>0 then
hilite_obj(kfrom);
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom);
return
end
port_number = i_ImplIndx(k)
if impi(port_number)<>0 then
hilite_obj(kfrom) ;
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom) ;
return
end
port_number = k - size(op,'*') ;
if cop(port_number)<>0 then
hilite_obj(kfrom);
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom);
return ;
end
//** check connection
if xin==[] then
hilite_obj(kto)
- message("This block has no input port.");
+ messagebox("This block has no input port.",'modal');
p_size = size(gh_axes.children);
d_size = p_size(1) - o_size(1);
if d_size > 0 then
//** check connection for "type"
if typo<>typi
hilite_obj(kto)
- message(["Selected ports don''t have the same type"
+ messagebox(["Selected ports don''t have the same type"
"The port at the origin of the link has type "+string(typo);
- "the port at the end has type "+string(typin(k))+'.'])
+ "the port at the end has type "+string(typin(k))+'.'],'modal')
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
port_number = k ;
if ip(port_number)<>0 then
hilite_obj(kto)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."]),
+ "on the split point and double click, or type l."],'modal'),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
if need_warning then
hilite_obj(kto)
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size";
"The port at the origin of the link has size " + sci2exp(szout);
- "the port at the end has size " + sci2exp(szin)+"."])
+ "the port at the end has size " + sci2exp(szin)+"."],'modal')
unhilite_obj(kto)
end
'int8';'uint32';'uint16';'uint8']
hilite_obj(kto)
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same data type";
"The port at the origin of the link has datatype "+...
tt_typ(szouttyp)+' ('+sci2exp(szouttyp)+')';
"the port at the end has datatype "+...
- tt_typ(szintyp)+' ('+sci2exp(szintyp)+')'+'.'])
+ tt_typ(szintyp)+' ('+sci2exp(szintyp)+')'+'.'],'modal')
unhilite_obj(kto);
end
end
elseif typi==2 & k<=size(ip,'*') then // implicit "input" port
port_number = k
if ip(port_number)<>0 then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click."]),
+ "on the split point and double click."],'modal'),
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
szin = getportsiz(o2,port_number,'in')
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :';
+ messagebox(["Warning :';
"Selected ports don''t have the same size";
"The port at the origin of the link has size "+string(szout);
- "the port at the end has size "+string(szin)])
+ "the port at the end has size "+string(szin)],'modal')
end
elseif (typi==2 & k>size(ip,'*')+size(cip,'*')) then // implicit "output" port
port_number = o_ImplIndx(k) //RN: explicit outputs are excluded
// in the computation of k
if impo(port_number)<>0 then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click"]),
+ "on the split point and double click"],'modal'),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
szin=getportsiz(o2,port_number,'out')
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size";
"The port at the origin of the link has size " + string(szout);
- "the port at the end has size " + string(szin)+'.'])
+ "the port at the end has size " + string(szin)+'.'],'modal')
end
//** otherwise is an event input port
if cip(port_number)<>0 then
hilite_obj(kto)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click."]),
+ "on the split point and double click."],'modal'),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
typpto = 'evtin';
szin = getportsiz(o2,port_number,'evtin');
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size"
"The port at the origin of the link has size " + string(szout);
- "the port at the end has size " + string(szin)+'.'])
+ "the port at the end has size " + string(szin)+'.'],'modal')
end
end
nx = prod(size(xl))
if from==to then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click"]),
+ "on the split point and double click"],'modal'),
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
if xout==[] then
hilite_obj(kfrom);
- message("This block has no output port");
+ messagebox("This block has no output port",'modal');
unhilite_obj(kfrom);
return ; //** EXIT
end
link_dir = "h" ; //** output port starts horizontal link
if op(port_number)<>0 then
hilite_obj(kfrom)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom);
return
end
link_dir = "h" ; //** use the default
if op(port_number)<>0 then
hilite_obj(kfrom);
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],'modal')
unhilite_obj(kfrom);
return
end
link_dir = "h" ; //** use the default
if impi(port_number)<>0 then
hilite_obj(kfrom) ;
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],"modal")
unhilite_obj(kfrom) ;
return
end
if cop(port_number)<>0 then
hilite_obj(kfrom);
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."])
+ "on the split point and double click, or type l."],"modal")
unhilite_obj(kfrom);
return ;
end
//** check connection
if xin==[] then
hilite_obj(kto)
- message("This block has no input port.");
+ messagebox("This block has no input port.","modal");
p_size = size(gh_axes.children);
d_size = p_size(1) - o_size(1);
if d_size > 0 then
//** check connection for "type"
if typo<>typi
hilite_obj(kto)
- message(["Selected ports don''t have the same type"
+ messagebox(["Selected ports don''t have the same type"
"The port at the origin of the link has type "+string(typo);
- "the port at the end has type "+string(typin(k))+'.'])
+ "the port at the end has type "+string(typin(k))+'.'],"modal")
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
port_number = k ;
if ip(port_number)<>0 then
hilite_obj(kto)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click, or type l."]),
+ "on the split point and double click, or type l."],'modal'),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
if need_warning then
hilite_obj(kto)
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size";
"The port at the origin of the link has size " + sci2exp(szout);
- "the port at the end has size " + sci2exp(szin)+"."])
+ "the port at the end has size " + sci2exp(szin)+"."],"modal")
unhilite_obj(kto)
end
'int8';'uint32';'uint16';'uint8']
hilite_obj(kto)
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same data type";
"The port at the origin of the link has datatype "+...
tt_typ(szouttyp)+' ('+sci2exp(szouttyp)+')';
"the port at the end has datatype "+...
- tt_typ(szintyp)+' ('+sci2exp(szintyp)+')'+'.'])
+ tt_typ(szintyp)+' ('+sci2exp(szintyp)+')'+'.'],"modal")
unhilite_obj(kto);
end
end
elseif typi==2 & k<=size(ip,'*') then // implicit "input" port
port_number = k
if ip(port_number)<>0 then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click."]),
+ "on the split point and double click."],"modal"),
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
szin = getportsiz(o2,port_number,'in')
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :';
+ messagebox(["Warning :';
"Selected ports don''t have the same size";
"The port at the origin of the link has size "+string(szout);
- "the port at the end has size "+string(szin)])
+ "the port at the end has size "+string(szin)],"modal")
end
elseif (typi==2 & k>size(ip,'*')+size(cip,'*')) then // implicit "output" port
port_number = o_ImplIndx(k) //RN: explicit outputs are excluded
// in the computation of k
if impo(port_number)<>0 then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click"]),
+ "on the split point and double click"],"modal"),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
szin=getportsiz(o2,port_number,'out')
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size";
"The port at the origin of the link has size " + string(szout);
- "the port at the end has size " + string(szin)+'.'])
+ "the port at the end has size " + string(szin)+'.'],"modal")
end
//** otherwise is an event input port
if cip(port_number)<>0 then
hilite_obj(kto)
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click."]),
+ "on the split point and double click."],"modal"),
p_size = size(gh_axes.children);
d_size = p_size(1)-o_size(1);
if d_size > 0 then
typpto = 'evtin';
szin = getportsiz(o2,port_number,'evtin');
if szin<>szout & mini([szin szout])>0 then
- message(["Warning :";
+ messagebox(["Warning :";
"Selected ports don''t have the same size"
"The port at the origin of the link has size " + string(szout);
- "the port at the end has size " + string(szin)+'.'])
+ "the port at the end has size " + string(szin)+'.'],"modal")
end
end
nx = prod(size(xl))
if from==to then
- message(["Selected port is already connected.";..
+ messagebox(["Selected port is already connected.";..
"To start a link off another link, place the cursor";..
- "on the split point and double click"]),
+ "on the split point and double click"],"modal"),
p_size = size(gh_axes.children)
d_size = p_size(1)-o_size(1);
if d_size > 0 then
for i=1:size(index,'*')
indexx=find((sco_mat(index(:),3)==sco_mat(index(i),3))&(sco_mat(index(:),5)==sco_mat(index(i),5)))
if size(indexx,'*')>1 then
- message(["Error In Compilation";"You cannot have multiple global GOTO with the same tag"])
+ messagebox(["Error In Compilation";"You cannot have multiple global GOTO with the same tag"],"modal")
ok=%f
return
end
hilite_obj(path($))
end
end
- message(mess)
+ messagebox(mess,'modal')
for k=1:size(opened_windows,'*') //** close opened_windows
//** select the opened_windows(k) and get the handle
+++ /dev/null
-// Scicos
-//
-// Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// See the file ../license.txt
-//
-
-function num=message(strings ,buttons)
-//interface to message primitive to allow simple overloading for live demo
-[lhs,rhs]=argn(0)
-if rhs==2 then
- num=messagebox(strings,"modal","scilab",buttons);
-else
- num=1
- messagebox(strings,"modal","scilab");
-end
-endfunction
mat=mat(k,:); // sorting the mat matrix (increasingly).
// if two outputs are called at the same time they are replaced by an other output; the intersection of the two.
if size(mat,1)>10000 then
- num=message(['Warning: Your system is too hard to synchronize it will take some time';
+ num=messagebox(['Warning: Your system is too hard to synchronize it will take some time';
'And the stacksize has to be increase';
' A scilab crash may occur';
- 'Do You want me to continue?'],['No','Yes'])
+ 'Do You want me to continue?'],'modal',['No','Yes'])
if num==1 then
ok=%f;
return
//TOBEDONE
if get_connected(scs_m,k2)<>[] then
hilite_obj(k2) //** new
- message('Connected block can''t be aligned')
+ messagebox('Connected block can''t be aligned','modal')
unhilite_obj(k2) //** new
return
end
v=freq1;
v=v(find(v<>0));
min_v=min(v);max_v=max(v);
- if (max_v/min_v)>1e5 then message(['The difference between the frequencies is very large';..
- 'the clocks could not be synchronized']);
+ if (max_v/min_v)>1e5 then messagebox(['The difference between the frequencies is very large';..
+ 'the clocks could not be synchronized'],'modal');
ok=%f;Ts=[];bllst=[];corinv=list();indout=[];
return;
end
v=[freq1;offset1]
v=v(find(v<>0));
min_v=min(v);max_v=max(v);
- if (max_v/min_v)>1e5 then message(['The difference between the frequencies is very large';..
- 'the clocks could not be synchronized']);
+ if (max_v/min_v)>1e5 then messagebox(['The difference between the frequencies is very large';..
+ 'the clocks could not be synchronized'],'modal');
ok=%f;Ts=[];bllst=[];corinv=list();indout=[];
return;
end
path=stripblanks(fpath)+'/'+nam+'.sci'
[u,err]=file('open',path,'unknown')
if err<>0 then
- message(path+': Directory or file write access denied')
+ messagebox(path+': Directory or file write access denied','modal')
return
end
write(u,txt,'(a)')
' %exit=resume(%f)'
' else'
' %r=2'
- ' %r=message([''SUPER BLOCK needs to be edited;'';''Edit or exit by removing all edition''],[''Edit'';''Exit''])'
+ ' %r=messagebox([''SUPER BLOCK needs to be edited;'';''Edit or exit by removing all edition''],''modal'',[''Edit'';''Exit''])'
' if %r==2 then typ=list(),%exit=resume(%t),end'
' end'
' end']
path=stripblanks(fpath)+'/'+nam+'.sci'
[u,err]=file('open',path,'unknown')
if err<>0 then
- message(path+': Directory or file write access denied')
+ messagebox(path+': Directory or file write access denied','modal')
return
end
write(u,txt,'(a)')
if (flag<>"c")&(flag<>"f") then
ok = %f;
- message("Sorry: Only C or FORTRAN languages are supported");
+ messagebox("Sorry: Only C or FORTRAN languages are supported",'modal');
return;
end
if stripblanks(funam)==emptystr() then
ok = %f;
- message("Sorry file name not defined in "+flag+" block");
+ messagebox("Sorry file name not defined in "+flag+" block",'modal');
return;
end
mxwin=maxi(winsid());
scs_show(scs_m,mxwin+1);
hilite_obj(k);
- message("There is another local GOTO in this diagram with the same tag ''"+loc_mat($,3)+"''");
+ messagebox("There is another local GOTO in this diagram with the same tag ''"+loc_mat($,3)+"''","modal");
gh_del = scf(mxwin+1);
unhilite_obj(k);
delete(gh_del);
end //end of loop on objects
if ksup==0&nb==0 then
- message('Empty diagram')
+ messagebox('Empty diagram','modal')
ok=%f
return
end
tof=find((sco_mat(:,2)=='1')& (sco_mat(:,5)=='10'))
if tof<>[] then
if mod_blk_exist then
- message('Warning the enable does not consider the modelica blocks')
+ messagebox('Warning the enable does not consider the modelica blocks','modal')
end
end
//----------------------Goto From Analyses--------------------------
for i=1:size(tag_exprs,1)
index=find((tag_exprs(:,1)==tag_exprs(i,1))&(tag_exprs(:,2)==tag_exprs(i,2)))
if size(index,'*') > 1 then
- message(["Error In Compilation. You cannot have multiple GotoTagVisibility";..
- " with the same tag value in the same scs_m"])
+ messagebox(["Error In Compilation. You cannot have multiple GotoTagVisibility";..
+ " with the same tag value in the same scs_m"],'modal')
ok=%f;
return
end
index=find((sco_mat(:,2)=='1')&(sco_mat(:,3)==tag_exprs(i,1))&(sco_mat(:,4)=='2')&(sco_mat(:,5)==tag_exprs(i,2)))
if index<>[] then
if size(index,'*')>1 then
- message(["Error in compilation";"Multiple GOTO are taged by the same GotoTagVisibility"])
+ messagebox(["Error in compilation";"Multiple GOTO are taged by the same GotoTagVisibility"],'modal')
ok=%f
return
end
err__,...
ko]=extract__(in#)
if ~ko then
- message('set_io : '+...
- str__err(err__,...
- 'in'))
+ messagebox('set_io : '+ str__err(err__,'in') , 'modal')
ok=%f
return, end
[out,..
err__,...
ko]=extract__(out#)
if ~ko then
- message('set_io : '+...
- str__err(err__,...
- 'out'))
+ messagebox('set_io : '+ str__err(err__, 'out') ,'modal')
ok=%f
return, end
nclkin=size(clkin,1)
if nclkin>0 then
if mini(clkin)<1 then
- message('set_io : '+...
- 'Event input ports sizes must be positive')
+ messagebox('set_io : ' + 'Event input ports sizes must be positive','modal')
ok=%f
return, end
end
nclkout=size(clkout,1)
if nclkout>0 then
if mini(clkout)<1 then
- message('set_io : '+...
- 'Event output ports sizes must be positive')
+ messagebox('set_io : '+ 'Event output ports sizes must be positive','modal')
ok=%f
return, end
end
n=size(in(:,1),'*') //given number of input port
if n1>n then
// if or(ip1(n+1:$)>0) then
-// message('set_io : '+...
-// 'Connected ports cannot be suppressed')
+// messagebox('set_io : '+'Connected ports cannot be suppressed','modal')
// ok=%f
// return, end
ip1=ip1(1:n)
n=size(out(:,1),'*')
if n1>n then
// if or(op1(n+1:$)>0) then
-// message('set_io : '+...
-// 'Connected ports cannot be suppressed')
+// messagebox('set_io : '+...
+// 'Connected ports cannot be suppressed', 'modal')
// ok=%f
// return, end
op1=op1(1:n)
n=size(clkin,'*')
if n1>n then
// if or(cip1(n+1:$)>0) then
-// message('set_io : '+...
-// 'Connected ports cannot be suppressed')
+// messagebox('set_io : '+...
+// 'Connected ports cannot be suppressed','modal')
// ok=%f
// return, end
cip1=cip1(1:n)
n=size(clkout,'*')
if n1>n then
// if or(cop1(n+1:$)>0) then
-// message('set_io : '+...
-// 'Connected ports cannot be suppressed')
+// messagebox('set_io : '+...
+// 'Connected ports cannot be suppressed','modal')
// ok=%f
// return, end
cop1=cop1(1:n)
// k=find(ip1<>0) //connected links
// k=k(find(k<=kk))
// if or(graphics.in_implicit(k)<>in_impl(k)) then
-// message('set_io : '+...
-// 'Connected ports types cannot be changed')
+// messagebox('set_io : '+...
+// 'Connected ports types cannot be changed','modal')
// ok=%f
// return, end
else
// k=find(op1<>0) //connected links
// k=k(find(k<=kk))
// if or(graphics.out_implicit(k)<>out_impl(k)) then
-// message('set_io : '+...
-// 'Connected ports types cannot be changed')
+// messagebox('set_io : '+...
+// 'Connected ports types cannot be changed','modal')
// ok=%f
// return, end
else
clear %vv
end
if %noooo>0 then
- message(['answer given for '+%lables(%noooo);
+ messagebox(['answer given for '+%lables(%noooo);
'has invalid dimension: ';
- 'waiting for dimension '+%ssss])
+ 'waiting for dimension '+%ssss],'modal')
%ini=%str
%ok=%f;break
elseif %noooo<0 then
- message(['answer given for '+%lables(-%noooo);
- 'has incorrect type :'+ %typ(-2*%noooo-1)])
+ messagebox(['answer given for '+%lables(-%noooo);
+ 'has incorrect type :'+ %typ(-2*%noooo-1)],'modal')
%ini=%str
%ok=%f;break
else
deff('ierr=exec_gr_i(gr_i)','ierr=execstr(gr_i,''errcatch'',''n'');') ; //** on line function definition
//** Check of the graphics object has generated any error
if exec_gr_i(gr_i)<>0 then
- message(['Error in Icon defintion'; lasterror()])
+ messagebox(['Error in Icon defintion'; lasterror()],'modal')
end
//** -----------------------------------------------------------------------------
inde=find(scicos_pal(:,1)==name);
if size(inde,'*')>=2 then
- message(['More than one palette named '+name;
- 'This is not allowed, do an Pal Editor to correct'])
+ messagebox(['More than one palette named '+name;
+ 'This is not allowed, do an Pal Editor to correct'],'modal')
return
end
if inde<>[] then
- if message(['The palette '+name+' already exists';
- 'Do you want to replace it?'],['Yes','No'])==2 then
+ if messagebox(['The palette '+name+' already exists';
+ 'Do you want to replace it?'],'modal',['Yes','No'])==2 then
return;
else
scicos_pal(inde,2)=fname
O=Tree('orig')
path=Tree('paths')(k-1);
if size(O,'*')>size(super_path,'*') then
- message(['Navigator tree doesnt correspond to this'
- 'diagram'])
+ messagebox(['Navigator tree doesnt correspond to this'
+ 'diagram'],'modal')
ok=%f
return
end
n=size(O,'*')
if or(O<>super_path(1:n)) then
- message(['Navigator tree doesnt correspond to this'
- 'diagram'])
+ messagebox(['Navigator tree doesnt correspond to this'
+ 'diagram'],'modal')
ok=%f
return
end
sp=super_path;sp(1:n)=[]
if size(path,'*')<size(sp,'*') then
- message(['Upper level or New branch';
- 'close current edition window first'])
+ messagebox(['Upper level or New branch';
+ 'close current edition window first'],'modal')
ok=%f
return
end
n=size(sp,'*')
if or(sp<>path(1:n)) then
- message(['New branch, close current edition window first'])
+ messagebox(['New branch, close current edition window first'],'modal')
ok=%f
return
end
//## blk of PAL_f
ierr=execstr('blk=PAL_f(''define'')','errcatch')
if ierr<>0 then
- message('Block palette not found.')
+ messagebox('Block palette not found.','modal')
return
end
//## set size graphics of PAL_f block
//## open file
[u,err]=file('open',path(1)+fname(1)+'.cosf','unknown','formatted')
if err<>0 then
- message('File or directory write access denied')
+ messagebox('File or directory write access denied','modal')
routines=[]
return
end
//## write scs_m in file with cos2cosf
ierr=cos2cosf(u,do_purge(scs_m))
if ierr<>0 then
- message('Directory write access denied')
+ messagebox('Directory write access denied','modal')
routines=[]
file('close',u)
return
//## blk of PAL_f
ierr=execstr('blk=PAL_f(''define'')','errcatch')
if ierr<>0 then
- message('Block palette not found.')
+ messagebox('Block palette not found.','modal')
return
end
//## set size graphics of PAL_f block
name=basename(fil)
ierror=execstr('blk_j='+name+'(''define'')','errcatch')
if ierror <>0 then
- message(['Error in GUI function';lasterror()] )
+ messagebox(['Error in GUI function';lasterror()],'modal' )
return
end
routines=[routines;blk_j.model.sim(1)]
name=basename(fil)
ierror=execstr('blk_j='+name+'(''define'')','errcatch')
if ierror <>0 then
- message(['Error in GUI function';lasterror()] )
+ messagebox(['Error in GUI function';lasterror()],'modal' )
return
end
routines=[routines;blk_j.model.sim(1)]
ok=%f
end
if ~ok then
- message(mess)
+ messagebox(mess,'modal')
else
rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
model.rpar=rpar;
clear %vv
end
if %noooo>0 then
- message(['answer given for '+%lables(%noooo);
+ messagebox(['answer given for '+%lables(%noooo);
'has invalid dimension: ';
- 'waiting for dimension '+%ssss])
+ 'waiting for dimension '+%ssss],'modal')
%ini=%str
%ok=%f;break
elseif %noooo<0 then
- message(['answer given for '+%lables(-%noooo);
- 'has incorrect type :'+ %typ(-2*%noooo-1)])
+ messagebox(['answer given for '+%lables(-%noooo);
+ 'has incorrect type :'+ %typ(-2*%noooo-1)],'modal')
%ini=%str
%ok=%f;break
else