~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/scicos/do_help.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function do_help()
 
1
function %pt=do_help(%pt)
2
2
// Copyright INRIA
3
3
 
4
 
while %t do
5
 
  [btn,xc,yc,cwin,Cmenu]=cosclick(0)
6
 
  if Cmenu<>[] then
7
 
    name=Cmenu
8
 
    nm=1
9
 
    break
10
 
  elseif cwin==curwin then 
11
 
    k=getobj(scs_m,[xc;yc])
12
 
    if k<>[] then
13
 
      o=scs_m(k)
14
 
      name=o(5)
15
 
      nm=0
16
 
      break
17
 
    end
18
 
  elseif or(windows(find(windows(:,1)<0),2)==cwin) then
19
 
    kwin=find(windows(:,2)==cwin)
20
 
    pal=palettes(-windows(kwin,1))
21
 
    k=getobj(pal,[xc;yc])
22
 
    if k<>[] then
23
 
      o=pal(k)
24
 
      name=o(5)
25
 
      nm=0
26
 
      break
27
 
    end
28
 
  end
29
 
end
30
 
if nm==0 then
31
 
  help(name)
32
 
//  unix_s('$SCI/bin/scilab -help ""'+name+'"" | $SCI/bin/xless &')
33
 
  return
34
 
end
35
 
select name
36
 
// Misc menu---------------------------------------------------------
37
 
case 'Window' then
38
 
 mess=[' In the active editor Scicos window, clicking on the ';
39
 
       ' Window menu item invokes a dialog box that allows you to change ';
40
 
       ' window dimensions'];
41
 
case 'Background color' then    
42
 
 mess=[' This menu allows to change the background and defaukt foreground'
43
 
       ' colors']
44
 
case 'Default link colors' then    
45
 
 mess=[' This menu allows to change the default color for regular '
46
 
       ' and event links']
47
 
case 'ID font' then    
48
 
 mess=[' This menu allows to change the font used to write the block'
49
 
       ' identifications (see ""Set block ID"" menu)']
50
 
case '3D aspect' then   
51
 
  mess=[' This menu allows to select 3D shape for blocks and '
52
 
          ' associated parameters']
53
 
case 'Add color' then         
54
 
  mess=[' This menu allows to add new color to the diagram private'
55
 
        ' color map. Added colors are stored in the diagram data structure']
56
 
case 'Focus' then    
57
 
  mess=[' Focus menu allows to select a zone (click left, drag zone, click'
58
 
        ' to select) which is focused on';
59
 
        ' To change focus back use ""Zoom in"" menu']
60
 
case 'Shift' then
61
 
  mess=[' To shift the diagram to left, right, up or down,';
62
 
      ' select this menu item, then click on the point you want ';
63
 
      ' to appear in the middle of the graphics window. '];
64
 
case 'Zoom in' then
65
 
  mess=[' When you select this menu item the diagram is zoomed in '
66
 
      'by a factor of 10%']
67
 
case 'Zoom out' then  
68
 
  mess=[' When you select this menu item the diagram is zoomed out '
69
 
      'by a factor of 10%']
70
 
case 'Help' then
71
 
  mess=[' To get help on an object or menu buttons,';
72
 
        ' select first Help menu item and then on ';
73
 
        ' the selected object or menu item.']
74
 
case 'Calc' then 
75
 
  mess=[' When you select this menu item you switch Scilab to ';
76
 
      ' the pause mode (see the help on pause).';
77
 
      ' In the Scilab main window and you may enter Scilab instructions';
78
 
      ' to compute whatever you want.';
79
 
      ' to go back to Scicos you need enter the ""return"" or';
80
 
      ' ""[...]=return(...)"" Scilab instruction.';
81
 
      ' '
82
 
      ' If you use ""[...]=return(...)"" Scilab instruction take care';
83
 
      ' not to modify Scicos variables such as ""scs_m"",""scs_gc"",';
84
 
      ' ""menus"",""datam"",...';
85
 
      ' '
86
 
      ' If you have modified scicos graphic window you may retore it ';
87
 
      ' using the Scicos ""Replot"" menu.']
88
 
 
89
 
// Edit menu---------------------------------------------------------
90
 
case 'Palettes' then
91
 
  mess=[' Select the Palettes menu item to open a predefined palette.']
92
 
 
93
 
case 'Context' then
94
 
  mess=[' When you select this menu item you get a dialogue to';
95
 
    ' enter scilab instructions for defining symbolic scicos parameters';
96
 
    '  used in block definitions or to do whatever you want';
97
 
    ' ';
98
 
    ' These instructions will be evaluated each time the diagram ';
99
 
    ' is loaded.'
100
 
    ' ';
101
 
    ' If you  change the value of a symbolic scicos parameters in ';
102
 
    ' the contextyou can either click on the block(s) that use this';
103
 
    ' variable or on the Eval menu item to update actual block parameter';
104
 
    ' value.']
105
 
 
106
 
case 'Smart Move' then
107
 
  mess=[' To move a block in  the active editor Scicos window';
108
 
        ' or in edited palette keeping horizontal and vertical'
109
 
        ' links, select first the ""Smart Move"" menu item, '
110
 
        ' then click on the selected block, link segment or link'
111
 
        ' corner, drag the mouse to the desired new  position '
112
 
        ' and click left again to fix the position.'
113
 
        ' '
114
 
        ' Right click cancel the move action']
115
 
 
116
 
case 'Move (m)' then
117
 
  mess=[' To move a block in  the active editor Scicos window';
118
 
        ' or in edited palette,'
119
 
        ' select first the Move menu item, '
120
 
        ' then click on the selected block, link segment or link'
121
 
        ' corner, drag the mouse to the desired new block position '
122
 
        ' and click left again to fix the position.'
123
 
        ' '
124
 
        ' Right click cancel the move action']
125
 
 
126
 
 
127
 
case 'Copy (c)' then
128
 
  mess=['To copy a block in the active editor Scicos window';
129
 
         ' select first the Copy menu item, then'
130
 
         ' click (with left button) on the to-be-copied block'
131
 
         ' in Scicos windows or in a palette) ,  and'
132
 
         ' finally click left where you want the copy';
133
 
         ' be placed in the active editor Scicos window.';
134
 
         ' '
135
 
         ' The lower left corner of the block is placed';
136
 
         ' at the selected point.';
137
 
         ' This menu remains active until user choose an other one';
138
 
         ' '
139
 
         ' Right click cancel the copy action']
140
 
     
141
 
case 'Copy Region' then
142
 
  mess=[ 'To copy a region in the active editor Scicos window';
143
 
         ' select first the Copy menu item, then'
144
 
         ' click (with right button) on a corner of the desired';
145
 
         ' region (in Scicos windows or in a palette), drag to '
146
 
         ' define the region, click to fix the region  and'
147
 
         ' finally click left where you want the copy.' 
148
 
         ' to be placed in the active editor Scicos window.';
149
 
         ' NOTE: If source diagram is big be patient, region selection '
150
 
         ' may take a while.'
151
 
         ' '
152
 
         ' The lower left corner of the block is placed';
153
 
         ' at the selected point.';
154
 
         ' '
155
 
         ' Right click cancel the copy action']
156
 
     
157
 
case 'Replace' then     
158
 
 mess=[' To replace a block in the active editor Scicos window';
159
 
         ' select first the Replace menu item, then'
160
 
         ' select the replacement block (in Scicos window or in a'
161
 
         ' palette), and  finally click on the to-be-replaced block']
162
 
     
163
 
 
164
 
 
165
 
case 'Align' then
166
 
  mess=[' To obtain nice diagrams, you can align ports of';
167
 
        ' different blocks, vertically and horizontally.';
168
 
        ' Select first  the Align menu item, then click on the first';
169
 
        ' port and finally on the second port.';
170
 
        ' The block corresponding to the second port is moved.';
171
 
        ' '
172
 
        ' A connected block cannot be aligned.']
173
 
 
174
 
 
175
 
case 'Link (l)' then
176
 
  mess=[' To connect an output port to an input port,';
177
 
        ' select first  the Link menu item, then click on the output';
178
 
        ' port, drag, click left on each intermediate points'
179
 
        ' and finally click left on the input port.';
180
 
        ' '
181
 
        ' To split a link, select first  the Link menu item,';
182
 
        ' then click left on the link where the split should be placed,';
183
 
        ' drag, click left on each intermediate points'
184
 
        ' and finally click left on the input port.'
185
 
        ' '
186
 
        ' Right click cancel the link action'
187
 
        ' '
188
 
        ' Only one link can go from and to a port.';
189
 
        ' Link color can be changed directly by clicking';
190
 
        ' on the link.'
191
 
        ' '
192
 
        ' This menu remains active until user choose an other one']
193
 
 
194
 
case 'Delete (d)' then
195
 
  mess=['To delete  blocks or a links, select first the Delete'
196
 
        ' menu item, then click successively on the selected objects'
197
 
        '(with left button).';
198
 
        ' '
199
 
        ' When you delete a block all links connected to it';
200
 
        ' are deleted as well.'
201
 
        ' '
202
 
        ' This menu remains active until user choose an other one']
203
 
    
204
 
case 'Delete Region' then
205
 
  mess=['To delete a blocks in  a region, select first  the Delete Region'
206
 
        ' menu item, then click  on a corner of the ';
207
 
        ' desired region, drag to define the region, and click left to ';
208
 
        ' fix the region. All connected links will be destroyed as';
209
 
        ' well'
210
 
        ' '
211
 
        ' Right click instead of left cancels the delete  action']
212
 
 
213
 
case 'Add new block' then 
214
 
  mess=[' To add a newly defined block to the current palette or diagram';
215
 
      ' select first this menu item, A dialog box will popup ';
216
 
      ' asking for the name of the GUI function associated '
217
 
      ' with the block. If this function is not already loaded';
218
 
      ' it was search in the current directory. The user may then'
219
 
      ' click at the desired position of the block icon ']
220
 
 
221
 
case 'Flip (f)' then
222
 
    mess=[' To reverse the positions of the (regular) inputs'
223
 
          ' and outputs of a block placed on its sides,';
224
 
          ' select the Flip menu item first and then click on the';
225
 
          ' selected block. This does not affect the order,';
226
 
          ' nor the position of the input and output event';
227
 
          ' ports which are numbered from left to right.'
228
 
          ' '
229
 
          ' A connected block cannot be flipped.']
230
 
 
231
 
 
232
 
case  'Undo (u)' then
233
 
  mess=[' Select the Undo menu item to undo the last edit operation.'
234
 
        ' It is not possible to undo more!']
235
 
 
236
 
 
237
 
// Simulate menu --------------------------------------------------
238
 
case 'Setup' then
239
 
  mess=[' In the main Scicos window, clicking on the Setup menu item';
240
 
        ' invokes a dialog box that allows you to change ';
241
 
        ' integration parameters: ';
242
 
        '   *final integration time';
243
 
        '   *absolute and relative error tolerances' ;
244
 
        '   *time tolerance (the smallest time interval for which ';
245
 
        '         the ode solver is used to update continuous states)';
246
 
        '   *deltat : the maximum time increase realized by a single';
247
 
        '         call to the ode solver'];
248
 
 
249
 
case 'Compile' then
250
 
  mess=[' select the Compile menu item to compile the block diagram.';
251
 
        ' This menu item need never be used since compilation is';
252
 
        ' performed automatically, if necessary, before';
253
 
        ' the beginning of every simulation (Run menu item).';
254
 
        ' '
255
 
        ' Normally, a new compilation is not needed if only';
256
 
        ' system parameters and internal states are modified.';
257
 
        ' In some cases however these modifications are not';
258
 
        ' correctly updated and a manual compilation may be';
259
 
        ' needed before a Restart or a Continue.';
260
 
        ' Please report if you encounter such a case.']
261
 
    
262
 
case 'Eval' then     
263
 
 mess=[' All dialogs user answers may be scilab instructions';
264
 
       ' they are evaluated immediatly and stored as character strings.'
265
 
       ' select this menu item to have them re-evaluated according to'; 
266
 
       ' new values of underlying scilab variables. '
267
 
       ' '
268
 
       ' These underlying scilab variables may be user global variables'
269
 
       ' defined before scicos was launch, They may also be defined in'
270
 
       ' by the scicos context (see Context menu item)']
271
 
 
272
 
case 'Run' then
273
 
  mess=[' select the Run menu item to start the simulation.';
274
 
        ' If the system has already been simulated, a';
275
 
        ' dialog box appears where you can choose to Continue,'
276
 
        ' Restart or End the simulation.'
277
 
        ' '
278
 
        ' You may interrupt the simulation by clicking on the '
279
 
        ' ""stop"" button, change any of the block parameters'
280
 
        ' and continue the simulation with the new values.']
281
 
 
282
 
// Diagram menu ---------------------------------------------------
283
 
case 'Replot (r)' then
284
 
  mess=[' Select the Replot menu item to replot the content of'
285
 
        ' the graphics window. Graphics window stores complete';
286
 
        ' history of the editing session in memory.';
287
 
        ' '
288
 
        ' Replot is usefull for ''cleaning'' this memory.']
289
 
 
290
 
case 'New' then
291
 
  mess=[' Clicking on the New menu item loads an empty diagram in the';
292
 
        ' active editor Scicos window. If the previous content of the';
293
 
        ' window is not saved, it will be lost.']
294
 
case 'Region to Super Block' then    
295
 
  mess=[' This menu allows to transform a rectangular region of the'
296
 
        ' current diagram by a super block.'
297
 
        ' Click  on a corner of the region , drag an click left to'
298
 
        ' fix the region (left click cancels selection)'
299
 
        ' '
300
 
        ' Region is replaced by a super block ans links are redrawn']
301
 
case 'Purge' then
302
 
   mess=[' select the Purge menu item to get a clean data structure:';
303
 
         ' If diagram has been hugely modified many deleted blocks';
304
 
         ' may remain in the data structure. It may be  usefull to';
305
 
         ' suppress then before saving.']
306
 
case 'Rename' then
307
 
   mess=[' This menu allows to change the diagram name. An editable'
308
 
         '  dialog box opens.']
309
 
   
310
 
case 'Save (s)' then
311
 
   mess=[' select the save menu item to save the block diagram';
312
 
         ' in a binary file already selected by a previous';
313
 
         ' select the Save As menu item. If you select this';
314
 
         ' menu item and you have never clicked on the Save As';
315
 
         ' menu item, the diagram is saved in the current directory';
316
 
         ' as <window_name>.cos where <window_name> is the name';
317
 
         ' of the window appearing on top of the window (usually';
318
 
       ' Untitled or Super Block).']
319
 
 
320
 
case 'Save As' then
321
 
  mess=[' select the Save As menu item to save the block diagram';
322
 
         ' or palette in a  file. A dialog box allows choosing ';
323
 
         ' the file which must have a .cos or .cosf extension. The diagram';
324
 
         ' takes the name of the file (without the extension).'
325
 
         ' '
326
 
         ' If extension is "".cosf"" an ascii  formatted save is performed'
327
 
         ' instead of binary save. Formatted save is slower than regular ';
328
 
         ' save but has the advantage that the generated file is system ';
329
 
         ' independent (usefull for exchanging data on different computers)']
330
 
   
331
 
case 'Load' then
332
 
  mess=[' select the Load menu item to load an ascii or binary file';
333
 
        ' containing a saved block diagram or palette.'
334
 
        ' A dialog box allows user choosing the file.']
335
 
    
336
 
case 'Load as Palette' then
337
 
  mess=[' select the Load menu item to load an ascii or binary file';
338
 
        ' containing a saved block diagram as a palette.'
339
 
        ' A dialog box allows user choosing the file.']
340
 
    
341
 
 
342
 
case 'Save as Palette' then
343
 
  mess=[' select the Save as Palette menu item to save the block diagram';
344
 
         ' as a palette in a  file. A dialog box allows choosing ';
345
 
         ' the file which must have a .cos or .cosf extension. The palette';
346
 
         ' takes the name of the file (without the extension).';
347
 
         ' '
348
 
         ' If extension is "".cosf"" an ascii  formatted save is performed'
349
 
         ' instead of binary save. It may take a while'
350
 
         ' '
351
 
         ' .scilab user file is updated if necessary']
352
 
 
353
 
 
354
 
case 'Save as Interf. Func.' then
355
 
   mess=[' Select ""the Save as Interf. Func."" menu item to save the '
356
 
         ' diagram as a new Scicos block. A Scilab function is generated'
357
 
         ' and saved in a  file with "".sci"" extension. File name and path'
358
 
         ' are to be set in a ""File menu"" dialog.']
359
 
   
360
 
case 'Set Diagram Info' then
361
 
   mess=[' This menu allows to set users diagram informations'
362
 
         ' these infos are stored in the diagram data structure'
363
 
         ' and may be used as diagram user documentation'
364
 
         ' '
365
 
         ' information format may be redefined by user ']
366
 
 
367
 
case 'Navigator' then
368
 
   mess=[' This experimental menu opens a graphic window with a tree '
369
 
         ' representation of the super blocks hierarchy. Each node '
370
 
         ' represents a superblock.'
371
 
         ' '
372
 
         ' Navigator window is usefull to open directly a super-block'
373
 
         ' every where in the hierarchy.']
374
 
     
375
 
case 'Quit (q)' then
376
 
  mess=[' Click on the Exit menu item to close current diagram. '
377
 
        ' If current diagram is not a Super block Exit menu item '
378
 
        ' leave Scicos and return to Scilab session. Save your diagram ';
379
 
        ' or palette before leaving.'
380
 
        ' '
381
 
        ' File/Close menu as the same effect']
382
 
     
383
 
//Object menu  --------------------------------------------------------
384
 
case 'Open/Set (o)' then     
385
 
 mess=[' To change the parameters of a regular block or link, '
386
 
       ' to open a super block, select first ';
387
 
       ' this menu item, click next on the desired object.'
388
 
       ' A dialog or edition window appears';
389
 
       ' that allows you to modify object'
390
 
       ' '
391
 
       ' It is also possible to select a super block to open clicking'
392
 
       ' on a node of the ""Navigator"" window'];
393
 
   
394
 
case 'Resize' then     
395
 
 mess=[' To change the size of a block , select first this menu item,';
396
 
       ' click next on the desired block. A dialog appear that allows ';
397
 
       ' you to change the width and/or height of the block shape.'];
398
 
   
399
 
case 'Icon' then     
400
 
 mess=[' To change the icon of a block, select first this menu item,';
401
 
       ' click next on the desired block. A dialog appear that allows ';
402
 
       ' you to enter scilab instructions used to draw the icon'
403
 
       ' '
404
 
       ' You may use the icon_edit function to generate the scilab'
405
 
       ' instructions'];
406
 
   
407
 
   
408
 
case 'Color' then     
409
 
 mess=[' To change the background color of an object, select first ';
410
 
       ' this menu item, click next on the desired object. A dialog appear';
411
 
       ' that allows you to choose the desired color'];
412
 
   
413
 
   
414
 
case 'Label' then     
415
 
 mess=[' To add a label to block, select first this menu item, click next';
416
 
       ' on the desired block. A dialog appear that allows you to enter ';
417
 
       ' the desired label.';
418
 
       ' labels are used to import data from a block in an other one'];
419
 
 
420
 
case 'Get Info (i)' then     
421
 
 mess=[' This menu allows to get information on an object and on '
422
 
       ' its connection with other diagram objects.'
423
 
       ' '
424
 
       ' Select this menu and click on an object'
425
 
       ' This menu remains selected']
426
 
case 'Identification' then     
427
 
 mess=[' This menu allows to set an identificator to a link or a block '
428
 
       ' block identificators are drawn under the block icon. Super blocks'
429
 
       ' input/output ports identificators are replicated over the block'
430
 
       ' shape ports. Links identificators are not displayed'
431
 
       ' '
432
 
       ' Selecting this menu and clicking on a block or links opens an'
433
 
       ' editable dialog box']
434
 
case 'Documentation' then     
435
 
 mess=[' This menu allows to set or get documentation for a block '
436
 
       ' '
437
 
       ' Selecting this menu and clicking on a block  opens an'
438
 
       ' editable dialog box']
439
 
 
440
 
end
441
 
if exists('mess')==0 then
442
 
  mess='No help available on this topic. Sorry.';
443
 
end
444
 
message(mess)
445
 
 
446
 
 
447
 
 
448
 
 
449
 
 
450
 
 
451
 
 
452
 
 
453
 
 
454
 
 
455
 
 
456
 
 
 
4
  cwin=%win
 
5
  while %t do
 
6
    if %pt==[] then
 
7
      [btn,%pt,cwin,Cmenu]=cosclick(0)
 
8
      if Cmenu<>[] then
 
9
        name=Cmenu
 
10
        nm=1
 
11
        break
 
12
      else
 
13
        cwin=curwin
 
14
      end
 
15
    elseif cwin==curwin then
 
16
      xc=%pt(1);yc=%pt(2);%pt=[]
 
17
      k=getobj(scs_m,[xc;yc])
 
18
      if k<>[] then
 
19
        o=scs_m.objs(k)
 
20
        name=o.gui
 
21
        nm=0
 
22
        break
 
23
      end
 
24
    elseif or(windows(find(windows(:,1)<0),2)==cwin) then
 
25
      kwin=find(windows(:,2)==cwin)
 
26
      pal=palettes(-windows(kwin,1))
 
27
      xc=%pt(1);yc=%pt(2);%pt=[]
 
28
      k=getobj(pal,[xc;yc])
 
29
      if k<>[] then
 
30
        o=pal.objs(k)
 
31
        name=o.gui
 
32
        nm=0
 
33
        break
 
34
      end
 
35
    else
 
36
      return
 
37
    end
 
38
  end
 
39
  %pt=[]
 
40
  if nm==0 then
 
41
    help(name)
 
42
    return
 
43
  end
 
44
 
 
45
  if execstr('mess=%scicos_help(name)','errcatch') <>0 then
 
46
    mess='No help available on this topic. Sorry.';
 
47
  end
 
48
  message(mess)  
 
49
endfunction