2
* FIG : Facility for Interactive Generation of figures
3
* Copyright (c) 1985-1988 by Supoj Sutanthavibul
4
* Parts Copyright (c) 1989-2000 by Brian V. Smith
5
* Parts Copyright (c) 1991 by Paul King
7
* Any party obtaining a copy of these files is granted, free of charge, a
8
* full and unrestricted irrevocable, world-wide, paid up, royalty-free,
9
* nonexclusive right and license to deal in this software and
10
* documentation files (the "Software"), including without limitation the
11
* rights to use, copy, modify, merge, publish, distribute, sublicense,
12
* and/or sell copies of the Software, and to permit persons who receive
13
* copies from any such party to do so, with the only requirement being
14
* that this copyright notice remain intact.
19
#include "resources.h"
24
#include "u_elastic.h"
28
#include "w_msgpanel.h"
29
#include "w_mousefun.h"
31
/*************************** local procedures *********************/
33
static void create_arc_boxobject();
34
static void cancel_arc_boxobject();
35
static void init_arc_box_drawing();
38
arcbox_drawing_selected()
40
set_mousefun("corner point", "", "", "", "", "");
41
canvas_kbd_proc = null_proc;
42
canvas_locmove_proc = null_proc;
43
canvas_leftbut_proc = init_arc_box_drawing;
44
canvas_middlebut_proc = null_proc;
45
canvas_rightbut_proc = null_proc;
46
set_cursor(arrow_cursor);
51
init_arc_box_drawing(x, y)
56
set_mousefun("final point", "", "cancel", "", "", "");
57
draw_mousefun_canvas();
58
canvas_locmove_proc = resizing_box;
59
canvas_leftbut_proc = create_arc_boxobject;
60
canvas_middlebut_proc = null_proc;
61
canvas_rightbut_proc = cancel_arc_boxobject;
62
elastic_box(fix_x, fix_y, cur_x, cur_y);
63
set_cursor(null_cursor);
68
cancel_arc_boxobject()
70
elastic_box(fix_x, fix_y, cur_x, cur_y);
71
arcbox_drawing_selected();
72
draw_mousefun_canvas();
76
create_arc_boxobject(x, y)
82
elastic_box(fix_x, fix_y, cur_x, cur_y);
83
/* erase last lengths if appres.showlengths is true */
86
if (fix_x == x || fix_y == y) {
88
put_msg("Arc box must have area");
89
arcbox_drawing_selected();
90
draw_mousefun_canvas();
94
if ((point = create_point()) == NULL)
101
if ((box = create_line()) == NULL) {
102
free((char *) point);
105
box->type = T_ARC_BOX;
106
box->style = cur_linestyle;
107
box->thickness = cur_linewidth;
108
box->pen_color = cur_pencolor;
109
box->fill_color = cur_fillcolor;
110
box->depth = cur_depth;
112
box->join_style = cur_joinstyle;
113
box->cap_style = cur_capstyle;
114
box->fill_style = cur_fillstyle;
115
/* multiply dash length by line thickness */
116
box->style_val = cur_styleval * (cur_linewidth + 1) / 2;
117
box->radius = cur_boxradius;/* corner radius */
119
append_point(x, fix_y, &point);
120
append_point(fix_x, fix_y, &point);
121
append_point(fix_x, y, &point);
122
append_point(x, y, &point);
124
reset_action_on(); /* this signals redisplay_curobj() not to refresh */
125
/* draw it and anything on top of it */
127
arcbox_drawing_selected();
128
draw_mousefun_canvas();