end drag selections if necessary.

Mon Jan 11 23:52:58 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtklist.c (gtk_list_signal_drag_begin)
	(gtk_list_drag_begin): end drag selections if necessary.

	* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
	public. Manually force synchronization of spin button text and
 	adjustment value.
This commit is contained in:
Lars Hamann 1999-01-11 23:24:41 +00:00 committed by Lars Hamann
parent d2e69a89d4
commit 8b0955954c
10 changed files with 122 additions and 5 deletions

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -1,3 +1,12 @@
Mon Jan 11 23:52:58 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_signal_drag_begin)
(gtk_list_drag_begin): end drag selections if necessary.
* gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function
public. Manually force synchronization of spin button text and
adjustment value.
Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org> Mon Jan 11 15:23:32 1999 Tim Janik <timj@gtk.org>
* gtk/gtktogglebutton.c: eliminated some queue_draws when invoking * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking

View File

@ -103,6 +103,9 @@ static void gtk_list_update_extended_selection (GtkList *list,
gint row); gint row);
/** GtkListItem Signal Functions **/ /** GtkListItem Signal Functions **/
static void gtk_list_signal_drag_begin (GtkWidget *widget,
GdkDragContext *context,
GtkList *list);
static void gtk_list_signal_focus_lost (GtkWidget *item, static void gtk_list_signal_focus_lost (GtkWidget *item,
GdkEventKey *event, GdkEventKey *event,
GtkList *list); GtkList *list);
@ -141,6 +144,10 @@ static void gtk_list_signal_item_toggle (GtkListItem *list_item,
GtkList *list); GtkList *list);
static void gtk_list_drag_begin (GtkWidget *widget,
GdkDragContext *context);
static GtkContainerClass *parent_class = NULL; static GtkContainerClass *parent_class = NULL;
static guint list_signals[LAST_SIGNAL] = { 0 }; static guint list_signals[LAST_SIGNAL] = { 0 };
@ -229,6 +236,7 @@ gtk_list_class_init (GtkListClass *class)
widget_class->motion_notify_event = gtk_list_motion_notify; widget_class->motion_notify_event = gtk_list_motion_notify;
widget_class->size_request = gtk_list_size_request; widget_class->size_request = gtk_list_size_request;
widget_class->size_allocate = gtk_list_size_allocate; widget_class->size_allocate = gtk_list_size_allocate;
widget_class->drag_begin = gtk_list_drag_begin;
container_class->add = gtk_list_add; container_class->add = gtk_list_add;
container_class->remove = gtk_list_remove; container_class->remove = gtk_list_remove;
@ -548,11 +556,9 @@ gtk_list_motion_notify (GtkWidget *widget,
case GTK_SELECTION_BROWSE: case GTK_SELECTION_BROWSE:
gtk_list_select_child (list, item); gtk_list_select_child (list, item);
break; break;
case GTK_SELECTION_EXTENDED: case GTK_SELECTION_EXTENDED:
gtk_list_update_extended_selection (list, row); gtk_list_update_extended_selection (list, row);
break; break;
default: default:
break; break;
} }
@ -1014,6 +1020,9 @@ gtk_list_insert_items (GtkList *list,
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
gtk_widget_set_parent (widget, GTK_WIDGET (list)); gtk_widget_set_parent (widget, GTK_WIDGET (list));
gtk_signal_connect (GTK_OBJECT (widget), "drag_begin",
GTK_SIGNAL_FUNC (gtk_list_signal_drag_begin),
list);
gtk_signal_connect (GTK_OBJECT (widget), "focus_out_event", gtk_signal_connect (GTK_OBJECT (widget), "focus_out_event",
GTK_SIGNAL_FUNC (gtk_list_signal_focus_lost), GTK_SIGNAL_FUNC (gtk_list_signal_focus_lost),
list); list);
@ -2613,3 +2622,47 @@ gtk_list_signal_item_toggle (GtkListItem *list_item,
break; break;
} }
} }
static void
gtk_list_signal_drag_begin (GtkWidget *widget,
GdkDragContext *context,
GtkList *list)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_drag_begin (GTK_WIDGET (list), context);
}
static void
gtk_list_drag_begin (GtkWidget *widget,
GdkDragContext *context)
{
GtkList *list;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
g_return_if_fail (context != NULL);
list = GTK_LIST (widget);
if (list->drag_selection)
{
gtk_list_end_drag_selection (list);
switch (list->selection_mode)
{
case GTK_SELECTION_EXTENDED:
gtk_list_end_selection (list);
break;
case GTK_SELECTION_SINGLE:
case GTK_SELECTION_MULTIPLE:
list->undo_focus_child = NULL;
break;
default:
break;
}
}
}

View File

@ -97,7 +97,6 @@ static gint gtk_spin_button_key_press (GtkWidget *widget,
GdkEventKey *event); GdkEventKey *event);
static gint gtk_spin_button_key_release (GtkWidget *widget, static gint gtk_spin_button_key_release (GtkWidget *widget,
GdkEventKey *event); GdkEventKey *event);
static void gtk_spin_button_update (GtkSpinButton *spin_button);
static void gtk_spin_button_activate (GtkEditable *editable); static void gtk_spin_button_activate (GtkEditable *editable);
static void gtk_spin_button_snap (GtkSpinButton *spin_button, static void gtk_spin_button_snap (GtkSpinButton *spin_button,
gfloat val); gfloat val);
@ -1115,7 +1114,7 @@ gtk_spin_button_snap (GtkSpinButton *spin_button,
} }
} }
static void void
gtk_spin_button_update (GtkSpinButton *spin_button) gtk_spin_button_update (GtkSpinButton *spin_button)
{ {
gfloat val; gfloat val;

View File

@ -141,6 +141,8 @@ void gtk_spin_button_set_shadow_type (GtkSpinButton *spin_button,
void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button, void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button,
gboolean snap_to_ticks); gboolean snap_to_ticks);
void gtk_spin_button_update (GtkSpinButton *spin_button);
/* deprecated */ /* deprecated */
void gtk_spin_button_construct (GtkSpinButton *spin_button, void gtk_spin_button_construct (GtkSpinButton *spin_button,
GtkAdjustment *adjustment, GtkAdjustment *adjustment,