static void
etfci_set_property (GObject *object,
                    guint property_id,
                    const GValue *value,
                    GParamSpec *pspec)
{
	GnomeCanvasItem *item;
	ETableFieldChooserItem *etfci;

	item = GNOME_CANVAS_ITEM (object);
	etfci = E_TABLE_FIELD_CHOOSER_ITEM (object);

	switch (property_id) {
	case PROP_FULL_HEADER:
		etfci_drop_full_header (etfci);
		if (g_value_get_object (value))
			etfci_add_full_header (
				etfci, E_TABLE_HEADER (
				g_value_get_object (value)));
		break;

	case PROP_HEADER:
		etfci_drop_table_header (etfci);
		if (g_value_get_object (value))
			etfci_add_table_header (
				etfci, E_TABLE_HEADER (
				g_value_get_object (value)));
		break;

	case PROP_DND_CODE:
		g_free (etfci->dnd_code);
		etfci->dnd_code = g_strdup (g_value_get_string (value));
		break;

	case PROP_WIDTH:
		etfci->width = g_value_get_double (value);
		gnome_canvas_item_request_update (item);
		break;
	}
}
Exemplo n.º 2
0
static void
etcta_set_property (GObject *object,
                    guint property_id,
                    const GValue *value,
                    GParamSpec *pspec)
{
	GnomeCanvasItem *item;
	ETableClickToAdd *etcta;

	item = GNOME_CANVAS_ITEM (object);
	etcta = E_TABLE_CLICK_TO_ADD (object);

	switch (property_id) {
	case PROP_HEADER:
		etcta_drop_table_header (etcta);
		etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value)));
		break;
	case PROP_MODEL:
		etcta_drop_model (etcta);
		etcta_add_model (etcta, E_TABLE_MODEL (g_value_get_object (value)));
		break;
	case PROP_MESSAGE:
		etcta_drop_message (etcta);
		etcta_add_message (etcta, g_value_get_string (value));
		break;
	case PROP_WIDTH:
		etcta->width = g_value_get_double (value);
		if (etcta->row)
			gnome_canvas_item_set (
				etcta->row,
				"minimum_width", etcta->width,
				NULL);
		if (etcta->text)
			gnome_canvas_item_set (
				etcta->text,
				"width", (etcta->width < 4 ? 4 : etcta->width) - 4,
				NULL);
		if (etcta->rect)
			gnome_canvas_item_set (
				etcta->rect,
				"x2", etcta->width,
				NULL);
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		return;

	}
	gnome_canvas_item_request_update (item);
}
Exemplo n.º 3
0
static void
etsm_set_property (GObject *object,
                   guint property_id,
                   const GValue *value,
                   GParamSpec *pspec)
{
	ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object);

	switch (property_id) {
	case PROP_MODEL:
		drop_model (etsm);
		add_model (etsm, g_value_get_object (value) ? E_TABLE_MODEL (g_value_get_object (value)) : NULL);
		break;
	case PROP_HEADER:
		etsm->eth = E_TABLE_HEADER (g_value_get_object (value));
		break;
	}
}