Ejemplo n.º 1
0
/*!
 * \brief edit a layers name, possibly also creating the layer
 */
void 
diagram_edit_layer(Diagram *dia, Layer *layer)
{
  g_return_if_fail(dia != NULL);
  
  layer_dialog_edit_layer (NULL, layer ? NULL : dia, layer);
}
Ejemplo n.º 2
0
static void
layer_dialog_rename_callback(GtkWidget *widget, gpointer gdata)
{
  GtkWidget *selected;
  Diagram *dia;
  Layer *layer;
  dia = layer_dialog->diagram;
  selected = GTK_LIST(layer_dialog->layer_list)->selection->data;
  layer = dia->data->active_layer;
  layer_dialog_edit_layer (DIA_LAYER_WIDGET (selected), dia, layer);
}
Ejemplo n.º 3
0
static gint
layer_list_events (GtkWidget *widget,
		   GdkEvent  *event)
{
  GdkEventKey *kevent;
  GdkEventButton *bevent;
  GtkWidget *event_widget;
  DiaLayerWidget *layer_widget;

  event_widget = gtk_get_event_widget (event);

  if (GTK_IS_LIST_ITEM (event_widget)) {
    layer_widget = DIA_LAYER_WIDGET(event_widget);

    switch (event->type) {
    case GDK_BUTTON_PRESS:
      bevent = (GdkEventButton *) event;
      break;

    case GDK_2BUTTON_PRESS:
      bevent = (GdkEventButton *) event;
      layer_dialog_edit_layer(layer_widget, NULL, NULL);
      return TRUE;

    case GDK_KEY_PRESS:
      kevent = (GdkEventKey *) event;
      switch (kevent->keyval) {
      case GDK_Up:
	/* printf ("up arrow\n"); */
	break;
      case GDK_Down:
	/* printf ("down arrow\n"); */
	break;
      default:
	return FALSE;
      }
      return TRUE;

    default:
      break;
    }
  }

  return FALSE;
}