mirror of https://github.com/GNOME/gimp.git
Cursor location in statusbar Fixed resize of window progressbar is smaller
Wed Jul 15 22:06:32 CDT 1998 Shawn T. Amundson <amundson@gimp.org> * Cursor location in statusbar * Fixed resize of window * progressbar is smaller now
This commit is contained in:
parent
b5b15171ca
commit
bb7a8b4802
|
@ -1,3 +1,9 @@
|
|||
Wed Jul 15 22:06:32 CDT 1998 Shawn T. Amundson <amundson@gimp.org>
|
||||
|
||||
* Cursor location in statusbar
|
||||
* Fixed resize of window
|
||||
* progressbar is smaller now
|
||||
|
||||
Thu Jul 16 02:43:51 MEST 1998 Sven Neumann <sven@gimp.org>
|
||||
|
||||
updated MapObject plug-in
|
||||
|
|
|
@ -664,6 +664,10 @@ void
|
|||
gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
||||
{
|
||||
int new_cursor;
|
||||
char *buffer;
|
||||
int buffer_size;
|
||||
int tmp;
|
||||
int t_x, t_y;
|
||||
|
||||
new_cursor = gdisp->draw_cursor && gdisp->proximity;
|
||||
|
||||
|
@ -681,7 +685,47 @@ gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
|||
gdisplay_flush (gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gdisplay_untransform_coords(gdisp, x, y, &t_x, &t_y, TRUE, TRUE);
|
||||
|
||||
if (t_x < 0 || t_y < 0 || t_x > gdisp->gimage->width || t_y > gdisp->gimage->height)
|
||||
{
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_size = 6;
|
||||
tmp = t_x;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
tmp = t_y;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
buffer = malloc(sizeof(char)*buffer_size);
|
||||
sprintf(buffer, " %d, %d ", t_x, t_y);
|
||||
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
gdisp->have_cursor = new_cursor;
|
||||
gdisp->cursor_x = x;
|
||||
gdisp->cursor_y = y;
|
||||
|
|
|
@ -60,6 +60,7 @@ struct _GDisplay
|
|||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
GtkWidget *cursor_label; /* widget for cursor position */
|
||||
GtkWidget *cancelbutton; /* widget for cancel button */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
|
|
|
@ -104,6 +104,9 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gint return_val = FALSE;
|
||||
static gboolean scrolled = FALSE;
|
||||
static guint key_signal_id = 0;
|
||||
int update_cursor = 1;
|
||||
|
||||
tx = ty = 0;
|
||||
|
||||
gdisp = (GDisplay *) gtk_object_get_user_data (GTK_OBJECT (canvas));
|
||||
|
||||
|
@ -162,13 +165,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
break;
|
||||
|
||||
case GDK_PROXIMITY_OUT:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
update_cursor = 0;
|
||||
break;
|
||||
|
||||
case GDK_ENTER_NOTIFY:
|
||||
update_cursor = 0; /* Actually, should figure out tx,ty here */
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
@ -419,7 +424,8 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW);
|
||||
}
|
||||
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
if (update_cursor)
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
|
|
@ -104,6 +104,9 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gint return_val = FALSE;
|
||||
static gboolean scrolled = FALSE;
|
||||
static guint key_signal_id = 0;
|
||||
int update_cursor = 1;
|
||||
|
||||
tx = ty = 0;
|
||||
|
||||
gdisp = (GDisplay *) gtk_object_get_user_data (GTK_OBJECT (canvas));
|
||||
|
||||
|
@ -162,13 +165,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
break;
|
||||
|
||||
case GDK_PROXIMITY_OUT:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
update_cursor = 0;
|
||||
break;
|
||||
|
||||
case GDK_ENTER_NOTIFY:
|
||||
update_cursor = 0; /* Actually, should figure out tx,ty here */
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
@ -419,7 +424,8 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW);
|
||||
}
|
||||
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
if (update_cursor)
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
|
|
@ -664,6 +664,10 @@ void
|
|||
gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
||||
{
|
||||
int new_cursor;
|
||||
char *buffer;
|
||||
int buffer_size;
|
||||
int tmp;
|
||||
int t_x, t_y;
|
||||
|
||||
new_cursor = gdisp->draw_cursor && gdisp->proximity;
|
||||
|
||||
|
@ -681,7 +685,47 @@ gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
|||
gdisplay_flush (gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gdisplay_untransform_coords(gdisp, x, y, &t_x, &t_y, TRUE, TRUE);
|
||||
|
||||
if (t_x < 0 || t_y < 0 || t_x > gdisp->gimage->width || t_y > gdisp->gimage->height)
|
||||
{
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_size = 6;
|
||||
tmp = t_x;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
tmp = t_y;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
buffer = malloc(sizeof(char)*buffer_size);
|
||||
sprintf(buffer, " %d, %d ", t_x, t_y);
|
||||
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
gdisp->have_cursor = new_cursor;
|
||||
gdisp->cursor_x = x;
|
||||
gdisp->cursor_y = y;
|
||||
|
|
|
@ -60,6 +60,7 @@ struct _GDisplay
|
|||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
GtkWidget *cursor_label; /* widget for cursor position */
|
||||
GtkWidget *cancelbutton; /* widget for cancel button */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
|
|
|
@ -104,6 +104,9 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gint return_val = FALSE;
|
||||
static gboolean scrolled = FALSE;
|
||||
static guint key_signal_id = 0;
|
||||
int update_cursor = 1;
|
||||
|
||||
tx = ty = 0;
|
||||
|
||||
gdisp = (GDisplay *) gtk_object_get_user_data (GTK_OBJECT (canvas));
|
||||
|
||||
|
@ -162,13 +165,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
break;
|
||||
|
||||
case GDK_PROXIMITY_OUT:
|
||||
gdisp->proximity = FALSE;
|
||||
gdisplay_update_cursor (gdisp, 0, 0);
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
update_cursor = 0;
|
||||
break;
|
||||
|
||||
case GDK_ENTER_NOTIFY:
|
||||
update_cursor = 0; /* Actually, should figure out tx,ty here */
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
@ -419,7 +424,8 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW);
|
||||
}
|
||||
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
if (update_cursor)
|
||||
gdisplay_update_cursor (gdisp, tx, ty);
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
|
|
@ -554,6 +554,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
GtkWidget *table;
|
||||
GtkWidget *table_inner;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
|
@ -701,7 +702,19 @@ create_display_shell (GDisplay* gdisp,
|
|||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE);
|
||||
|
||||
/* cursor, statusbar, progressbar */
|
||||
frame = gtk_frame_new(NULL);
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cursor_label = gtk_label_new(" 0000, 0000 ");
|
||||
/* This usize should be more intelligent and get the information
|
||||
* size of the above string or some similar method */
|
||||
gtk_widget_set_usize(gdisp->cursor_label, 50, -1);
|
||||
gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label);
|
||||
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar),
|
||||
GTK_RESIZE_QUEUE);
|
||||
|
@ -713,7 +726,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_widget_set_usize(gdisp->progressbar, 80, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cancelbutton = gtk_button_new_with_label("Cancel");
|
||||
|
@ -733,6 +746,8 @@ create_display_shell (GDisplay* gdisp,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (frame);
|
||||
gtk_widget_show (gdisp->cursor_label);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (gdisp->cancelbutton);
|
||||
|
|
|
@ -554,6 +554,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
GtkWidget *table;
|
||||
GtkWidget *table_inner;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
|
@ -701,7 +702,19 @@ create_display_shell (GDisplay* gdisp,
|
|||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE);
|
||||
|
||||
/* cursor, statusbar, progressbar */
|
||||
frame = gtk_frame_new(NULL);
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cursor_label = gtk_label_new(" 0000, 0000 ");
|
||||
/* This usize should be more intelligent and get the information
|
||||
* size of the above string or some similar method */
|
||||
gtk_widget_set_usize(gdisp->cursor_label, 50, -1);
|
||||
gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label);
|
||||
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar),
|
||||
GTK_RESIZE_QUEUE);
|
||||
|
@ -713,7 +726,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_widget_set_usize(gdisp->progressbar, 80, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cancelbutton = gtk_button_new_with_label("Cancel");
|
||||
|
@ -733,6 +746,8 @@ create_display_shell (GDisplay* gdisp,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (frame);
|
||||
gtk_widget_show (gdisp->cursor_label);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (gdisp->cancelbutton);
|
||||
|
|
|
@ -664,6 +664,10 @@ void
|
|||
gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
||||
{
|
||||
int new_cursor;
|
||||
char *buffer;
|
||||
int buffer_size;
|
||||
int tmp;
|
||||
int t_x, t_y;
|
||||
|
||||
new_cursor = gdisp->draw_cursor && gdisp->proximity;
|
||||
|
||||
|
@ -681,7 +685,47 @@ gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
|
|||
gdisplay_flush (gdisp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gdisplay_untransform_coords(gdisp, x, y, &t_x, &t_y, TRUE, TRUE);
|
||||
|
||||
if (t_x < 0 || t_y < 0 || t_x > gdisp->gimage->width || t_y > gdisp->gimage->height)
|
||||
{
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_size = 6;
|
||||
tmp = t_x;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
tmp = t_y;
|
||||
if (tmp < 0)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp *= -1;
|
||||
}
|
||||
while (tmp > 9)
|
||||
{
|
||||
buffer_size++;
|
||||
tmp /= 10;
|
||||
}
|
||||
|
||||
buffer = malloc(sizeof(char)*buffer_size);
|
||||
sprintf(buffer, " %d, %d ", t_x, t_y);
|
||||
|
||||
gtk_label_set(GTK_LABEL (gdisp->cursor_label), buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
gdisp->have_cursor = new_cursor;
|
||||
gdisp->cursor_x = x;
|
||||
gdisp->cursor_y = y;
|
||||
|
|
|
@ -60,6 +60,7 @@ struct _GDisplay
|
|||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
GtkWidget *cursor_label; /* widget for cursor position */
|
||||
GtkWidget *cancelbutton; /* widget for cancel button */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
|
|
|
@ -554,6 +554,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
GtkWidget *table;
|
||||
GtkWidget *table_inner;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
|
@ -701,7 +702,19 @@ create_display_shell (GDisplay* gdisp,
|
|||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE);
|
||||
|
||||
/* cursor, statusbar, progressbar */
|
||||
frame = gtk_frame_new(NULL);
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cursor_label = gtk_label_new(" 0000, 0000 ");
|
||||
/* This usize should be more intelligent and get the information
|
||||
* size of the above string or some similar method */
|
||||
gtk_widget_set_usize(gdisp->cursor_label, 50, -1);
|
||||
gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label);
|
||||
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar),
|
||||
GTK_RESIZE_QUEUE);
|
||||
|
@ -713,7 +726,7 @@ create_display_shell (GDisplay* gdisp,
|
|||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_widget_set_usize(gdisp->progressbar, 80, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
gdisp->cancelbutton = gtk_button_new_with_label("Cancel");
|
||||
|
@ -733,6 +746,8 @@ create_display_shell (GDisplay* gdisp,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (frame);
|
||||
gtk_widget_show (gdisp->cursor_label);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (gdisp->cancelbutton);
|
||||
|
|
Loading…
Reference in New Issue