653
654
output(param, " %d,%d", first->x, first->y);
657
static Object_t *_current_obj;
656
658
static gboolean _insert_edge;
657
659
static gint _insert_x;
658
660
static gint _insert_y;
661
polygon_insert_point(GtkWidget *widget, gpointer data)
663
polygon_insert_point(void)
663
Command_t *command = insert_point_command_new(get_popup_object(), _insert_x,
664
_insert_y, _insert_edge);
665
command_execute(command);
665
Command_t *command = insert_point_command_new (_current_obj, _insert_x,
666
_insert_y, _insert_edge);
667
command_execute (command);
669
polygon_delete_point(GtkWidget *widget, gpointer data)
671
polygon_delete_point(void)
671
Command_t *command = delete_point_command_new(get_popup_object(),
673
command_execute(command);
673
Command_t *command = delete_point_command_new(_current_obj, _sash_point);
674
command_execute (command);
715
polygon_handle_popup (GdkEventButton *event, gboolean near_sash,
718
GtkWidget *popup = menu_get_widget ("/PolygonPopupMenu");
719
GtkWidget *delete = menu_get_widget ("/PolygonPopupMenu/DeletePoint");
720
GtkWidget *insert = menu_get_widget ("/PolygonPopupMenu/InsertPoint");
722
gtk_widget_set_sensitive (delete, near_sash);
723
gtk_widget_set_sensitive (insert, near_edge);
725
gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
726
event->button, event->time);
714
730
polygon_do_popup(Object_t *obj, GdkEventButton *event)
716
gint x = get_real_coord((gint) event->x);
717
gint y = get_real_coord((gint) event->y);
719
if (polygon_near_sash(obj, x, y)) {
720
static ObjectPopup_t *delete_popup;
722
delete_popup = make_object_popup();
723
object_popup_prepend_menu(delete_popup, _("Delete Point"),
724
polygon_delete_point, delete_popup);
726
object_handle_popup(delete_popup, obj, event);
728
_insert_edge = polygon_near_edge(obj, x, y);
730
static ObjectPopup_t *insert_popup;
736
insert_popup = make_object_popup();
737
object_popup_prepend_menu(insert_popup, _("Insert Point"),
738
polygon_insert_point, insert_popup);
740
object_handle_popup(insert_popup, obj, event);
742
object_do_popup(obj, event);
732
gint x = get_real_coord ((gint) event->x);
733
gint y = get_real_coord ((gint) event->y);
737
if (polygon_near_sash (obj, x, y))
739
polygon_handle_popup (event, TRUE, FALSE);
743
_insert_edge = polygon_near_edge (obj, x, y);
749
polygon_handle_popup (event, FALSE, TRUE);
752
object_do_popup (obj, event);
747
757
static const gchar*