Exemplo n.º 1
0
// take screenshot
TILP_EXPORT void on_tilp_menuitem7_clicked(GtkButton* button, gpointer user_data)
{
	display_screenshot_dbox();
}
Exemplo n.º 2
0
TILP_EXPORT void
on_treeview2_drag_data_received(GtkWidget * widget,
				GdkDragContext * drag_context,
				gint x,
				gint y,
				GtkSelectionData * data,
				guint info, guint _time, gpointer user_data)
{
	if ((data->length >= 0) && (data->format == 8)) 
	{
		gchar *name = (gchar *) data->data;

		//g_print("Received \"%s\" as selection information.\n", name);

		if(strchr(name, '#'))			// Calc
		{
			//on_tilp_button7_clicked(NULL, NULL);
		}
		else if (!strcmp(name, NODE1))	// Screen
		{
			display_screenshot_dbox();
			on_scdbox_button1_clicked(NULL, NULL);

			if (gtk_update.cancel == 0) 
			{
				on_sc_save1_activate(NULL, NULL);
				on_sc_quit1_activate(NULL, NULL);
			}
		} 
		else if (!strcmp(name, NODE2))	// OS
		{
			on_rom_dump1_activate(NULL, NULL);
		} 
		else if (!strcmp(name, NODE3))	// Variables
		{
			// all variables to get
			on_tilp_button5_clicked(NULL, NULL);
			ctree_select_vars(0);
		}
		else if (!strcmp(name, NODE4))	// Apps & Archives
		{
			// all apps to get
			on_tilp_button5_clicked(NULL, NULL);
			ctree_select_vars(0);
		}
		else if (!strcmp(name, NODE5))	// IDlist
		{
			// put IDLIST in a text file
			tilp_calc_idlist(1);
		}
		else if (!strcmp(name, NODE6))	// Clock
		{
		}
		else if (!strcmp(name, NODEx))	// Folder
		{
			// folder to get
			on_tilp_button5_clicked(NULL, NULL);
			ctree_select_vars(0);
		} 
		else 
		{
			// single/group/app to get
			on_tilp_button5_clicked(NULL, NULL);
		}

		gtk_drag_finish(drag_context, TRUE, FALSE, _time);
		return;
	}

	gtk_drag_finish(drag_context, FALSE, FALSE, _time);
	return;
}
Exemplo n.º 3
0
GLADE_CB gboolean
on_treeview1_button_press_event(GtkWidget * widget,
				GdkEventButton * event, gpointer user_data)
{
	GtkTreeView *view = GTK_TREE_VIEW(ctree_wnd);
	GtkTreeModel *model = GTK_TREE_MODEL(tree);
	GtkTreePath *path;
	GtkTreeViewColumn *column;
	GtkTreeIter parent;
	VarEntry *ve;
	gint tx = (gint) event->x;
	gint ty = (gint) event->y;
	gint cx, cy;
	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx, &cy);

	if (path == NULL)
		return FALSE;

	gtk_tree_model_get_iter(model, &parent, path);
	gtk_tree_model_get(model, &parent, COLUMN_DATA, &ve, -1);

	path_to_drag = path;
	gtk_tree_model_get(model, &parent, COLUMN_NAME, &name_to_drag, -1);

	if(event->type == GDK_BUTTON_PRESS)
	{
		if(event->button == 1)
		{
			/*
			printf("clicked !\n");
			ctree_select_vars(!0);
			printf("selected ?!\n");
*/
		}
		else if (event->button == 3) 
		{
			GdkEventButton *bevent = (GdkEventButton *) (event);

			gtk_menu_popup(GTK_MENU(create_ctree_rbm()),
				       NULL, NULL, NULL, NULL,
				       bevent->button, bevent->time);

			return TRUE;
		}
	}

	if (event->type == GDK_2BUTTON_PRESS) 
	{
		gchar *name;

		gtk_tree_model_get(model, &parent, COLUMN_NAME, &name, -1);
		if (!strcmp(name, NODE1))
			display_screenshot_dbox();

		else if (!strcmp(name, NODE2))
			on_rom_dump1_activate(NULL, NULL);

		else if (!strcmp(name, NODE3))
			on_tilp_button3_clicked(NULL, NULL);

		else if(!strcmp(name, NODE5))
			tilp_calc_idlist(0);

		else if(!strcmp(name, NODE6))
			display_clock_dbox();

		else if(!strncmp(name, tifiles_model_to_string(options.calc_model), 4))
		{
			CalcInfos infos;
			tilp_calc_get_infos(&infos);
		}

		return TRUE;
	}

	if (ve == NULL)
		return FALSE;

	if (ve->type != tifiles_folder_type(options.calc_model))
		return FALSE;

	name_to_drag = NODEx;

	return FALSE;		// pass the event on
}