Mapper
libraries
common
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;
21
ymax
=
display_set
[
display_flag
].
ymax
[h];
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
info_font
XFontStruct * info_font[10]
Definition:
mapper.c:195
display
Display * display
Definition:
mapper.c:159
font
Font font[10]
Definition:
mapper.c:161
redraw_edit_legend
void redraw_edit_legend(Drawable pixm, int display_flag, int h, int num)
Definition:
redraw_edit_legend.c:3
qmap
unsigned long qmap[16]
Definition:
mapper.c:116
display_flag
int display_flag
Definition:
mapper.c:100
ymax
long ymax
Definition:
plot_qpf_legend.c:26
gc
GC gc
Definition:
mapper.c:163
height
Dimension height
Definition:
plot_qpf_legend.c:22
width
Dimension width
Definition:
plot_qpf_legend.c:22
yheight
int yheight
Definition:
plot_qpf_legend.c:28
args
Arg args[10]
Definition:
plot_qpf_legend.c:23
drawing_area
Widget drawing_area
Definition:
mapper.c:185
prototypes_new.h
display_set
Definition:
misc.h:603
display_set::ymax
long ymax[4]
Definition:
misc.h:610
Generated by
1.9.1