2 * Grace - GRaphing, Advanced Computation and Exploration of data
4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/
6 * Copyright (c) 2004 Grace Development Team
8 * Maintained by Evgeny Stambulchik
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 RegionUI
*create_region_ui(ExplorerUI
*eui
)
40 form
= CreateVContainer(eui
->scrolled_window
);
41 AddHelpCB(form
, "doc/UsersGuide.html#region-properties");
43 ui
= xmalloc(sizeof(ProjectUI
));
47 ui
->type
= CreateOptionChoiceVA(form
, "Type:",
48 "Polygon", REGION_POLYGON
,
50 /* "Formula", REGION_FORMULA, */
52 AddOptionChoiceCB(ui
->type
, oc_explorer_cb
, eui
);
54 ui
->color
= CreateColorChoice(form
, "Color:");
55 AddOptionChoiceCB(ui
->color
, oc_explorer_cb
, eui
);
60 void update_region_ui(RegionUI
*ui
, Quark
*q
)
62 region
*r
= region_get_data(q
);
64 SetOptionChoice(ui
->type
, r
->type
);
65 SetOptionChoice(ui
->color
, r
->color
);
69 int set_region_data(RegionUI
*ui
, Quark
*q
, void *caller
)
71 int retval
= RETURN_SUCCESS
;
74 if (!caller
|| caller
== ui
->type
) {
75 region_set_type(q
, GetOptionChoice(ui
->type
));
77 if (!caller
|| caller
== ui
->color
) {
78 region_set_color(q
, GetOptionChoice(ui
->color
));