Mapper
redraw_edit_legend.c
Go to the documentation of this file.
1 
2 #include "prototypes_new.h"
3 void redraw_edit_legend(Drawable pixm,int display_flag,int h,int num)
4 
5 {
6 extern int qpf_day_edit_flag,qpf_time_edit_flag;
7 extern int edit_flag;
8 extern Display *display;
9 extern GC gc;
10 extern unsigned long qmap[16];
11 extern Font font[10];
12 extern XFontStruct *info_font[10];
13 extern Widget drawing_area;
14 extern char ebuf[50];
15 extern struct display_set display_set[4];
16 Dimension width,height;
17 Arg args[10];
18 int yheight,ymax;
19 
20 yheight=info_font[4]->ascent+2;
22 
23 XtSetArg(args[0],XtNwidth,&width);
24 XtSetArg(args[1],XtNheight,&height);
25 XtGetValues(drawing_area,args,2);
26 
27 XSetFunction(display,gc,GXcopy);
28 
29 if(qpf_day_edit_flag==0)
30  strcpy(ebuf,"Day 1 ");
31 
32 else
33  strcpy(ebuf,"Day 2 ");
34 
35 if(qpf_time_edit_flag==0)
36  strcat(ebuf,"12Z-18Z");
37 else if(qpf_time_edit_flag==1)
38  strcat(ebuf,"18Z-00Z");
39 else if(qpf_time_edit_flag==2)
40  strcat(ebuf,"00Z-06Z");
41 else if(qpf_time_edit_flag==3)
42  strcat(ebuf,"06Z-12Z");
43 
44 if(edit_flag==1)
45  strcat(ebuf," (Edit Points)");
46 else
47  strcat(ebuf," (Edit Area)");
48 
49 XSetFont(display,gc,font[4]);
50 XSetForeground(display,gc,qmap[15]);
51 
52 XDrawLine(display,pixm,gc,15,ymax/10-(10-num)*yheight-yheight/2,35,
53  ymax/10-(10-num)*yheight-yheight/2);
54 
55 XDrawString(display,pixm,gc,35,ymax/10-(10-num)*yheight,
56  ebuf,strlen(ebuf));
57 
58 }
59 
60 
61 
XFontStruct * info_font[10]
Definition: mapper.c:195
Display * display
Definition: mapper.c:159
Font font[10]
Definition: mapper.c:161
void redraw_edit_legend(Drawable pixm, int display_flag, int h, int num)
unsigned long qmap[16]
Definition: mapper.c:116
int display_flag
Definition: mapper.c:100
long ymax
GC gc
Definition: mapper.c:163
Dimension height
Dimension width
int yheight
Arg args[10]
Widget drawing_area
Definition: mapper.c:185
long ymax[4]
Definition: misc.h:610