File: idialog.c

package info (click to toggle)
scilab 2.2-4
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 31,472 kB
  • ctags: 21,963
  • sloc: fortran: 110,983; ansic: 89,717; makefile: 3,016; sh: 1,892; csh: 150; cpp: 101
file content (66 lines) | stat: -rw-r--r-- 1,575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "scilab_d.h"

#define DIALOGHEIGHT 30

static char *str;
static int lstr=0;
static Widget toplevel;
extern int ok_Flag_sci;

static void 
IDialogOk(w, client_data, call_data) 
     Widget w;
     XtPointer client_data, call_data;	
{ 
  Widget dialog = (Widget) client_data;
  strncpy(str,XawDialogGetValueString(dialog),lstr-1);
  lstr=strlen(str);
  str[lstr-1] = '\n';
  ok_Flag_sci= 1;
}

#define X 147
#define Y 33

static void
IDialogWindow(description,valueinit)
     char description[],valueinit[];
  {
    Arg args[10];
    Cardinal iargs = 0;
    Widget shell,dialog;
    static Display *dpy = (Display *) NULL;
    DisplayInit("",&dpy,&toplevel);

    iargs=0;
    XtSetArg(args[iargs], XtNx, X + 10); iargs++ ;
    XtSetArg(args[iargs], XtNy, Y + DIALOGHEIGHT +10); iargs++;
    XtSetArg(args[iargs], XtNallowShellResize, True); iargs++;
    shell = XtCreatePopupShell("dialogshell",
			       transientShellWidgetClass,toplevel,
			       args,iargs);
    iargs = 0;
    XtSetArg(args[iargs], XtNlabel, description); iargs++;
    XtSetArg(args[iargs], XtNvalue, valueinit); iargs++; 
    XtSetArg(args[iargs], XtNresizable , TRUE) ; iargs++;
    dialog = XtCreateManagedWidget("dialog",dialogWidgetClass,shell,
				   args,iargs);
    XawDialogAddButton(dialog, "ok", IDialogOk, (XtPointer) dialog);
    XtMyLoop(shell,dpy);
}


void C2F(idialg)(str1,nlr1,str2,nlr2,str3,nlr3,il1,il2,il3)
     char str1[],str2[],str3[];
     int *nlr1,*nlr2,*nlr3;
     long int il1,il2,il3;
{
  str=str3;
  lstr = *nlr3;
  IDialogWindow(str1,str2);
  *nlr3=lstr;
}