2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* Copyright (C) 2001 Red Hat, Inc.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
|
|
/*
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2004. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
#include <stdio.h>
|
2004-02-29 18:21:57 +00:00
|
|
|
|
#include <math.h>
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkrange.h"
|
2014-04-05 06:04:12 +00:00
|
|
|
|
#include "gtkrangeprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
|
2014-07-03 00:37:55 +00:00
|
|
|
|
#include "gtkadjustmentprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkcolorscaleprivate.h"
|
|
|
|
|
#include "gtkintl.h"
|
2015-02-22 22:57:23 +00:00
|
|
|
|
#include "gtkgesturelongpressprivate.h"
|
2011-11-11 12:06:56 +00:00
|
|
|
|
#include "gtkmain.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
2011-01-30 08:12:49 +00:00
|
|
|
|
#include "gtkorientableprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2010-05-18 06:46:42 +00:00
|
|
|
|
#include "gtkscale.h"
|
2004-02-29 18:21:57 +00:00
|
|
|
|
#include "gtkscrollbar.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkwindow.h"
|
2014-11-08 17:55:03 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2011-06-28 02:39:43 +00:00
|
|
|
|
#include "a11y/gtkrangeaccessible.h"
|
2010-05-21 00:19:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkrange
|
|
|
|
|
* @Short_description: Base class for widgets which visualize an adjustment
|
|
|
|
|
* @Title: GtkRange
|
|
|
|
|
*
|
|
|
|
|
* #GtkRange is the common base class for widgets which visualize an
|
2010-06-03 05:18:42 +00:00
|
|
|
|
* adjustment, e.g #GtkScale or #GtkScrollbar.
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*
|
|
|
|
|
* Apart from signals for monitoring the parameters of the adjustment,
|
|
|
|
|
* #GtkRange provides properties and methods for influencing the sensitivity
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* of the “steppers”. It also provides properties and methods for setting a
|
|
|
|
|
* “fill level” on range widgets. See gtk_range_set_fill_level().
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
#define TIMEOUT_INITIAL 500
|
2014-11-21 06:16:12 +00:00
|
|
|
|
#define TIMEOUT_REPEAT 250
|
2013-07-29 16:06:20 +00:00
|
|
|
|
#define AUTOSCROLL_FACTOR 20
|
2014-11-21 06:16:12 +00:00
|
|
|
|
#define SCROLL_EDGE_SIZE 15
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
MOUSE_OUTSIDE,
|
|
|
|
|
MOUSE_STEPPER_A,
|
|
|
|
|
MOUSE_STEPPER_B,
|
|
|
|
|
MOUSE_STEPPER_C,
|
|
|
|
|
MOUSE_STEPPER_D,
|
|
|
|
|
MOUSE_TROUGH,
|
|
|
|
|
MOUSE_SLIDER,
|
|
|
|
|
MOUSE_WIDGET /* inside widget but not in any of the above GUI elements */
|
|
|
|
|
} MouseLocation;
|
|
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
|
struct _GtkRangePrivate
|
2010-08-16 06:27:49 +00:00
|
|
|
|
{
|
|
|
|
|
MouseLocation mouse_location;
|
|
|
|
|
/* last mouse coords we got, or -1 if mouse is outside the range */
|
|
|
|
|
gint mouse_x;
|
|
|
|
|
gint mouse_y;
|
|
|
|
|
MouseLocation grab_location; /* "grabbed" mouse location, OUTSIDE for no grab */
|
2010-06-27 01:04:31 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRangeStepTimer *timer;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
|
GtkSensitivityType lower_sensitivity;
|
|
|
|
|
GtkSensitivityType upper_sensitivity;
|
|
|
|
|
|
|
|
|
|
GdkRectangle range_rect; /* Area of entire stepper + trough assembly in widget->window coords */
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* These are in widget->window coordinates */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GdkRectangle stepper_a;
|
|
|
|
|
GdkRectangle stepper_b;
|
|
|
|
|
GdkRectangle stepper_c;
|
|
|
|
|
GdkRectangle stepper_d;
|
|
|
|
|
GdkRectangle trough; /* The trough rectangle is the area the thumb can slide in, not the entire range_rect */
|
|
|
|
|
GdkRectangle slider;
|
|
|
|
|
GdkWindow *event_window;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2011-04-12 16:42:14 +00:00
|
|
|
|
GtkOrientation orientation;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gdouble fill_level;
|
|
|
|
|
gdouble *marks;
|
|
|
|
|
|
|
|
|
|
gint *mark_pos;
|
|
|
|
|
gint min_slider_size;
|
|
|
|
|
gint n_marks;
|
|
|
|
|
gint round_digits; /* Round off value to this many digits, -1 for no rounding */
|
|
|
|
|
gint slide_initial_slider_position;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gint slide_initial_coordinate_delta;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
/* Steppers are: < > ---- < >
|
|
|
|
|
* a b c d
|
|
|
|
|
*/
|
|
|
|
|
guint has_stepper_a : 1;
|
|
|
|
|
guint has_stepper_b : 1;
|
|
|
|
|
guint has_stepper_c : 1;
|
|
|
|
|
guint has_stepper_d : 1;
|
|
|
|
|
|
|
|
|
|
guint flippable : 1;
|
|
|
|
|
guint inverted : 1;
|
2011-04-12 16:42:14 +00:00
|
|
|
|
guint recalc_marks : 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint slider_size_fixed : 1;
|
|
|
|
|
guint trough_click_forward : 1; /* trough click was on the forward side of slider */
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
|
|
|
|
/* Stepper sensitivity */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint lower_sensitive : 1;
|
|
|
|
|
guint upper_sensitive : 1;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
/* The range has an origin, should be drawn differently. Used by GtkScale */
|
|
|
|
|
guint has_origin : 1;
|
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
/* Whether we're doing fine adjustment */
|
|
|
|
|
guint zoom : 1;
|
2014-04-08 19:21:14 +00:00
|
|
|
|
GtkGesture *long_press_gesture;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
GtkScrollType autoscroll_mode;
|
|
|
|
|
guint autoscroll_id;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkGesture *multipress_gesture;
|
|
|
|
|
GtkGesture *drag_gesture;
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/* Fill level */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint show_fill_level : 1;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
guint restrict_to_fill_level : 1;
|
2014-07-08 13:35:18 +00:00
|
|
|
|
|
|
|
|
|
/* Whether dragging is ongoing */
|
|
|
|
|
guint in_drag : 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
};
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-06-27 01:04:31 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_ORIENTATION,
|
|
|
|
|
PROP_ADJUSTMENT,
|
|
|
|
|
PROP_INVERTED,
|
|
|
|
|
PROP_LOWER_STEPPER_SENSITIVITY,
|
|
|
|
|
PROP_UPPER_STEPPER_SENSITIVITY,
|
|
|
|
|
PROP_SHOW_FILL_LEVEL,
|
|
|
|
|
PROP_RESTRICT_TO_FILL_LEVEL,
|
2011-01-15 05:08:39 +00:00
|
|
|
|
PROP_FILL_LEVEL,
|
|
|
|
|
PROP_ROUND_DIGITS
|
2010-08-16 06:27:49 +00:00
|
|
|
|
};
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
enum {
|
|
|
|
|
VALUE_CHANGED,
|
|
|
|
|
ADJUST_BOUNDS,
|
|
|
|
|
MOVE_SLIDER,
|
|
|
|
|
CHANGE_VALUE,
|
|
|
|
|
LAST_SIGNAL
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
STEPPER_A,
|
|
|
|
|
STEPPER_B,
|
|
|
|
|
STEPPER_C,
|
|
|
|
|
STEPPER_D
|
|
|
|
|
} Stepper;
|
2001-07-14 11:35:24 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_range_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void gtk_range_destroy (GtkWidget *widget);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
static void gtk_range_get_preferred_width
|
|
|
|
|
(GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
|
|
|
|
static void gtk_range_get_preferred_height
|
|
|
|
|
(GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
|
static void gtk_range_realize (GtkWidget *widget);
|
|
|
|
|
static void gtk_range_unrealize (GtkWidget *widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void gtk_range_map (GtkWidget *widget);
|
|
|
|
|
static void gtk_range_unmap (GtkWidget *widget);
|
2010-09-04 19:44:54 +00:00
|
|
|
|
static gboolean gtk_range_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
|
|
|
|
static void gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
2014-09-27 02:21:11 +00:00
|
|
|
|
static void gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_drag_gesture_end (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean gtk_range_scroll_event (GtkWidget *widget,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GdkEventScroll *event);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static gboolean gtk_range_event (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event);
|
2001-07-14 11:35:24 +00:00
|
|
|
|
static void update_slider_position (GtkRange *range,
|
|
|
|
|
gint mouse_x,
|
|
|
|
|
gint mouse_y);
|
2005-03-22 17:36:41 +00:00
|
|
|
|
static void stop_scrolling (GtkRange *range);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
static void add_autoscroll (GtkRange *range);
|
|
|
|
|
static void remove_autoscroll (GtkRange *range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
/* Range methods */
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static void gtk_range_move_slider (GtkRange *range,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkScrollType scroll);
|
|
|
|
|
|
|
|
|
|
/* Internals */
|
2014-11-25 22:13:21 +00:00
|
|
|
|
static void gtk_range_compute_slider_position (GtkRange *range,
|
|
|
|
|
gdouble adjustment_value,
|
|
|
|
|
GdkRectangle *slider_rect);
|
2007-01-02 16:40:44 +00:00
|
|
|
|
static gboolean gtk_range_scroll (GtkRange *range,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkScrollType scroll);
|
2014-11-29 02:27:36 +00:00
|
|
|
|
static void gtk_range_update_mouse_location (GtkRange *range);
|
2014-11-29 00:23:54 +00:00
|
|
|
|
static void gtk_range_calc_slider (GtkRange *range);
|
|
|
|
|
static void gtk_range_calc_stepper_sensitivity (GtkRange *range);
|
2014-11-25 22:21:48 +00:00
|
|
|
|
static void gtk_range_calc_layout (GtkRange *range);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void gtk_range_calc_marks (GtkRange *range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_get_props (GtkRange *range,
|
|
|
|
|
gint *slider_width,
|
|
|
|
|
gint *stepper_size,
|
|
|
|
|
gint *trough_border,
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gint *stepper_spacing,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean *trough_under_steppers,
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gint *arrow_displacement_x,
|
|
|
|
|
gint *arrow_displacement_y);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_calc_request (GtkRange *range,
|
|
|
|
|
gint slider_width,
|
|
|
|
|
gint stepper_size,
|
|
|
|
|
gint trough_border,
|
|
|
|
|
gint stepper_spacing,
|
|
|
|
|
GdkRectangle *range_rect,
|
|
|
|
|
GtkBorder *border,
|
|
|
|
|
gint *n_steppers_p,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean *has_steppers_ab,
|
2014-11-21 07:00:52 +00:00
|
|
|
|
gboolean *has_steppers_cd);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_range_add_step_timer (GtkRange *range,
|
|
|
|
|
GtkScrollType step);
|
|
|
|
|
static void gtk_range_remove_step_timer (GtkRange *range);
|
2014-11-29 00:39:09 +00:00
|
|
|
|
static void gtk_range_queue_draw_location (GtkRange *range,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
MouseLocation location);
|
2004-09-13 16:09:37 +00:00
|
|
|
|
static gboolean gtk_range_real_change_value (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll,
|
|
|
|
|
gdouble value);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
static gboolean gtk_range_key_press (GtkWidget *range,
|
|
|
|
|
GdkEventKey *event);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2008-11-11 17:47:13 +00:00
|
|
|
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkRange, gtk_range, GTK_TYPE_WIDGET,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkRange)
|
2008-11-11 17:47:13 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
|
|
|
|
|
NULL))
|
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static guint signals[LAST_SIGNAL];
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_class_init (GtkRangeClass *class)
|
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class->set_property = gtk_range_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_range_get_property;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
widget_class->destroy = gtk_range_destroy;
|
2010-10-27 12:10:40 +00:00
|
|
|
|
widget_class->get_preferred_width = gtk_range_get_preferred_width;
|
|
|
|
|
widget_class->get_preferred_height = gtk_range_get_preferred_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
widget_class->size_allocate = gtk_range_size_allocate;
|
|
|
|
|
widget_class->realize = gtk_range_realize;
|
2010-10-08 05:37:33 +00:00
|
|
|
|
widget_class->unrealize = gtk_range_unrealize;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
widget_class->map = gtk_range_map;
|
|
|
|
|
widget_class->unmap = gtk_range_unmap;
|
2010-09-04 19:44:54 +00:00
|
|
|
|
widget_class->draw = gtk_range_draw;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
widget_class->event = gtk_range_event;
|
2000-02-18 20:02:24 +00:00
|
|
|
|
widget_class->scroll_event = gtk_range_scroll_event;
|
2006-03-11 05:47:09 +00:00
|
|
|
|
widget_class->key_press_event = gtk_range_key_press;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
|
|
|
|
|
class->move_slider = gtk_range_move_slider;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
class->change_value = gtk_range_real_change_value;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
2007-07-12 00:57:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange::value-changed:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-07-12 00:57:23 +00:00
|
|
|
|
*
|
|
|
|
|
* Emitted when the range value changes.
|
|
|
|
|
*/
|
2001-06-05 20:07:02 +00:00
|
|
|
|
signals[VALUE_CHANGED] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("value-changed"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, value_changed),
|
|
|
|
|
NULL, NULL,
|
2008-08-13 18:44:11 +00:00
|
|
|
|
_gtk_marshal_VOID__VOID,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-05-21 00:19:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange::adjust-bounds:
|
|
|
|
|
* @range: the #GtkRange that received the signal
|
|
|
|
|
* @value: the value before we clamp
|
2010-05-25 13:44:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Emitted before clamping a value, to give the application a
|
|
|
|
|
* chance to adjust the bounds.
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*/
|
2002-02-15 05:53:08 +00:00
|
|
|
|
signals[ADJUST_BOUNDS] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("adjust-bounds"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2002-02-15 05:53:08 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, adjust_bounds),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__DOUBLE,
|
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
|
G_TYPE_DOUBLE);
|
|
|
|
|
|
2007-07-12 00:57:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange::move-slider:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-07-12 00:57:23 +00:00
|
|
|
|
* @step: how to move the slider
|
|
|
|
|
*
|
|
|
|
|
* Virtual function that moves the slider. Used for keybindings.
|
|
|
|
|
*/
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
signals[MOVE_SLIDER] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("move-slider"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, move_slider),
|
|
|
|
|
NULL, NULL,
|
2001-11-17 23:28:51 +00:00
|
|
|
|
_gtk_marshal_VOID__ENUM,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
|
GTK_TYPE_SCROLL_TYPE);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange::change-value:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* @scroll: the type of scroll action that was performed
|
|
|
|
|
* @value: the new value resulting from the scroll action
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* The #GtkRange::change-value signal is emitted when a scroll action is
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* performed on a range. It allows an application to determine the
|
|
|
|
|
* type of scroll event that occurred and the resultant new value.
|
|
|
|
|
* The application can handle the event itself and return %TRUE to
|
|
|
|
|
* prevent further processing. Or, by returning %FALSE, it can pass
|
|
|
|
|
* the event to other handlers until the default GTK+ handler is
|
|
|
|
|
* reached.
|
|
|
|
|
*
|
|
|
|
|
* The value parameter is unrounded. An application that overrides
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* the GtkRange::change-value signal is responsible for clamping the
|
|
|
|
|
* value to the desired number of decimal digits; the default GTK+
|
|
|
|
|
* handler clamps the value based on #GtkRange:round-digits.
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*
|
|
|
|
|
* It is not possible to use delayed update policies in an overridden
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* #GtkRange::change-value handler.
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*
|
2011-11-21 18:12:58 +00:00
|
|
|
|
* Returns: %TRUE to prevent other handlers from being invoked for
|
|
|
|
|
* the signal, %FALSE to propagate the signal further
|
|
|
|
|
*
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
|
|
|
|
signals[CHANGE_VALUE] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("change-value"),
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, change_value),
|
|
|
|
|
_gtk_boolean_handled_accumulator, NULL,
|
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM_DOUBLE,
|
|
|
|
|
G_TYPE_BOOLEAN, 2,
|
|
|
|
|
GTK_TYPE_SCROLL_TYPE,
|
|
|
|
|
G_TYPE_DOUBLE);
|
2008-06-20 11:08:57 +00:00
|
|
|
|
|
2008-11-11 17:47:13 +00:00
|
|
|
|
g_object_class_override_property (gobject_class,
|
|
|
|
|
PROP_ORIENTATION,
|
|
|
|
|
"orientation");
|
|
|
|
|
|
2001-05-17 16:22:06 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_ADJUSTMENT,
|
|
|
|
|
g_param_spec_object ("adjustment",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Adjustment"),
|
|
|
|
|
P_("The GtkAdjustment that contains the current value of this range object"),
|
2001-05-17 16:22:06 +00:00
|
|
|
|
GTK_TYPE_ADJUSTMENT,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2001-06-06 20:39:02 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_INVERTED,
|
|
|
|
|
g_param_spec_boolean ("inverted",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Inverted"),
|
|
|
|
|
P_("Invert direction slider moves to increase range value"),
|
2001-06-06 20:39:02 +00:00
|
|
|
|
FALSE,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_LOWER_STEPPER_SENSITIVITY,
|
|
|
|
|
g_param_spec_enum ("lower-stepper-sensitivity",
|
|
|
|
|
P_("Lower stepper sensitivity"),
|
|
|
|
|
P_("The sensitivity policy for the stepper that points to the adjustment's lower side"),
|
|
|
|
|
GTK_TYPE_SENSITIVITY_TYPE,
|
|
|
|
|
GTK_SENSITIVITY_AUTO,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_UPPER_STEPPER_SENSITIVITY,
|
|
|
|
|
g_param_spec_enum ("upper-stepper-sensitivity",
|
|
|
|
|
P_("Upper stepper sensitivity"),
|
|
|
|
|
P_("The sensitivity policy for the stepper that points to the adjustment's upper side"),
|
|
|
|
|
GTK_TYPE_SENSITIVITY_TYPE,
|
|
|
|
|
GTK_SENSITIVITY_AUTO,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:show-fill-level:
|
|
|
|
|
*
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* The show-fill-level property controls whether fill level indicator
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* graphics are displayed on the trough. See
|
|
|
|
|
* gtk_range_set_show_fill_level().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_FILL_LEVEL,
|
|
|
|
|
g_param_spec_boolean ("show-fill-level",
|
|
|
|
|
P_("Show Fill Level"),
|
|
|
|
|
P_("Whether to display a fill level indicator graphics on trough."),
|
|
|
|
|
FALSE,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:restrict-to-fill-level:
|
|
|
|
|
*
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* The restrict-to-fill-level property controls whether slider
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* movement is restricted to an upper boundary set by the
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* fill level. See gtk_range_set_restrict_to_fill_level().
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_RESTRICT_TO_FILL_LEVEL,
|
|
|
|
|
g_param_spec_boolean ("restrict-to-fill-level",
|
|
|
|
|
P_("Restrict to Fill Level"),
|
|
|
|
|
P_("Whether to restrict the upper boundary to the fill level."),
|
|
|
|
|
TRUE,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:fill-level:
|
|
|
|
|
*
|
|
|
|
|
* The fill level (e.g. prebuffering of a network stream).
|
|
|
|
|
* See gtk_range_set_fill_level().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_FILL_LEVEL,
|
|
|
|
|
g_param_spec_double ("fill-level",
|
|
|
|
|
P_("Fill Level"),
|
|
|
|
|
P_("The fill level."),
|
|
|
|
|
-G_MAXDOUBLE,
|
|
|
|
|
G_MAXDOUBLE,
|
|
|
|
|
G_MAXDOUBLE,
|
2014-06-09 13:21:11 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:round-digits:
|
|
|
|
|
*
|
|
|
|
|
* The number of digits to round the value to when
|
|
|
|
|
* it changes, or -1. See #GtkRange::change-value.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_ROUND_DIGITS,
|
|
|
|
|
g_param_spec_int ("round-digits",
|
|
|
|
|
P_("Round Digits"),
|
2011-01-15 05:16:51 +00:00
|
|
|
|
P_("The number of digits to round the value to."),
|
2014-06-09 13:21:11 +00:00
|
|
|
|
-1, G_MAXINT, -1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2011-01-15 05:08:39 +00:00
|
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("slider-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Slider Width"),
|
|
|
|
|
P_("Width of scrollbar or scale thumb"),
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
14,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("trough-border",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Trough Border"),
|
|
|
|
|
P_("Spacing between thumb/steppers and outer trough bevel"),
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
1,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("stepper-size",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Stepper Size"),
|
|
|
|
|
P_("Length of step buttons at ends"),
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
14,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
2006-06-09 13:48:07 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:stepper-spacing:
|
|
|
|
|
*
|
|
|
|
|
* The spacing between the stepper buttons and thumb. Note that
|
|
|
|
|
* stepper-spacing won't have any effect if there are no steppers.
|
|
|
|
|
*/
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("stepper-spacing",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Stepper Spacing"),
|
|
|
|
|
P_("Spacing between step buttons and thumb"),
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
0,
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("arrow-displacement-x",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Arrow X Displacement"),
|
|
|
|
|
P_("How far in the x direction to move the arrow when the button is depressed"),
|
2002-02-26 23:50:14 +00:00
|
|
|
|
G_MININT,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("arrow-displacement-y",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Arrow Y Displacement"),
|
|
|
|
|
P_("How far in the y direction to move the arrow when the button is depressed"),
|
2002-02-26 23:50:14 +00:00
|
|
|
|
G_MININT,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READABLE));
|
2006-03-11 04:09:38 +00:00
|
|
|
|
|
2006-06-09 13:48:07 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:trough-under-steppers:
|
|
|
|
|
*
|
|
|
|
|
* Whether to draw the trough across the full length of the range or
|
range: allow stepper-spacing > 0 and trough-under-steppers = TRUE
Commit 4bb3d6441439e4d99255a3a08b39da7100ced953 introduced a limitation
to GtkRange style properties; when stepper-spacing is > 0,
trough-under-steppers is automatically set to FALSE; this means that
setting a spacing between the steppers (e.g. the scrollbar buttons) and
the trough (i.e. the area over which the slider is free to move) would
make the buttons always get the full allocation on the !orientation
direction.
The rationale is without this limitation, you would get an area which
seems clickable, but it's actually not.
While this is true, and undesirable, for big stepper spacings, themes
that use trough-under-steppers (which is TRUE by default anyway),
might want to set smaller spacings to avoid drawing a double line between
the button and the slider borders.
To add confusion, the documentation got it flipped, i.e. it stated
setting a positive stepper-spacing would set trough-under-steppers to
TRUE (which would also make the behavior expected by commit
4bb3d6441439e4d99255a3a08b39da7100ced953 impossible).
I don't think hardcoding either of the two limitations is a good thing.
We should let themes handle this instead, and remove this limitation. If
you want the old behavior, you can manually set trough-under-steppers to
FALSE if you set a positive stepper-spacing in your theme.
https://bugzilla.gnome.org/show_bug.cgi?id=644777
2011-03-14 22:21:47 +00:00
|
|
|
|
* to exclude the steppers and their spacing.
|
2006-06-09 13:48:07 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
|
g_param_spec_boolean ("trough-under-steppers",
|
|
|
|
|
P_("Trough Under Steppers"),
|
2006-12-31 05:09:01 +00:00
|
|
|
|
P_("Whether to draw trough for full length of range or exclude the steppers and spacing"),
|
2006-06-09 13:48:07 +00:00
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READABLE));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2008-08-02 04:52:54 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:arrow-scaling:
|
|
|
|
|
*
|
|
|
|
|
* The arrow size proportion relative to the scroll button size.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.14
|
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
|
g_param_spec_float ("arrow-scaling",
|
|
|
|
|
P_("Arrow scaling"),
|
|
|
|
|
P_("Arrow scaling with regard to scroll button size"),
|
|
|
|
|
0.0, 1.0, 0.5,
|
|
|
|
|
GTK_PARAM_READABLE));
|
|
|
|
|
|
2011-06-28 02:39:43 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_RANGE_ACCESSIBLE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_range_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2014-06-09 13:21:11 +00:00
|
|
|
|
if (priv->orientation != g_value_get_enum (value))
|
|
|
|
|
{
|
|
|
|
|
priv->orientation = g_value_get_enum (value);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2014-06-09 13:21:11 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2008-11-11 17:47:13 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ADJUSTMENT:
|
|
|
|
|
gtk_range_set_adjustment (range, g_value_get_object (value));
|
|
|
|
|
break;
|
2001-06-06 20:39:02 +00:00
|
|
|
|
case PROP_INVERTED:
|
|
|
|
|
gtk_range_set_inverted (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
case PROP_LOWER_STEPPER_SENSITIVITY:
|
|
|
|
|
gtk_range_set_lower_stepper_sensitivity (range, g_value_get_enum (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER_STEPPER_SENSITIVITY:
|
|
|
|
|
gtk_range_set_upper_stepper_sensitivity (range, g_value_get_enum (value));
|
|
|
|
|
break;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
case PROP_SHOW_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_show_fill_level (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_RESTRICT_TO_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_restrict_to_fill_level (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_fill_level (range, g_value_get_double (value));
|
|
|
|
|
break;
|
2011-01-15 05:08:39 +00:00
|
|
|
|
case PROP_ROUND_DIGITS:
|
|
|
|
|
gtk_range_set_round_digits (range, g_value_get_int (value));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_range_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_enum (value, priv->orientation);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ADJUSTMENT:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_object (value, priv->adjustment);
|
2001-05-17 16:22:06 +00:00
|
|
|
|
break;
|
2001-06-06 20:39:02 +00:00
|
|
|
|
case PROP_INVERTED:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_boolean (value, priv->inverted);
|
2001-06-06 20:39:02 +00:00
|
|
|
|
break;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
case PROP_LOWER_STEPPER_SENSITIVITY:
|
|
|
|
|
g_value_set_enum (value, gtk_range_get_lower_stepper_sensitivity (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER_STEPPER_SENSITIVITY:
|
|
|
|
|
g_value_set_enum (value, gtk_range_get_upper_stepper_sensitivity (range));
|
|
|
|
|
break;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
case PROP_SHOW_FILL_LEVEL:
|
|
|
|
|
g_value_set_boolean (value, gtk_range_get_show_fill_level (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_RESTRICT_TO_FILL_LEVEL:
|
|
|
|
|
g_value_set_boolean (value, gtk_range_get_restrict_to_fill_level (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_FILL_LEVEL:
|
|
|
|
|
g_value_set_double (value, gtk_range_get_fill_level (range));
|
|
|
|
|
break;
|
2011-01-15 05:08:39 +00:00
|
|
|
|
case PROP_ROUND_DIGITS:
|
|
|
|
|
g_value_set_int (value, gtk_range_get_round_digits (range));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_init (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
range->priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2010-03-06 10:29:31 +00:00
|
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (range), FALSE);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
priv->adjustment = NULL;
|
|
|
|
|
priv->inverted = FALSE;
|
|
|
|
|
priv->flippable = FALSE;
|
|
|
|
|
priv->min_slider_size = 1;
|
|
|
|
|
priv->has_stepper_a = FALSE;
|
|
|
|
|
priv->has_stepper_b = FALSE;
|
|
|
|
|
priv->has_stepper_c = FALSE;
|
|
|
|
|
priv->has_stepper_d = FALSE;
|
|
|
|
|
priv->round_digits = -1;
|
|
|
|
|
priv->mouse_location = MOUSE_OUTSIDE;
|
|
|
|
|
priv->mouse_x = -1;
|
|
|
|
|
priv->mouse_y = -1;
|
|
|
|
|
priv->grab_location = MOUSE_OUTSIDE;
|
|
|
|
|
priv->lower_sensitivity = GTK_SENSITIVITY_AUTO;
|
|
|
|
|
priv->upper_sensitivity = GTK_SENSITIVITY_AUTO;
|
|
|
|
|
priv->lower_sensitive = TRUE;
|
|
|
|
|
priv->upper_sensitive = TRUE;
|
2011-12-14 16:16:09 +00:00
|
|
|
|
priv->has_origin = FALSE;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->show_fill_level = FALSE;
|
|
|
|
|
priv->restrict_to_fill_level = TRUE;
|
|
|
|
|
priv->fill_level = G_MAXDOUBLE;
|
|
|
|
|
priv->timer = NULL;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2014-07-18 23:39:32 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
|
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
/* Note: Order is important here.
|
|
|
|
|
* The ::drag-begin handler relies on the state set up by the
|
|
|
|
|
* multipress ::pressed handler. Gestures are handling events
|
|
|
|
|
* in the oppposite order in which they are added to their
|
|
|
|
|
* widget.
|
|
|
|
|
*/
|
|
|
|
|
priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (range));
|
|
|
|
|
g_signal_connect (priv->drag_gesture, "drag-begin",
|
|
|
|
|
G_CALLBACK (gtk_range_drag_gesture_begin), range);
|
|
|
|
|
g_signal_connect (priv->drag_gesture, "drag-update",
|
|
|
|
|
G_CALLBACK (gtk_range_drag_gesture_update), range);
|
|
|
|
|
g_signal_connect (priv->drag_gesture, "drag-end",
|
|
|
|
|
G_CALLBACK (gtk_range_drag_gesture_end), range);
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (range));
|
2014-08-12 12:02:24 +00:00
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
g_signal_connect (priv->multipress_gesture, "pressed",
|
|
|
|
|
G_CALLBACK (gtk_range_multipress_gesture_pressed), range);
|
|
|
|
|
g_signal_connect (priv->multipress_gesture, "released",
|
|
|
|
|
G_CALLBACK (gtk_range_multipress_gesture_released), range);
|
|
|
|
|
|
|
|
|
|
priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (range));
|
2015-02-22 22:57:23 +00:00
|
|
|
|
g_object_set (priv->long_press_gesture, "delay-factor", 2.0, NULL);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_gesture_group (priv->drag_gesture, priv->long_press_gesture);
|
|
|
|
|
g_signal_connect (priv->long_press_gesture, "pressed",
|
|
|
|
|
G_CALLBACK (gtk_range_long_press_gesture_pressed), range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_adjustment:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Get the #GtkAdjustment which is the “model” object for #GtkRange.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
* See gtk_range_set_adjustment() for details.
|
|
|
|
|
* The return value does not have a reference added, so should not
|
|
|
|
|
* be unreferenced.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (transfer none): a #GtkAdjustment
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkAdjustment*
|
|
|
|
|
gtk_range_get_adjustment (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (!priv->adjustment)
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
gtk_range_set_adjustment (range, NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return priv->adjustment;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_adjustment:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @adjustment: a #GtkAdjustment
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Sets the adjustment to be used as the “model” object for this range
|
2001-06-05 20:07:02 +00:00
|
|
|
|
* widget. The adjustment indicates the current range value, the
|
|
|
|
|
* minimum and maximum range values, the step/page increments used
|
|
|
|
|
* for keybindings and scrolling, and the page size. The page size
|
|
|
|
|
* is normally 0 for #GtkScale and nonzero for #GtkScrollbar, and
|
|
|
|
|
* indicates the size of the visible area of the widget being scrolled.
|
|
|
|
|
* The page size affects the size of the scrollbar slider.
|
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_set_adjustment (GtkRange *range,
|
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
if (!adjustment)
|
2010-09-27 13:10:12 +00:00
|
|
|
|
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
else
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment != adjustment)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment)
|
1997-12-18 02:17:14 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_value_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_object_unref (priv->adjustment);
|
1997-12-18 02:17:14 +00:00
|
|
|
|
}
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->adjustment = adjustment;
|
2005-11-23 18:06:58 +00:00
|
|
|
|
g_object_ref_sink (adjustment);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_connect (adjustment, "changed",
|
|
|
|
|
G_CALLBACK (gtk_range_adjustment_changed),
|
|
|
|
|
range);
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_CALLBACK (gtk_range_adjustment_value_changed),
|
|
|
|
|
range);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_adjustment_changed (adjustment, range);
|
2001-05-17 16:22:06 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "adjustment");
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_inverted:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @setting: %TRUE to invert the range
|
|
|
|
|
*
|
|
|
|
|
* Ranges normally move from lower to higher values as the
|
|
|
|
|
* slider moves from top to bottom or left to right. Inverted
|
|
|
|
|
* ranges have higher values at the top or on the right rather than
|
|
|
|
|
* on the bottom or left.
|
|
|
|
|
**/
|
2001-02-17 00:11:03 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_set_inverted (GtkRange *range,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (setting != priv->inverted)
|
2001-02-17 00:11:03 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->inverted = setting;
|
2001-06-06 20:39:02 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "inverted");
|
2001-02-17 00:11:03 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_inverted:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_range_set_inverted().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the range is inverted
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
2001-02-17 00:11:03 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_inverted (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->inverted;
|
2001-02-17 00:11:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_flippable:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @flippable: %TRUE to make the range flippable
|
|
|
|
|
*
|
|
|
|
|
* If a range is flippable, it will switch its direction if it is
|
|
|
|
|
* horizontal and its direction is %GTK_TEXT_DIR_RTL.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_widget_get_direction().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.18
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_flippable (GtkRange *range,
|
|
|
|
|
gboolean flippable)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
flippable = flippable ? TRUE : FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (flippable != priv->flippable)
|
2009-08-27 19:12:32 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->flippable = flippable;
|
2009-08-27 19:12:32 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_flippable:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_range_set_flippable().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the range is flippable
|
2009-08-27 19:12:32 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.18
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_flippable (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->flippable;
|
2009-08-27 19:12:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_slider_size_fixed:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @size_fixed: %TRUE to make the slider size constant
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Sets whether the range’s slider has a fixed size, or a size that
|
|
|
|
|
* depends on its adjustment’s page size.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_slider_size_fixed (GtkRange *range,
|
|
|
|
|
gboolean size_fixed)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (size_fixed != priv->slider_size_fixed)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->slider_size_fixed = size_fixed ? TRUE : FALSE;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment && gtk_widget_get_mapped (GTK_WIDGET (range)))
|
2014-11-29 00:23:54 +00:00
|
|
|
|
gtk_range_calc_slider (range);
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_slider_size_fixed:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_range_set_slider_size_fixed().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether the range’s slider has a fixed size.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_slider_size_fixed (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->slider_size_fixed;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_min_slider_size:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @min_size: The slider’s minimum size
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Sets the minimum size of the range’s slider.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_min_slider_size (GtkRange *range,
|
2010-08-13 00:49:27 +00:00
|
|
|
|
gint min_size)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (min_size > 0);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (min_size != priv->min_slider_size)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->min_slider_size = min_size;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2014-11-29 00:15:36 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_min_slider_size:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_range_set_min_slider_size().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The minimum size of the range’s slider.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
gint
|
|
|
|
|
gtk_range_get_min_slider_size (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->min_slider_size;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_range_rect:
|
|
|
|
|
* @range: a #GtkRange
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @range_rect: (out): return location for the range rectangle
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* This function returns the area that contains the range’s trough
|
2010-01-22 15:52:56 +00:00
|
|
|
|
* and its steppers, in widget->window coordinates.
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_range_rect (GtkRange *range,
|
|
|
|
|
GdkRectangle *range_rect)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (range_rect != NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (range);
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
*range_rect = priv->range_rect;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_slider_range:
|
|
|
|
|
* @range: a #GtkRange
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @slider_start: (out) (allow-none): return location for the slider's
|
|
|
|
|
* start, or %NULL
|
|
|
|
|
* @slider_end: (out) (allow-none): return location for the slider's
|
|
|
|
|
* end, or %NULL
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function returns sliders range along the long dimension,
|
|
|
|
|
* in widget->window coordinates.
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_slider_range (GtkRange *range,
|
|
|
|
|
gint *slider_start,
|
|
|
|
|
gint *slider_end)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (range);
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
|
|
|
|
*slider_start = priv->slider.y;
|
|
|
|
|
if (slider_end)
|
|
|
|
|
*slider_end = priv->slider.y + priv->slider.height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
|
|
|
|
*slider_start = priv->slider.x;
|
|
|
|
|
if (slider_end)
|
|
|
|
|
*slider_end = priv->slider.x + priv->slider.width;
|
|
|
|
|
}
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_lower_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @sensitivity: the lower stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'lower' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2006-05-08 14:50:33 +00:00
|
|
|
|
* Since: 2.10
|
2005-11-11 12:48:29 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
|
|
|
|
|
GtkSensitivityType sensitivity)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->lower_sensitivity != sensitivity)
|
2005-11-11 12:48:29 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->lower_sensitivity = sensitivity;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "lower-stepper-sensitivity");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_lower_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'lower' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The lower stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
|
|
|
|
**/
|
|
|
|
|
GtkSensitivityType
|
|
|
|
|
gtk_range_get_lower_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_SENSITIVITY_AUTO);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->lower_sensitivity;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_upper_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @sensitivity: the upper stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'upper' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2006-05-08 14:50:33 +00:00
|
|
|
|
* Since: 2.10
|
2005-11-11 12:48:29 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
|
|
|
|
|
GtkSensitivityType sensitivity)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->upper_sensitivity != sensitivity)
|
2005-11-11 12:48:29 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->upper_sensitivity = sensitivity;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "upper-stepper-sensitivity");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_upper_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'upper' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The upper stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
|
|
|
|
**/
|
|
|
|
|
GtkSensitivityType
|
|
|
|
|
gtk_range_get_upper_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_SENSITIVITY_AUTO);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->upper_sensitivity;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_increments:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @step: step size
|
|
|
|
|
* @page: page size
|
|
|
|
|
*
|
|
|
|
|
* Sets the step and page sizes for the range.
|
|
|
|
|
* The step size is used when the user clicks the #GtkScrollbar
|
|
|
|
|
* arrows or moves #GtkScale via arrow keys. The page size
|
|
|
|
|
* is used for example when moving via Page Up or Page Down keys.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_increments (GtkRange *range,
|
|
|
|
|
gdouble step,
|
|
|
|
|
gdouble page)
|
|
|
|
|
{
|
2011-01-05 21:06:55 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
adjustment = range->priv->adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
gtk_adjustment_configure (adjustment,
|
|
|
|
|
gtk_adjustment_get_value (adjustment),
|
|
|
|
|
gtk_adjustment_get_lower (adjustment),
|
|
|
|
|
gtk_adjustment_get_upper (adjustment),
|
|
|
|
|
step,
|
|
|
|
|
page,
|
|
|
|
|
gtk_adjustment_get_page_size (adjustment));
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_range:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @min: minimum range value
|
|
|
|
|
* @max: maximum range value
|
|
|
|
|
*
|
|
|
|
|
* Sets the allowable values in the #GtkRange, and clamps the range
|
2002-02-27 15:43:43 +00:00
|
|
|
|
* value to be between @min and @max. (If the range has a non-zero
|
|
|
|
|
* page size, it is clamped between @min and @max - page-size.)
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_range (GtkRange *range,
|
|
|
|
|
gdouble min,
|
|
|
|
|
gdouble max)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2011-01-05 21:06:55 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
2001-06-05 20:07:02 +00:00
|
|
|
|
gdouble value;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-11-22 17:46:25 +00:00
|
|
|
|
g_return_if_fail (min <= max);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
2011-01-05 21:06:55 +00:00
|
|
|
|
adjustment = priv->adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
value = gtk_adjustment_get_value (adjustment);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:06:55 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
gtk_adjustment_configure (adjustment,
|
|
|
|
|
value,
|
|
|
|
|
min,
|
|
|
|
|
max,
|
|
|
|
|
gtk_adjustment_get_step_increment (adjustment),
|
|
|
|
|
gtk_adjustment_get_page_increment (adjustment),
|
|
|
|
|
gtk_adjustment_get_page_size (adjustment));
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_value:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @value: new value of the range
|
|
|
|
|
*
|
|
|
|
|
* Sets the current value of the range; if the value is outside the
|
|
|
|
|
* minimum or maximum range values, it will be clamped to fit inside
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* them. The range emits the #GtkRange::value-changed signal if the
|
|
|
|
|
* value changes.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_value (GtkRange *range,
|
|
|
|
|
gdouble value)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (priv->adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gtk_adjustment_set_value (priv->adjustment, value);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_value:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the current value of the range.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: current value of the range.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
|
|
|
|
gdouble
|
|
|
|
|
gtk_range_get_value (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
return gtk_adjustment_get_value (range->priv->adjustment);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_show_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
* @show_fill_level: Whether a fill level indicator graphics is shown.
|
|
|
|
|
*
|
|
|
|
|
* Sets whether a graphical fill level is show on the trough. See
|
|
|
|
|
* gtk_range_set_fill_level() for a general description of the fill
|
|
|
|
|
* level concept.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_show_fill_level (GtkRange *range,
|
|
|
|
|
gboolean show_fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
show_fill_level = show_fill_level ? TRUE : FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (show_fill_level != priv->show_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->show_fill_level = show_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "show-fill-level");
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_show_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets whether the range displays the fill level graphically.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @range shows the fill level.
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_show_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->show_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_restrict_to_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
* @restrict_to_fill_level: Whether the fill level restricts slider movement.
|
|
|
|
|
*
|
|
|
|
|
* Sets whether the slider is restricted to the fill level. See
|
|
|
|
|
* gtk_range_set_fill_level() for a general description of the fill
|
|
|
|
|
* level concept.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_restrict_to_fill_level (GtkRange *range,
|
|
|
|
|
gboolean restrict_to_fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
restrict_to_fill_level = restrict_to_fill_level ? TRUE : FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (restrict_to_fill_level != priv->restrict_to_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->restrict_to_fill_level = restrict_to_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "restrict-to-fill-level");
|
|
|
|
|
|
|
|
|
|
gtk_range_set_value (range, gtk_range_get_value (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_restrict_to_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets whether the range is restricted to the fill level.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @range is restricted to the fill level.
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_restrict_to_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->restrict_to_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_fill_level:
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @fill_level: the new position of the fill level indicator
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Set the new position of the fill level indicator.
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* The “fill level” is probably best described by its most prominent
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* use case, which is an indicator for the amount of pre-buffering in
|
|
|
|
|
* a streaming media player. In that use case, the value of the range
|
|
|
|
|
* would indicate the current play position, and the fill level would
|
|
|
|
|
* be the position up to which the file/stream has been downloaded.
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* This amount of prebuffering can be displayed on the range’s trough
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* and is themeable separately from the trough. To enable fill level
|
|
|
|
|
* display, use gtk_range_set_show_fill_level(). The range defaults
|
|
|
|
|
* to not showing the fill level.
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Additionally, it’s possible to restrict the range’s slider position
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* to values which are smaller than the fill level. This is controller
|
|
|
|
|
* by gtk_range_set_restrict_to_fill_level() and is by default
|
|
|
|
|
* enabled.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_fill_level (GtkRange *range,
|
|
|
|
|
gdouble fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (fill_level != priv->fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level = fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (range), "fill-level");
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->show_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
gtk_range_set_value (range, gtk_range_get_value (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_fill_level:
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* @range: A #GtkRange
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets the current position of the fill level indicator.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current fill level
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gdouble
|
|
|
|
|
gtk_range_get_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
should_invert (GtkRange *range)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return
|
2010-08-16 06:27:49 +00:00
|
|
|
|
(priv->inverted && !priv->flippable) ||
|
|
|
|
|
(priv->inverted && priv->flippable && gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_LTR) ||
|
|
|
|
|
(!priv->inverted && priv->flippable && gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_RTL);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return priv->inverted;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
2010-09-18 23:55:42 +00:00
|
|
|
|
gtk_range_destroy (GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-09-18 23:55:42 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_remove_step_timer (range);
|
2007-09-06 11:44:22 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
g_clear_object (&priv->drag_gesture);
|
|
|
|
|
g_clear_object (&priv->multipress_gesture);
|
2014-05-26 12:02:30 +00:00
|
|
|
|
g_clear_object (&priv->long_press_gesture);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_value_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_object_unref (priv->adjustment);
|
|
|
|
|
priv->adjustment = NULL;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->n_marks)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->marks);
|
|
|
|
|
priv->marks = NULL;
|
|
|
|
|
g_free (priv->mark_pos);
|
|
|
|
|
priv->mark_pos = NULL;
|
|
|
|
|
priv->n_marks = 0;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->destroy (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
2010-10-27 12:10:40 +00:00
|
|
|
|
gtk_range_get_preferred_width (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkRange *range;
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gint slider_width, stepper_size, trough_border, stepper_spacing;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GdkRectangle range_rect;
|
|
|
|
|
GtkBorder border;
|
2010-10-27 12:10:40 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
range = GTK_RANGE (widget);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_get_props (range,
|
|
|
|
|
&slider_width, &stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
&trough_border,
|
2010-10-27 12:10:40 +00:00
|
|
|
|
&stepper_spacing, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
gtk_range_calc_request (range,
|
|
|
|
|
slider_width, stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
trough_border, stepper_spacing,
|
2014-11-21 07:00:52 +00:00
|
|
|
|
&range_rect, &border, NULL, NULL, NULL);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
|
|
|
|
|
*minimum = *natural = range_rect.width + border.left + border.right;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_get_preferred_height (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range;
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gint slider_width, stepper_size, trough_border, stepper_spacing;
|
2010-10-27 12:10:40 +00:00
|
|
|
|
GdkRectangle range_rect;
|
|
|
|
|
GtkBorder border;
|
|
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_get_props (range,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&slider_width, &stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
&trough_border,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&stepper_spacing, NULL,
|
|
|
|
|
NULL, NULL);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-10-08 05:37:33 +00:00
|
|
|
|
gtk_range_calc_request (range,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
slider_width, stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
trough_border, stepper_spacing,
|
2014-11-21 07:00:52 +00:00
|
|
|
|
&range_rect, &border, NULL, NULL, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-10-27 12:10:40 +00:00
|
|
|
|
*minimum = *natural = range_rect.height + border.top + border.bottom;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-11 21:03:15 +00:00
|
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->recalc_marks = TRUE;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
|
if (gtk_widget_get_realized (widget))
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_move_resize (priv->event_window,
|
2010-08-11 21:03:15 +00:00
|
|
|
|
allocation->x, allocation->y,
|
|
|
|
|
allocation->width, allocation->height);
|
2014-11-08 17:55:03 +00:00
|
|
|
|
|
|
|
|
|
_gtk_widget_set_simple_clip (widget, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_realize (GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GtkAllocation allocation;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GdkWindow *window;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GdkWindowAttr attributes;
|
2010-10-08 05:37:33 +00:00
|
|
|
|
gint attributes_mask;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (range);
|
2010-10-08 05:37:33 +00:00
|
|
|
|
|
2010-03-06 10:51:33 +00:00
|
|
|
|
gtk_widget_set_realized (widget, TRUE);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-11 21:03:15 +00:00
|
|
|
|
window = gtk_widget_get_parent_window (widget);
|
|
|
|
|
gtk_widget_set_window (widget, window);
|
|
|
|
|
g_object_ref (window);
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
attributes.x = allocation.x;
|
|
|
|
|
attributes.y = allocation.y;
|
|
|
|
|
attributes.width = allocation.width;
|
|
|
|
|
attributes.height = allocation.height;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
attributes.wclass = GDK_INPUT_ONLY;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget);
|
2015-03-22 04:49:16 +00:00
|
|
|
|
attributes.event_mask |= GDK_BUTTON_PRESS_MASK |
|
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
|
GDK_SCROLL_MASK |
|
|
|
|
|
GDK_SMOOTH_SCROLL_MASK |
|
|
|
|
|
GDK_ENTER_NOTIFY_MASK |
|
|
|
|
|
GDK_LEAVE_NOTIFY_MASK |
|
|
|
|
|
GDK_POINTER_MOTION_MASK;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
2001-11-15 21:04:51 +00:00
|
|
|
|
&attributes, attributes_mask);
|
2013-02-05 08:36:49 +00:00
|
|
|
|
gtk_widget_register_window (widget, priv->event_window);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_unrealize (GtkWidget *widget)
|
2000-07-14 20:24:14 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2000-07-14 20:24:14 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_remove_step_timer (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2013-02-05 08:36:49 +00:00
|
|
|
|
gtk_widget_unregister_window (widget, priv->event_window);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_destroy (priv->event_window);
|
|
|
|
|
priv->event_window = NULL;
|
2008-08-12 09:06:34 +00:00
|
|
|
|
|
2008-08-12 09:44:32 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->unrealize (widget);
|
2000-07-14 20:24:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_map (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gdk_window_show (priv->event_window);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->map (widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_unmap (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-03-22 17:36:41 +00:00
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_hide (priv->event_window);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->unmap (widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
static void
|
|
|
|
|
_gtk_range_update_context_for_stepper (GtkRange *range,
|
|
|
|
|
GtkStyleContext *context,
|
|
|
|
|
Stepper stepper)
|
2008-11-11 17:47:13 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
GtkJunctionSides sides = 0;
|
|
|
|
|
gboolean vertical, is_rtl;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
vertical = (priv->orientation == GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
is_rtl = (gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_RTL);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
/* Take junction sides from what's been
|
|
|
|
|
* previously set to the widget itself
|
|
|
|
|
*/
|
|
|
|
|
sides = gtk_style_context_get_junction_sides (context);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
if (vertical)
|
|
|
|
|
sides &= ~(GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM);
|
|
|
|
|
else
|
|
|
|
|
sides &= ~(GTK_JUNCTION_LEFT | GTK_JUNCTION_RIGHT);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-09-02 01:48:44 +00:00
|
|
|
|
switch (stepper)
|
2008-11-11 17:47:13 +00:00
|
|
|
|
{
|
2010-09-02 01:48:44 +00:00
|
|
|
|
case STEPPER_A:
|
2010-12-13 12:43:52 +00:00
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_BOTTOM;
|
|
|
|
|
else
|
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_LEFT : GTK_JUNCTION_RIGHT;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_B:
|
|
|
|
|
if (priv->has_stepper_a)
|
2010-12-13 12:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_TOP;
|
|
|
|
|
else
|
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_RIGHT : GTK_JUNCTION_LEFT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_BOTTOM;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
else
|
2010-12-13 12:43:52 +00:00
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_LEFT : GTK_JUNCTION_RIGHT;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_C:
|
|
|
|
|
if (priv->has_stepper_d)
|
2010-12-13 12:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_BOTTOM;
|
|
|
|
|
else
|
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_LEFT : GTK_JUNCTION_RIGHT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_TOP;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
else
|
2010-12-13 12:43:52 +00:00
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_RIGHT : GTK_JUNCTION_LEFT;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_D:
|
2010-12-13 12:43:52 +00:00
|
|
|
|
if (vertical)
|
|
|
|
|
sides |= GTK_JUNCTION_TOP;
|
|
|
|
|
else
|
|
|
|
|
sides |= (is_rtl) ? GTK_JUNCTION_RIGHT : GTK_JUNCTION_LEFT;
|
2010-09-02 01:48:44 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_set_junction_sides (context, sides);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-07-14 20:24:14 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
draw_stepper (GtkRange *range,
|
2010-06-27 01:04:31 +00:00
|
|
|
|
Stepper stepper,
|
2010-09-04 19:34:01 +00:00
|
|
|
|
cairo_t *cr,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkArrowType arrow_type,
|
|
|
|
|
gboolean clicked,
|
2011-12-21 15:01:02 +00:00
|
|
|
|
gboolean prelighted,
|
|
|
|
|
GtkStateFlags state)
|
2000-07-14 20:24:14 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GtkAllocation allocation;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
GtkStyleContext *context;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2008-08-02 04:52:54 +00:00
|
|
|
|
gfloat arrow_scaling;
|
2010-06-27 01:04:31 +00:00
|
|
|
|
GdkRectangle *rect;
|
2011-02-27 00:29:08 +00:00
|
|
|
|
gdouble arrow_x;
|
|
|
|
|
gdouble arrow_y;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gdouble arrow_size, angle;
|
2010-11-10 02:08:14 +00:00
|
|
|
|
gboolean arrow_sensitive;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
|
2010-06-27 01:04:31 +00:00
|
|
|
|
switch (stepper)
|
|
|
|
|
{
|
|
|
|
|
case STEPPER_A:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
rect = &priv->stepper_a;
|
2010-06-27 01:04:31 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_B:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
rect = &priv->stepper_b;
|
2010-06-27 01:04:31 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_C:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
rect = &priv->stepper_c;
|
2010-06-27 01:04:31 +00:00
|
|
|
|
break;
|
|
|
|
|
case STEPPER_D:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
rect = &priv->stepper_d;
|
2010-06-27 01:04:31 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-11 21:03:15 +00:00
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if ((!priv->inverted && (arrow_type == GTK_ARROW_DOWN ||
|
2005-11-11 12:48:29 +00:00
|
|
|
|
arrow_type == GTK_ARROW_RIGHT)) ||
|
2010-08-16 06:27:49 +00:00
|
|
|
|
(priv->inverted && (arrow_type == GTK_ARROW_UP ||
|
2005-11-11 12:48:29 +00:00
|
|
|
|
arrow_type == GTK_ARROW_LEFT)))
|
2005-11-09 15:32:51 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
arrow_sensitive = priv->upper_sensitive;
|
2005-11-09 15:32:51 +00:00
|
|
|
|
}
|
2005-11-11 12:48:29 +00:00
|
|
|
|
else
|
2005-11-09 15:32:51 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
arrow_sensitive = priv->lower_sensitive;
|
2005-11-09 15:32:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-12-21 15:01:02 +00:00
|
|
|
|
state &= ~(GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT);
|
|
|
|
|
|
|
|
|
|
if ((state & GTK_STATE_FLAG_INSENSITIVE) || !arrow_sensitive)
|
|
|
|
|
{
|
|
|
|
|
state |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
|
}
|
2001-02-17 00:11:03 +00:00
|
|
|
|
else
|
2010-12-13 12:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
if (clicked)
|
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
|
if (prelighted)
|
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
}
|
2002-02-26 23:50:14 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
2011-02-27 00:28:33 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
/* don't set junction sides on scrollbar steppers */
|
2011-02-27 00:28:33 +00:00
|
|
|
|
if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_SCROLLBAR))
|
|
|
|
|
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_NONE);
|
|
|
|
|
else
|
|
|
|
|
_gtk_range_update_context_for_stepper (range, context, stepper);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_set_state (context, state);
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
2011-11-17 16:34:05 +00:00
|
|
|
|
switch (arrow_type)
|
|
|
|
|
{
|
|
|
|
|
case GTK_ARROW_RIGHT:
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_DOWN:
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_LEFT:
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_UP:
|
|
|
|
|
default:
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_render_background (context, cr,
|
|
|
|
|
rect->x, rect->y,
|
|
|
|
|
rect->width, rect->height);
|
|
|
|
|
gtk_render_frame (context, cr,
|
|
|
|
|
rect->x, rect->y,
|
|
|
|
|
rect->width, rect->height);
|
2002-02-26 23:50:14 +00:00
|
|
|
|
|
2008-08-02 04:52:54 +00:00
|
|
|
|
gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
|
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
arrow_size = MIN (rect->width, rect->height) * arrow_scaling;
|
|
|
|
|
arrow_x = rect->x + (rect->width - arrow_size) / 2;
|
|
|
|
|
arrow_y = rect->y + (rect->height - arrow_size) / 2;
|
2008-08-02 04:52:54 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
if (clicked && arrow_sensitive)
|
2002-02-26 23:50:14 +00:00
|
|
|
|
{
|
|
|
|
|
gint arrow_displacement_x;
|
|
|
|
|
gint arrow_displacement_y;
|
|
|
|
|
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gtk_range_get_props (GTK_RANGE (widget),
|
2014-05-04 18:35:01 +00:00
|
|
|
|
NULL, NULL, NULL, NULL, NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
&arrow_displacement_x, &arrow_displacement_y);
|
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
|
arrow_x += arrow_displacement_x;
|
|
|
|
|
arrow_y += arrow_displacement_y;
|
|
|
|
|
}
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
switch (arrow_type)
|
|
|
|
|
{
|
|
|
|
|
case GTK_ARROW_RIGHT:
|
|
|
|
|
angle = G_PI / 2;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_DOWN:
|
|
|
|
|
angle = G_PI;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_LEFT:
|
|
|
|
|
angle = 3 * (G_PI / 2);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_ARROW_UP:
|
|
|
|
|
default:
|
|
|
|
|
angle = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_render_arrow (context, cr,
|
|
|
|
|
angle,
|
|
|
|
|
arrow_x, arrow_y,
|
|
|
|
|
arrow_size);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
2001-02-17 00:11:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_range_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2007-09-06 11:44:22 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2011-12-21 15:01:02 +00:00
|
|
|
|
GtkStateFlags widget_state;
|
2010-11-22 17:46:25 +00:00
|
|
|
|
gboolean draw_trough = TRUE;
|
2012-02-02 05:58:49 +00:00
|
|
|
|
gboolean draw_slider = TRUE;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
GtkStyleContext *context;
|
2012-05-16 21:01:33 +00:00
|
|
|
|
GtkBorder margin;
|
2006-03-09 18:48:38 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
2010-11-22 17:46:25 +00:00
|
|
|
|
if (GTK_IS_SCALE (widget) &&
|
2011-01-05 21:08:45 +00:00
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) == gtk_adjustment_get_lower (priv->adjustment))
|
2012-02-02 05:58:49 +00:00
|
|
|
|
{
|
|
|
|
|
draw_trough = TRUE;
|
|
|
|
|
draw_slider = FALSE;
|
|
|
|
|
}
|
|
|
|
|
if (GTK_IS_COLOR_SCALE (widget))
|
|
|
|
|
{
|
|
|
|
|
draw_trough = FALSE;
|
|
|
|
|
draw_slider = TRUE;
|
|
|
|
|
}
|
2010-11-22 17:46:25 +00:00
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gtk_range_calc_marks (range);
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (range);
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
|
2011-12-21 15:01:02 +00:00
|
|
|
|
widget_state = gtk_widget_get_state_flags (widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Just to be confusing, we draw the trough for the whole
|
|
|
|
|
* range rectangle, not the trough rectangle (the trough
|
|
|
|
|
* rectangle is just for hit detection)
|
|
|
|
|
*/
|
2010-09-04 19:34:01 +00:00
|
|
|
|
cairo_save (cr);
|
|
|
|
|
gdk_cairo_rectangle (cr, &priv->range_rect);
|
|
|
|
|
cairo_clip (cr);
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gint x = priv->range_rect.x;
|
|
|
|
|
gint y = priv->range_rect.y;
|
|
|
|
|
gint width = priv->range_rect.width;
|
|
|
|
|
gint height = priv->range_rect.height;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean trough_under_steppers;
|
|
|
|
|
gint stepper_size;
|
|
|
|
|
gint stepper_spacing;
|
|
|
|
|
|
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (range),
|
|
|
|
|
"trough-under-steppers", &trough_under_steppers,
|
|
|
|
|
"stepper-size", &stepper_size,
|
|
|
|
|
"stepper-spacing", &stepper_spacing,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2010-09-02 01:30:47 +00:00
|
|
|
|
if (!trough_under_steppers)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
|
|
|
|
gint offset = 0;
|
|
|
|
|
gint shorter = 0;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
offset += stepper_size;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_b)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
offset += stepper_size;
|
|
|
|
|
|
|
|
|
|
shorter += offset;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
shorter += stepper_size;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_d)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
shorter += stepper_size;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a || priv->has_stepper_b)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
|
|
|
|
offset += stepper_spacing;
|
|
|
|
|
shorter += stepper_spacing;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c || priv->has_stepper_d)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
|
|
|
|
shorter += stepper_spacing;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
|
|
|
|
x += offset;
|
|
|
|
|
width -= shorter;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
y += offset;
|
|
|
|
|
height -= shorter;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
|
2012-05-16 21:01:33 +00:00
|
|
|
|
gtk_style_context_get_margin (context, widget_state, &margin);
|
|
|
|
|
|
|
|
|
|
x += margin.left;
|
|
|
|
|
y += margin.top;
|
|
|
|
|
width -= margin.left + margin.right;
|
|
|
|
|
height -= margin.top + margin.bottom;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
|
2010-11-22 17:46:25 +00:00
|
|
|
|
if (draw_trough)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
2013-02-27 22:18:28 +00:00
|
|
|
|
if (!priv->has_origin || !draw_slider)
|
2011-12-14 16:16:09 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_render_background (context, cr,
|
|
|
|
|
x, y, width, height);
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
gtk_render_frame (context, cr,
|
|
|
|
|
x, y, width, height);
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
else
|
2011-12-14 16:16:09 +00:00
|
|
|
|
{
|
|
|
|
|
gint trough_change_pos_x = width;
|
|
|
|
|
gint trough_change_pos_y = height;
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
trough_change_pos_x = (priv->slider.x +
|
|
|
|
|
priv->slider.width / 2 -
|
|
|
|
|
x);
|
|
|
|
|
else
|
|
|
|
|
trough_change_pos_y = (priv->slider.y +
|
|
|
|
|
priv->slider.height / 2 -
|
|
|
|
|
y);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-03-24 21:14:27 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
|
2011-12-14 16:16:09 +00:00
|
|
|
|
else
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
|
2015-03-24 21:14:27 +00:00
|
|
|
|
if (!should_invert (range))
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HIGHLIGHT);
|
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
gtk_render_background (context, cr, x, y,
|
|
|
|
|
trough_change_pos_x,
|
|
|
|
|
trough_change_pos_y);
|
|
|
|
|
|
|
|
|
|
gtk_render_frame (context, cr, x, y,
|
|
|
|
|
trough_change_pos_x,
|
|
|
|
|
trough_change_pos_y);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
trough_change_pos_y = 0;
|
|
|
|
|
else
|
|
|
|
|
trough_change_pos_x = 0;
|
|
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-03-24 21:14:27 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
|
2011-12-14 16:16:09 +00:00
|
|
|
|
else
|
2015-03-24 21:14:27 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HIGHLIGHT);
|
2011-12-14 16:16:09 +00:00
|
|
|
|
|
|
|
|
|
gtk_render_background (context, cr,
|
|
|
|
|
x + trough_change_pos_x, y + trough_change_pos_y,
|
|
|
|
|
width - trough_change_pos_x,
|
|
|
|
|
height - trough_change_pos_y);
|
|
|
|
|
|
|
|
|
|
gtk_render_frame (context, cr,
|
|
|
|
|
x + trough_change_pos_x, y + trough_change_pos_y,
|
|
|
|
|
width - trough_change_pos_x,
|
|
|
|
|
height - trough_change_pos_y);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
}
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->show_fill_level &&
|
2011-01-05 21:08:45 +00:00
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) != 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
2015-03-24 21:31:52 +00:00
|
|
|
|
gdouble fill_level = priv->fill_level;
|
|
|
|
|
gint fill_x = x;
|
|
|
|
|
gint fill_y = y;
|
|
|
|
|
gint fill_width = width;
|
|
|
|
|
gint fill_height = height;
|
|
|
|
|
gdouble fill_proportion = 0.0;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
fill_level = CLAMP (fill_level, gtk_adjustment_get_lower (priv->adjustment),
|
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2015-03-24 21:31:52 +00:00
|
|
|
|
fill_proportion = (fill_level - gtk_adjustment_get_lower (priv->adjustment)) /
|
2011-01-05 21:08:45 +00:00
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
2015-03-24 21:31:52 +00:00
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2015-03-24 21:31:52 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (!should_invert (range))
|
|
|
|
|
{
|
|
|
|
|
fill_x = priv->slider.x + (priv->slider.width / 2);
|
|
|
|
|
fill_width = (width * fill_proportion) - fill_x + x;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fill_x = x + width * (1.0 - fill_proportion);
|
|
|
|
|
fill_width = priv->slider.x + (priv->slider.width / 2) - fill_x;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-03-24 21:31:52 +00:00
|
|
|
|
if (!should_invert (range))
|
|
|
|
|
{
|
|
|
|
|
fill_y = priv->slider.y + (priv->slider.height / 2);
|
|
|
|
|
fill_height = (height * fill_proportion) - fill_y + y;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fill_y = y + height * (1.0 - fill_proportion);
|
|
|
|
|
fill_height = priv->slider.y + (priv->slider.height / 2) - fill_y;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2014-08-14 23:58:49 +00:00
|
|
|
|
gtk_render_background (context, cr, fill_x, fill_y, fill_width, fill_height);
|
|
|
|
|
gtk_render_frame (context, cr, fill_x, fill_y, fill_width, fill_height);
|
2010-12-13 12:43:52 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-12-21 15:01:02 +00:00
|
|
|
|
if (!(widget_state & GTK_STATE_FLAG_INSENSITIVE) && gtk_widget_has_visible_focus (widget))
|
2010-12-13 12:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_render_focus (context, cr,
|
|
|
|
|
priv->range_rect.x,
|
|
|
|
|
priv->range_rect.y,
|
|
|
|
|
priv->range_rect.width,
|
|
|
|
|
priv->range_rect.height);
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-04 19:34:01 +00:00
|
|
|
|
cairo_restore (cr);
|
|
|
|
|
|
2012-02-02 05:58:49 +00:00
|
|
|
|
if (draw_slider)
|
2011-12-21 15:01:02 +00:00
|
|
|
|
{
|
|
|
|
|
GtkStateFlags state = widget_state;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
|
2011-12-21 15:01:02 +00:00
|
|
|
|
state &= ~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
|
2006-03-11 04:09:38 +00:00
|
|
|
|
|
2011-12-12 18:14:43 +00:00
|
|
|
|
if (priv->mouse_location == MOUSE_SLIDER && !(state & GTK_STATE_FLAG_INSENSITIVE))
|
2011-12-21 15:01:02 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
|
|
|
|
|
if (priv->grab_location == MOUSE_SLIDER)
|
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
gdk_cairo_rectangle (cr, &priv->slider);
|
|
|
|
|
cairo_clip (cr);
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
|
2014-11-12 16:20:53 +00:00
|
|
|
|
gtk_style_context_get_margin (context, widget_state, &margin);
|
2010-12-13 12:43:52 +00:00
|
|
|
|
gtk_style_context_set_state (context, state);
|
|
|
|
|
|
|
|
|
|
gtk_render_slider (context, cr,
|
2014-11-12 16:20:53 +00:00
|
|
|
|
priv->slider.x + margin.left,
|
|
|
|
|
priv->slider.y + margin.top,
|
|
|
|
|
priv->slider.width - margin.left - margin.right,
|
|
|
|
|
priv->slider.height - margin.top - margin.bottom,
|
2010-12-13 12:43:52 +00:00
|
|
|
|
priv->orientation);
|
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-12-21 15:01:02 +00:00
|
|
|
|
cairo_restore (cr);
|
|
|
|
|
}
|
2010-09-04 19:34:01 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a)
|
2010-09-04 19:34:01 +00:00
|
|
|
|
draw_stepper (range, STEPPER_A, cr,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_UP : GTK_ARROW_LEFT,
|
|
|
|
|
priv->grab_location == MOUSE_STEPPER_A,
|
2011-12-12 18:14:43 +00:00
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_A,
|
2011-12-21 15:01:02 +00:00
|
|
|
|
widget_state);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_b)
|
2010-09-04 19:34:01 +00:00
|
|
|
|
draw_stepper (range, STEPPER_B, cr,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
|
|
|
|
|
priv->grab_location == MOUSE_STEPPER_B,
|
2011-12-12 18:14:43 +00:00
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_B,
|
2011-12-21 15:01:02 +00:00
|
|
|
|
widget_state);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c)
|
2010-09-04 19:34:01 +00:00
|
|
|
|
draw_stepper (range, STEPPER_C, cr,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_UP : GTK_ARROW_LEFT,
|
|
|
|
|
priv->grab_location == MOUSE_STEPPER_C,
|
2011-12-12 18:14:43 +00:00
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_C,
|
2011-12-21 15:01:02 +00:00
|
|
|
|
widget_state);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_d)
|
2010-09-04 19:34:01 +00:00
|
|
|
|
draw_stepper (range, STEPPER_D, cr,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
|
|
|
|
|
priv->grab_location == MOUSE_STEPPER_D,
|
2011-12-12 18:14:43 +00:00
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_D,
|
2011-12-21 15:01:02 +00:00
|
|
|
|
widget_state);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
range_grab_add (GtkRange *range,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
MouseLocation location)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-10-05 21:29:32 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2012-01-04 23:27:57 +00:00
|
|
|
|
/* Don't perform any GDK/GTK+ grab here. Since a button
|
|
|
|
|
* is down, there's an ongoing implicit grab on
|
|
|
|
|
* priv->event_window, which pretty much guarantees this
|
|
|
|
|
* is the only widget receiving the pointer events.
|
|
|
|
|
*/
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->grab_location = location;
|
2014-11-29 02:23:58 +00:00
|
|
|
|
gtk_range_queue_draw_location (range, location);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2014-10-05 21:29:32 +00:00
|
|
|
|
gtk_style_context_add_class (context, "dragging");
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
static void
|
|
|
|
|
update_zoom_state (GtkRange *range,
|
|
|
|
|
gboolean enabled)
|
|
|
|
|
{
|
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
|
|
|
|
|
|
|
|
|
if (enabled)
|
|
|
|
|
gtk_style_context_add_class (context, "fine-tune");
|
|
|
|
|
else
|
|
|
|
|
gtk_style_context_remove_class (context, "fine-tune");
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
|
|
|
|
|
range->priv->zoom = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
range_grab_remove (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-10-05 21:29:32 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
2007-01-16 14:17:12 +00:00
|
|
|
|
|
2014-11-29 02:23:58 +00:00
|
|
|
|
gtk_range_queue_draw_location (range, priv->grab_location);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->grab_location = MOUSE_OUTSIDE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2012-04-26 21:51:13 +00:00
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
update_zoom_state (range, FALSE);
|
2014-10-05 21:29:32 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_remove_class (context, "dragging");
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static GtkScrollType
|
2015-06-20 22:37:15 +00:00
|
|
|
|
range_get_scroll_for_grab (GtkRange *range)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
guint grab_button;
|
2003-12-13 01:33:17 +00:00
|
|
|
|
gboolean invert;
|
|
|
|
|
|
|
|
|
|
invert = should_invert (range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
grab_button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (range->priv->multipress_gesture));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
switch (priv->grab_location)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
|
|
|
|
/* Backward stepper */
|
|
|
|
|
case MOUSE_STEPPER_A:
|
|
|
|
|
case MOUSE_STEPPER_C:
|
2014-06-05 13:29:14 +00:00
|
|
|
|
switch (grab_button)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_PRIMARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_MIDDLE:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_PAGE_FORWARD : GTK_SCROLL_PAGE_BACKWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_SECONDARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_END : GTK_SCROLL_START;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Forward stepper */
|
|
|
|
|
case MOUSE_STEPPER_B:
|
|
|
|
|
case MOUSE_STEPPER_D:
|
2014-06-05 13:29:14 +00:00
|
|
|
|
switch (grab_button)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_PRIMARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_STEP_FORWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_MIDDLE:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_PAGE_BACKWARD : GTK_SCROLL_PAGE_FORWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2012-01-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_SECONDARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_START : GTK_SCROLL_END;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2002-02-23 14:46:21 +00:00
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
break;
|
2000-10-22 13:00:13 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* In the trough */
|
|
|
|
|
case MOUSE_TROUGH:
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->trough_click_forward)
|
2002-02-23 14:46:21 +00:00
|
|
|
|
return GTK_SCROLL_PAGE_FORWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
2002-02-23 14:46:21 +00:00
|
|
|
|
return GTK_SCROLL_PAGE_BACKWARD;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2000-10-22 13:00:13 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_OUTSIDE:
|
|
|
|
|
case MOUSE_SLIDER:
|
|
|
|
|
case MOUSE_WIDGET:
|
|
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return GTK_SCROLL_NONE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static gdouble
|
|
|
|
|
coord_to_value (GtkRange *range,
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble coord)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble frac;
|
|
|
|
|
gdouble value;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gint trough_length;
|
|
|
|
|
gint trough_start;
|
|
|
|
|
gint slider_length;
|
|
|
|
|
gint trough_border;
|
|
|
|
|
gint trough_under_steppers;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
trough_length = priv->trough.height;
|
|
|
|
|
trough_start = priv->trough.y;
|
|
|
|
|
slider_length = priv->slider.height;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
trough_length = priv->trough.width;
|
|
|
|
|
trough_start = priv->trough.x;
|
|
|
|
|
slider_length = priv->slider.width;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gtk_range_get_props (range, NULL, NULL, &trough_border, NULL,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&trough_under_steppers, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (! trough_under_steppers)
|
|
|
|
|
{
|
|
|
|
|
trough_start += trough_border;
|
|
|
|
|
trough_length -= 2 * trough_border;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (trough_length == slider_length)
|
|
|
|
|
frac = 1.0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
2006-06-09 13:48:07 +00:00
|
|
|
|
frac = (MAX (0, coord - trough_start) /
|
|
|
|
|
(gdouble) (trough_length - slider_length));
|
2001-02-17 00:11:03 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (should_invert (range))
|
|
|
|
|
frac = 1.0 - frac;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = gtk_adjustment_get_lower (priv->adjustment) + frac * (gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return value;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-11 05:47:09 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_range_key_press (GtkWidget *widget,
|
|
|
|
|
GdkEventKey *event)
|
|
|
|
|
{
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDevice *device;
|
2006-10-30 13:39:34 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
device = gdk_event_get_device ((GdkEvent *) event);
|
|
|
|
|
device = gdk_device_get_associated_device (device);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (gtk_gesture_is_active (priv->drag_gesture) &&
|
|
|
|
|
device == gtk_gesture_get_device (priv->drag_gesture) &&
|
2010-09-08 17:35:51 +00:00
|
|
|
|
event->keyval == GDK_KEY_Escape &&
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->grab_location != MOUSE_OUTSIDE)
|
2006-03-11 05:47:09 +00:00
|
|
|
|
{
|
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2015-02-23 01:02:02 +00:00
|
|
|
|
else if (priv->in_drag &&
|
|
|
|
|
(event->keyval == GDK_KEY_Shift_L ||
|
|
|
|
|
event->keyval == GDK_KEY_Shift_R))
|
|
|
|
|
{
|
2015-06-21 00:26:42 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
priv->slide_initial_slider_position = priv->slider.y;
|
|
|
|
|
else
|
|
|
|
|
priv->slide_initial_slider_position = priv->slider.x;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
update_zoom_state (range, !priv->zoom);
|
2015-06-21 00:26:42 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2006-10-30 13:39:34 +00:00
|
|
|
|
|
|
|
|
|
return GTK_WIDGET_CLASS (gtk_range_parent_class)->key_press_event (widget, event);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
static void
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
2013-07-18 21:35:42 +00:00
|
|
|
|
{
|
2015-02-23 12:28:40 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
|
|
|
|
|
|
|
|
|
if (priv->mouse_location == MOUSE_SLIDER && !priv->zoom)
|
2015-02-23 11:42:17 +00:00
|
|
|
|
{
|
2015-02-23 12:28:40 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
priv->slide_initial_slider_position = priv->slider.y;
|
|
|
|
|
priv->slide_initial_coordinate_delta = y - priv->slider.y;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->slide_initial_slider_position = priv->slider.x;
|
|
|
|
|
priv->slide_initial_coordinate_delta = x - priv->slider.x;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 11:42:17 +00:00
|
|
|
|
update_zoom_state (range, TRUE);
|
|
|
|
|
}
|
2013-07-18 21:35:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GdkDevice *source_device;
|
|
|
|
|
GdkEventSequence *sequence;
|
|
|
|
|
const GdkEvent *event;
|
2012-01-04 23:21:36 +00:00
|
|
|
|
GdkInputSource source;
|
2012-08-24 09:49:43 +00:00
|
|
|
|
gboolean primary_warps;
|
|
|
|
|
gint page_increment_button, warp_button;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
guint button;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2012-01-04 23:21:36 +00:00
|
|
|
|
source_device = gdk_event_get_source_device ((GdkEvent *) event);
|
|
|
|
|
source = gdk_device_get_source (source_device);
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2012-08-24 09:49:43 +00:00
|
|
|
|
g_object_get (gtk_widget_get_settings (widget),
|
|
|
|
|
"gtk-primary-button-warps-slider", &primary_warps,
|
|
|
|
|
NULL);
|
|
|
|
|
if (primary_warps)
|
|
|
|
|
{
|
|
|
|
|
warp_button = GDK_BUTTON_PRIMARY;
|
|
|
|
|
page_increment_button = GDK_BUTTON_SECONDARY;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
warp_button = GDK_BUTTON_MIDDLE;
|
|
|
|
|
page_increment_button = GDK_BUTTON_PRIMARY;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-03 06:41:07 +00:00
|
|
|
|
if (priv->mouse_location == MOUSE_SLIDER &&
|
|
|
|
|
gdk_event_triggers_context_menu ((GdkEvent *)event))
|
|
|
|
|
{
|
|
|
|
|
gboolean handled;
|
|
|
|
|
|
2014-09-26 23:18:57 +00:00
|
|
|
|
gtk_gesture_set_state (priv->multipress_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
2012-02-03 06:41:07 +00:00
|
|
|
|
g_signal_emit_by_name (widget, "popup-menu", &handled);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
return;
|
2012-02-03 06:41:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-01-04 23:21:36 +00:00
|
|
|
|
if (source != GDK_SOURCE_TOUCHSCREEN &&
|
|
|
|
|
priv->mouse_location == MOUSE_TROUGH &&
|
2014-06-05 13:29:14 +00:00
|
|
|
|
button == page_increment_button)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2012-04-26 20:32:14 +00:00
|
|
|
|
/* button 2 steps by page increment, as with button 2 on a stepper
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkScrollType scroll;
|
|
|
|
|
gdouble click_value;
|
2012-01-04 23:21:36 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
click_value = coord_to_value (range,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2014-06-05 13:29:14 +00:00
|
|
|
|
y : x);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
priv->trough_click_forward = click_value > gtk_adjustment_get_value (priv->adjustment);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
range_grab_add (range, MOUSE_TROUGH);
|
2012-01-04 23:21:36 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
scroll = range_get_scroll_for_grab (range);
|
2012-01-04 23:21:36 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_add_step_timer (range, scroll);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2010-08-16 06:27:49 +00:00
|
|
|
|
else if ((priv->mouse_location == MOUSE_STEPPER_A ||
|
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_B ||
|
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_C ||
|
|
|
|
|
priv->mouse_location == MOUSE_STEPPER_D) &&
|
2014-06-05 13:29:14 +00:00
|
|
|
|
(button == GDK_BUTTON_PRIMARY ||
|
|
|
|
|
button == GDK_BUTTON_MIDDLE ||
|
|
|
|
|
button == GDK_BUTTON_SECONDARY))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkScrollType scroll;
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
range_grab_add (range, priv->mouse_location);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2014-11-29 00:39:09 +00:00
|
|
|
|
gtk_range_queue_draw_location (range, priv->mouse_location);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
scroll = range_get_scroll_for_grab (range);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (scroll == GTK_SCROLL_START || scroll == GTK_SCROLL_END)
|
|
|
|
|
gtk_range_scroll (range, scroll);
|
|
|
|
|
else if (scroll != GTK_SCROLL_NONE)
|
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
|
|
|
|
range->priv->autoscroll_mode = scroll;
|
|
|
|
|
add_autoscroll (range);
|
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2010-08-16 06:27:49 +00:00
|
|
|
|
else if ((priv->mouse_location == MOUSE_TROUGH &&
|
2012-04-26 20:32:14 +00:00
|
|
|
|
(source == GDK_SOURCE_TOUCHSCREEN ||
|
2014-06-05 13:29:14 +00:00
|
|
|
|
button == warp_button)) ||
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->mouse_location == MOUSE_SLIDER)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2001-07-14 11:35:24 +00:00
|
|
|
|
gboolean need_value_update = FALSE;
|
2014-11-25 22:13:21 +00:00
|
|
|
|
GdkRectangle slider;
|
2001-07-14 11:35:24 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Any button can be used to drag the slider, but you can start
|
2012-04-26 20:32:14 +00:00
|
|
|
|
* dragging the slider with a trough click using button 1;
|
|
|
|
|
* we warp the slider to mouse position, then begin the slider drag.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
*/
|
2012-04-26 20:32:14 +00:00
|
|
|
|
if (priv->mouse_location != MOUSE_SLIDER)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2001-07-14 11:35:24 +00:00
|
|
|
|
gdouble slider_low_value, slider_high_value, new_value;
|
2015-06-21 00:26:42 +00:00
|
|
|
|
|
2001-06-04 19:29:25 +00:00
|
|
|
|
slider_high_value =
|
|
|
|
|
coord_to_value (range,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2014-06-05 13:29:14 +00:00
|
|
|
|
y : x);
|
2001-06-04 19:29:25 +00:00
|
|
|
|
slider_low_value =
|
|
|
|
|
coord_to_value (range,
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2014-06-05 13:29:14 +00:00
|
|
|
|
y - priv->slider.height :
|
|
|
|
|
x - priv->slider.width);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-07-14 11:35:24 +00:00
|
|
|
|
/* compute new value for warped slider */
|
|
|
|
|
new_value = slider_low_value + (slider_high_value - slider_low_value) / 2;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2014-11-25 22:13:21 +00:00
|
|
|
|
gtk_range_compute_slider_position (range, new_value, &slider);
|
2001-07-14 11:35:24 +00:00
|
|
|
|
|
|
|
|
|
/* defer adjustment updates to update_slider_position() in order
|
|
|
|
|
* to keep pixel quantisation
|
|
|
|
|
*/
|
|
|
|
|
need_value_update = TRUE;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2012-04-26 21:51:13 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GdkModifierType state_mask;
|
|
|
|
|
|
|
|
|
|
gdk_event_get_state (event, &state_mask);
|
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
/* Shift-click in the slider = fine adjustment */
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (state_mask & GDK_SHIFT_MASK)
|
2015-06-21 00:26:42 +00:00
|
|
|
|
update_zoom_state (range, TRUE);
|
2014-11-25 22:13:21 +00:00
|
|
|
|
|
|
|
|
|
slider = priv->slider;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
}
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2014-11-25 22:13:21 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider.y;
|
|
|
|
|
priv->slide_initial_coordinate_delta = y - slider.y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2014-11-25 22:13:21 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider.x;
|
|
|
|
|
priv->slide_initial_coordinate_delta = x - slider.x;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
range_grab_add (range, MOUSE_SLIDER);
|
2006-05-18 11:39:42 +00:00
|
|
|
|
|
2010-09-02 02:09:44 +00:00
|
|
|
|
gtk_widget_queue_draw (widget);
|
2006-05-18 11:39:42 +00:00
|
|
|
|
|
2001-07-14 11:35:24 +00:00
|
|
|
|
if (need_value_update)
|
2014-06-05 13:29:14 +00:00
|
|
|
|
update_slider_position (range, x, y);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
if (priv->grab_location == MOUSE_SLIDER);
|
2014-09-27 02:30:20 +00:00
|
|
|
|
/* leave it to ::drag-begin to claim the sequence */
|
2014-06-05 13:29:14 +00:00
|
|
|
|
else if (priv->grab_location != MOUSE_OUTSIDE)
|
|
|
|
|
gtk_gesture_set_state (priv->multipress_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
|
|
|
|
stop_scrolling (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* During a slide, move the slider as required given new mouse position */
|
|
|
|
|
static void
|
|
|
|
|
update_slider_position (GtkRange *range,
|
|
|
|
|
gint mouse_x,
|
|
|
|
|
gint mouse_y)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble delta;
|
|
|
|
|
gdouble c;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble new_value;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gdouble next_value;
|
|
|
|
|
gdouble mark_value;
|
|
|
|
|
gdouble mark_delta;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble zoom;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
gint slider_start, slider_end;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
if (priv->zoom)
|
|
|
|
|
{
|
|
|
|
|
zoom = MIN(1.0, (priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
priv->trough.height : priv->trough.width) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
/* the above is ineffective for scales, so just set a zoom factor */
|
|
|
|
|
if (zoom == 1.0)
|
|
|
|
|
zoom = 0.25;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
zoom = 1.0;
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
/* recalculate the initial position from the current position */
|
|
|
|
|
if (priv->slide_initial_slider_position == -1)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
priv->slide_initial_slider_position = (zoom * (mouse_y - priv->slide_initial_coordinate_delta) - priv->slider.y) / (zoom - 1.0);
|
|
|
|
|
else
|
|
|
|
|
priv->slide_initial_slider_position = (zoom * (mouse_x - priv->slide_initial_coordinate_delta) - priv->slider.x) / (zoom - 1.0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
delta = mouse_y - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
|
|
|
|
else
|
|
|
|
|
delta = mouse_x - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
c = priv->slide_initial_slider_position + zoom * delta;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
new_value = coord_to_value (range, c);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
next_value = coord_to_value (range, c + 1);
|
2012-04-26 21:51:13 +00:00
|
|
|
|
mark_delta = fabs (next_value - new_value);
|
2014-11-21 07:15:54 +00:00
|
|
|
|
gtk_range_get_slider_range (range, &slider_start, &slider_end);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
mark_value = priv->marks[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
if (fabs (gtk_adjustment_get_value (priv->adjustment) - mark_value) < 3 * mark_delta)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (fabs (new_value - mark_value) < (slider_end - slider_start) * 0.5 * mark_delta)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
|
|
|
|
new_value = mark_value;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-26 21:51:13 +00:00
|
|
|
|
}
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2014-09-26 23:18:57 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, new_value, &handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
static void
|
|
|
|
|
remove_autoscroll (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
if (range->priv->autoscroll_id)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_remove_tick_callback (GTK_WIDGET (range),
|
|
|
|
|
range->priv->autoscroll_id);
|
|
|
|
|
range->priv->autoscroll_id = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* unset initial position so it can be calculated */
|
|
|
|
|
range->priv->slide_initial_slider_position = -1;
|
|
|
|
|
|
|
|
|
|
range->priv->autoscroll_mode = GTK_SCROLL_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
autoscroll_cb (GtkWidget *widget,
|
|
|
|
|
GdkFrameClock *frame_clock,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2015-02-23 01:02:02 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GtkAdjustment *adj = priv->adjustment;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gdouble increment;
|
|
|
|
|
gdouble value;
|
|
|
|
|
gboolean handled;
|
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
switch (priv->autoscroll_mode)
|
|
|
|
|
{
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
|
increment = gtk_adjustment_get_step_increment (adj) / AUTOSCROLL_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
|
increment = gtk_adjustment_get_page_increment (adj) / AUTOSCROLL_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
|
increment = - gtk_adjustment_get_step_increment (adj) / AUTOSCROLL_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
|
increment = - gtk_adjustment_get_page_increment (adj) / AUTOSCROLL_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
value = gtk_adjustment_get_value (adj);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
value += increment;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
|
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, value, &handled);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
add_autoscroll (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (priv->autoscroll_id != 0 ||
|
|
|
|
|
priv->autoscroll_mode == GTK_SCROLL_NONE)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->autoscroll_id = gtk_widget_add_tick_callback (GTK_WIDGET (range),
|
2015-02-23 01:02:02 +00:00
|
|
|
|
autoscroll_cb, range, NULL);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
static void
|
2005-03-22 17:36:41 +00:00
|
|
|
|
stop_scrolling (GtkRange *range)
|
2003-03-29 00:11:32 +00:00
|
|
|
|
{
|
|
|
|
|
range_grab_remove (range);
|
|
|
|
|
gtk_range_remove_step_timer (range);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
remove_autoscroll (range);
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-02-29 18:21:57 +00:00
|
|
|
|
/**
|
|
|
|
|
* _gtk_range_get_wheel_delta:
|
|
|
|
|
* @range: a #GtkRange
|
2012-01-24 11:12:34 +00:00
|
|
|
|
* @event: A #GdkEventScroll
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2004-02-29 18:21:57 +00:00
|
|
|
|
* Returns a good step value for the mouse wheel.
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A good step value for the mouse wheel.
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2004-02-29 18:21:57 +00:00
|
|
|
|
* Since: 2.4
|
|
|
|
|
**/
|
|
|
|
|
gdouble
|
2012-01-24 11:12:34 +00:00
|
|
|
|
_gtk_range_get_wheel_delta (GtkRange *range,
|
|
|
|
|
GdkEventScroll *event)
|
2004-02-29 18:21:57 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2011-01-05 21:08:45 +00:00
|
|
|
|
GtkAdjustment *adjustment = priv->adjustment;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
gdouble dx, dy;
|
2015-03-18 02:02:35 +00:00
|
|
|
|
gdouble delta = 0;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
gdouble page_size;
|
2012-03-05 00:15:32 +00:00
|
|
|
|
gdouble page_increment;
|
|
|
|
|
gdouble scroll_unit;
|
2015-03-18 02:02:35 +00:00
|
|
|
|
GdkScrollDirection direction;
|
2004-02-29 18:21:57 +00:00
|
|
|
|
|
2012-01-24 11:12:34 +00:00
|
|
|
|
page_size = gtk_adjustment_get_page_size (adjustment);
|
2012-03-05 00:15:32 +00:00
|
|
|
|
page_increment = gtk_adjustment_get_page_increment (adjustment);
|
|
|
|
|
|
|
|
|
|
if (GTK_IS_SCROLLBAR (range))
|
|
|
|
|
scroll_unit = pow (page_size, 2.0 / 3.0);
|
|
|
|
|
else
|
|
|
|
|
scroll_unit = page_increment;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
|
|
|
|
if (gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
|
|
|
|
|
{
|
2014-09-05 11:38:30 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_QUARTZ
|
|
|
|
|
scroll_unit = 1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-03-18 02:02:35 +00:00
|
|
|
|
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
delta = - (dx ? dx : dy) * scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
else
|
2012-03-05 00:15:32 +00:00
|
|
|
|
delta = dy * scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
}
|
2015-03-18 02:02:35 +00:00
|
|
|
|
else if (gdk_event_get_scroll_direction ((GdkEvent *) event, &direction))
|
2012-01-24 11:12:34 +00:00
|
|
|
|
{
|
2015-03-18 02:02:35 +00:00
|
|
|
|
if (direction == GDK_SCROLL_UP ||
|
2015-04-15 13:27:04 +00:00
|
|
|
|
direction == GDK_SCROLL_LEFT)
|
2012-03-05 00:15:32 +00:00
|
|
|
|
delta = - scroll_unit;
|
|
|
|
|
else
|
|
|
|
|
delta = scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->inverted)
|
2004-02-29 18:21:57 +00:00
|
|
|
|
delta = - delta;
|
|
|
|
|
|
|
|
|
|
return delta;
|
|
|
|
|
}
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_scroll_event (GtkWidget *widget,
|
|
|
|
|
GdkEventScroll *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
|
if (gtk_widget_get_realized (widget))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2004-02-29 18:21:57 +00:00
|
|
|
|
gdouble delta;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2012-01-24 11:12:34 +00:00
|
|
|
|
delta = _gtk_range_get_wheel_delta (range, event);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
|
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
2011-01-05 21:08:45 +00:00
|
|
|
|
GTK_SCROLL_JUMP, gtk_adjustment_get_value (priv->adjustment) + delta,
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
&handled);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
|
return TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
static void
|
|
|
|
|
update_autoscroll_mode (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkScrollType mode = GTK_SCROLL_NONE;
|
|
|
|
|
|
|
|
|
|
if (range->priv->zoom)
|
|
|
|
|
{
|
|
|
|
|
GtkAllocation allocation;
|
|
|
|
|
gint size, pos;
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (range), &allocation);
|
|
|
|
|
|
|
|
|
|
if (range->priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
size = allocation.height;
|
|
|
|
|
pos = range->priv->mouse_y;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
size = allocation.width;
|
|
|
|
|
pos = range->priv->mouse_x;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-07 16:01:13 +00:00
|
|
|
|
if (pos < SCROLL_EDGE_SIZE)
|
2014-03-03 22:49:38 +00:00
|
|
|
|
mode = range->priv->inverted ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD;
|
2013-10-07 16:01:13 +00:00
|
|
|
|
else if (pos > (size - SCROLL_EDGE_SIZE))
|
2014-03-03 22:49:38 +00:00
|
|
|
|
mode = range->priv->inverted ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_STEP_FORWARD;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode != range->priv->autoscroll_mode)
|
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
|
|
|
|
range->priv->autoscroll_mode = mode;
|
|
|
|
|
add_autoscroll (range);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gdouble start_x, start_y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2015-06-20 22:37:15 +00:00
|
|
|
|
if (range->priv->grab_location == MOUSE_SLIDER)
|
|
|
|
|
{
|
|
|
|
|
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
|
|
|
|
|
priv->mouse_x = start_x + offset_x;
|
|
|
|
|
priv->mouse_y = start_y + offset_y;
|
|
|
|
|
priv->in_drag = TRUE;
|
|
|
|
|
update_autoscroll_mode (range);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2015-06-20 22:37:15 +00:00
|
|
|
|
if (priv->autoscroll_mode == GTK_SCROLL_NONE)
|
|
|
|
|
update_slider_position (range, priv->mouse_x, priv->mouse_y);
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
if (range->priv->grab_location == MOUSE_SLIDER)
|
|
|
|
|
gtk_gesture_set_state (range->priv->drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
2015-06-21 00:26:42 +00:00
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_end (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range)
|
2000-02-18 20:02:24 +00:00
|
|
|
|
{
|
2015-06-20 22:37:15 +00:00
|
|
|
|
if (range->priv->grab_location == MOUSE_SLIDER)
|
|
|
|
|
{
|
|
|
|
|
range->priv->in_drag = FALSE;
|
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
}
|
2000-02-18 20:02:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_range_event (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gdouble x, y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (event->type == GDK_LEAVE_NOTIFY)
|
|
|
|
|
{
|
|
|
|
|
priv->mouse_x = -1;
|
|
|
|
|
priv->mouse_y = -1;
|
|
|
|
|
}
|
|
|
|
|
else if (gdk_event_get_coords (event, &x, &y))
|
|
|
|
|
{
|
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
return GDK_EVENT_PROPAGATE;
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2014-11-29 01:39:47 +00:00
|
|
|
|
gtk_range_calc_slider (range);
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
/* Note that we don't round off to priv->round_digits here.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* that's because it's really broken to change a value
|
|
|
|
|
* in response to a change signal on that value; round_digits
|
|
|
|
|
* is therefore defined to be a filter on what the GtkRange
|
|
|
|
|
* can input into the adjustment, not a filter that the GtkRange
|
|
|
|
|
* will enforce on the adjustment.
|
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 01:39:47 +00:00
|
|
|
|
gtk_range_calc_slider (range);
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
2005-08-20 05:55:25 +00:00
|
|
|
|
|
|
|
|
|
/* now check whether the layout changed */
|
2014-11-29 01:39:47 +00:00
|
|
|
|
if (GTK_IS_SCALE (range) && gtk_scale_get_draw_value (GTK_SCALE (range)))
|
2005-08-20 05:55:25 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
}
|
2011-01-15 05:08:39 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
/* Note that we don't round off to priv->round_digits here.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* that's because it's really broken to change a value
|
|
|
|
|
* in response to a change signal on that value; round_digits
|
|
|
|
|
* is therefore defined to be a filter on what the GtkRange
|
|
|
|
|
* can input into the adjustment, not a filter that the GtkRange
|
|
|
|
|
* will enforce on the adjustment.
|
|
|
|
|
*/
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_emit (range, signals[VALUE_CHANGED], 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void
|
|
|
|
|
apply_marks (GtkRange *range,
|
|
|
|
|
gdouble oldval,
|
|
|
|
|
gdouble *newval)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
|
|
|
|
gdouble mark;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
mark = priv->marks[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
if ((oldval < mark && mark < *newval) ||
|
|
|
|
|
(oldval > mark && mark > *newval))
|
|
|
|
|
{
|
|
|
|
|
*newval = mark;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) - gtk_adjustment_get_step_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_STEP_BACKWARD, newval, &handled);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) + gtk_adjustment_get_step_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_STEP_FORWARD, newval, &handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1998-04-14 01:39:40 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
page_back (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1998-12-15 07:32:11 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) - gtk_adjustment_get_page_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_PAGE_BACKWARD, newval, &handled);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
page_forward (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gdouble newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) + gtk_adjustment_get_page_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_PAGE_FORWARD, newval, &handled);
|
2003-12-11 23:05:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scroll_begin (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
2011-01-05 21:08:45 +00:00
|
|
|
|
GTK_SCROLL_START, gtk_adjustment_get_lower (priv->adjustment),
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
&handled);
|
2003-12-11 23:05:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scroll_end (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2003-12-11 23:05:25 +00:00
|
|
|
|
gdouble newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_END, newval,
|
|
|
|
|
&handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2001-02-19 20:06:37 +00:00
|
|
|
|
|
2007-01-02 16:40:44 +00:00
|
|
|
|
static gboolean
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_scroll (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2011-01-05 21:08:45 +00:00
|
|
|
|
gdouble old_value = gtk_adjustment_get_value (priv->adjustment);
|
2007-01-02 16:40:44 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
switch (scroll)
|
2001-02-19 20:06:37 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_STEP_LEFT:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_UP:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_STEP_RIGHT:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_DOWN:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_LEFT:
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (should_invert (range))
|
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_UP:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_PAGE_RIGHT:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
page_back (range);
|
|
|
|
|
else
|
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_DOWN:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
page_back (range);
|
|
|
|
|
else
|
|
|
|
|
page_forward (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
page_back (range);
|
1998-03-10 04:37:26 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
page_forward (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_START:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
scroll_begin (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_END:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
scroll_end (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
|
/* Used by CList, range doesn't use it. */
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_NONE:
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2007-01-02 16:40:44 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
return gtk_adjustment_get_value (priv->adjustment) != old_value;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_move_slider (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll)
|
|
|
|
|
{
|
2007-01-02 16:40:44 +00:00
|
|
|
|
if (! gtk_range_scroll (range, scroll))
|
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (range));
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_get_props (GtkRange *range,
|
|
|
|
|
gint *slider_width,
|
|
|
|
|
gint *stepper_size,
|
|
|
|
|
gint *trough_border,
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gint *stepper_spacing,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean *trough_under_steppers,
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gint *arrow_displacement_x,
|
|
|
|
|
gint *arrow_displacement_y)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gint tmp_slider_width, tmp_stepper_size, tmp_trough_border;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gint tmp_stepper_spacing, tmp_trough_under_steppers;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gint tmp_arrow_displacement_x, tmp_arrow_displacement_y;
|
2001-02-19 20:06:37 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
|
"slider-width", &tmp_slider_width,
|
|
|
|
|
"trough-border", &tmp_trough_border,
|
|
|
|
|
"stepper-size", &tmp_stepper_size,
|
|
|
|
|
"stepper-spacing", &tmp_stepper_spacing,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
"trough-under-steppers", &tmp_trough_under_steppers,
|
2005-03-26 05:49:15 +00:00
|
|
|
|
"arrow-displacement-x", &tmp_arrow_displacement_x,
|
|
|
|
|
"arrow-displacement-y", &tmp_arrow_displacement_y,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
NULL);
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (slider_width)
|
|
|
|
|
*slider_width = tmp_slider_width;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (trough_border)
|
|
|
|
|
*trough_border = tmp_trough_border;
|
|
|
|
|
|
|
|
|
|
if (stepper_size)
|
|
|
|
|
*stepper_size = tmp_stepper_size;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (stepper_spacing)
|
|
|
|
|
*stepper_spacing = tmp_stepper_spacing;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
|
2006-06-09 13:48:07 +00:00
|
|
|
|
if (trough_under_steppers)
|
|
|
|
|
*trough_under_steppers = tmp_trough_under_steppers;
|
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
|
if (arrow_displacement_x)
|
|
|
|
|
*arrow_displacement_x = tmp_arrow_displacement_x;
|
|
|
|
|
|
|
|
|
|
if (arrow_displacement_y)
|
|
|
|
|
*arrow_displacement_y = tmp_arrow_displacement_y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
#define POINT_IN_RECT(xcoord, ycoord, rect) \
|
|
|
|
|
((xcoord) >= (rect).x && \
|
|
|
|
|
(xcoord) < ((rect).x + (rect).width) && \
|
|
|
|
|
(ycoord) >= (rect).y && \
|
|
|
|
|
(ycoord) < ((rect).y + (rect).height))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Update mouse location, return TRUE if it changes */
|
2014-11-29 02:27:36 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_update_mouse_location (GtkRange *range)
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GtkAllocation allocation;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gint x, y;
|
|
|
|
|
MouseLocation old;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
old = priv->mouse_location;
|
|
|
|
|
|
|
|
|
|
x = priv->mouse_x;
|
|
|
|
|
y = priv->mouse_y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-11 21:03:15 +00:00
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->grab_location != MOUSE_OUTSIDE)
|
|
|
|
|
priv->mouse_location = priv->grab_location;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->stepper_a))
|
|
|
|
|
priv->mouse_location = MOUSE_STEPPER_A;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->stepper_b))
|
|
|
|
|
priv->mouse_location = MOUSE_STEPPER_B;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->stepper_c))
|
|
|
|
|
priv->mouse_location = MOUSE_STEPPER_C;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->stepper_d))
|
|
|
|
|
priv->mouse_location = MOUSE_STEPPER_D;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->slider))
|
|
|
|
|
priv->mouse_location = MOUSE_SLIDER;
|
|
|
|
|
else if (POINT_IN_RECT (x, y, priv->trough))
|
|
|
|
|
priv->mouse_location = MOUSE_TROUGH;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
else if (POINT_IN_RECT (x, y, allocation))
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->mouse_location = MOUSE_WIDGET;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->mouse_location = MOUSE_OUTSIDE;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
if (old != priv->mouse_location)
|
|
|
|
|
{
|
|
|
|
|
gtk_range_queue_draw_location (range, old);
|
|
|
|
|
gtk_range_queue_draw_location (range, priv->mouse_location);
|
2014-11-29 02:33:47 +00:00
|
|
|
|
|
|
|
|
|
if (priv->mouse_location == MOUSE_OUTSIDE)
|
|
|
|
|
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_PRELIGHT);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_PRELIGHT, FALSE);
|
2014-11-29 02:27:36 +00:00
|
|
|
|
}
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Clamp rect, border inside widget->allocation, such that we prefer
|
|
|
|
|
* to take space from border not rect in all directions, and prefer to
|
|
|
|
|
* give space to border over rect in one direction.
|
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
clamp_dimensions (GtkWidget *widget,
|
|
|
|
|
GdkRectangle *rect,
|
|
|
|
|
GtkBorder *border,
|
|
|
|
|
gboolean border_expands_horizontally)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GtkAllocation allocation;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gint extra, shortage;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (rect->x == 0);
|
|
|
|
|
g_return_if_fail (rect->y == 0);
|
|
|
|
|
g_return_if_fail (rect->width >= 0);
|
|
|
|
|
g_return_if_fail (rect->height >= 0);
|
|
|
|
|
|
2010-08-11 21:03:15 +00:00
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Width */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
|
|
|
|
extra = allocation.width - border->left - border->right - rect->width;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (extra > 0)
|
|
|
|
|
{
|
|
|
|
|
if (border_expands_horizontally)
|
|
|
|
|
{
|
|
|
|
|
border->left += extra / 2;
|
|
|
|
|
border->right += extra / 2 + extra % 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rect->width += extra;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if we can fit rect, if not kill the border */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
shortage = rect->width - allocation.width;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
2010-08-11 21:03:15 +00:00
|
|
|
|
rect->width = allocation.width;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* lose the border */
|
|
|
|
|
border->left = 0;
|
|
|
|
|
border->right = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
shortage = rect->width + border->left + border->right - allocation.width;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
/* Shrink borders */
|
|
|
|
|
border->left -= shortage / 2;
|
|
|
|
|
border->right -= shortage / 2 + shortage % 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Height */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
|
|
|
|
|
extra = allocation.height - border->top - border->bottom - rect->height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (extra > 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (border_expands_horizontally)
|
|
|
|
|
{
|
|
|
|
|
/* don't expand border vertically */
|
|
|
|
|
rect->height += extra;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
border->top += extra / 2;
|
|
|
|
|
border->bottom += extra / 2 + extra % 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if we can fit rect, if not kill the border */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
shortage = rect->height - allocation.height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
2010-08-11 21:03:15 +00:00
|
|
|
|
rect->height = allocation.height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* lose the border */
|
|
|
|
|
border->top = 0;
|
|
|
|
|
border->bottom = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
2010-08-11 21:03:15 +00:00
|
|
|
|
shortage = rect->height + border->top + border->bottom - allocation.height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
/* Shrink borders */
|
|
|
|
|
border->top -= shortage / 2;
|
|
|
|
|
border->bottom -= shortage / 2 + shortage % 2;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_calc_request (GtkRange *range,
|
|
|
|
|
gint slider_width,
|
|
|
|
|
gint stepper_size,
|
|
|
|
|
gint trough_border,
|
|
|
|
|
gint stepper_spacing,
|
|
|
|
|
GdkRectangle *range_rect,
|
|
|
|
|
GtkBorder *border,
|
|
|
|
|
gint *n_steppers_p,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean *has_steppers_ab,
|
2014-11-21 07:00:52 +00:00
|
|
|
|
gboolean *has_steppers_cd)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gint n_steppers;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gint n_steppers_ab;
|
|
|
|
|
gint n_steppers_cd;
|
2002-02-27 22:41:33 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
border->left = 0;
|
|
|
|
|
border->right = 0;
|
|
|
|
|
border->top = 0;
|
|
|
|
|
border->bottom = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (GTK_RANGE_GET_CLASS (range)->get_range_border)
|
2008-08-12 09:06:34 +00:00
|
|
|
|
GTK_RANGE_GET_CLASS (range)->get_range_border (range, border);
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
n_steppers_ab = 0;
|
|
|
|
|
n_steppers_cd = 0;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
n_steppers_ab += 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_b)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
n_steppers_ab += 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
n_steppers_cd += 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_d)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
n_steppers_cd += 1;
|
|
|
|
|
|
|
|
|
|
n_steppers = n_steppers_ab + n_steppers_cd;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
range_rect->x = 0;
|
|
|
|
|
range_rect->y = 0;
|
|
|
|
|
|
|
|
|
|
/* We never expand to fill available space in the small dimension
|
|
|
|
|
* (i.e. vertical scrollbars are always a fixed width)
|
|
|
|
|
*/
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2014-05-04 18:35:01 +00:00
|
|
|
|
range_rect->width = + trough_border * 2 + slider_width;
|
2014-11-21 07:00:52 +00:00
|
|
|
|
range_rect->height = stepper_size * n_steppers + trough_border * 2 + priv->min_slider_size;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
if (n_steppers_ab > 0)
|
|
|
|
|
range_rect->height += stepper_spacing;
|
|
|
|
|
|
|
|
|
|
if (n_steppers_cd > 0)
|
|
|
|
|
range_rect->height += stepper_spacing;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2014-11-21 07:00:52 +00:00
|
|
|
|
range_rect->width = stepper_size * n_steppers + trough_border * 2 + priv->min_slider_size;
|
2014-05-04 18:35:01 +00:00
|
|
|
|
range_rect->height = trough_border * 2 + slider_width;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
if (n_steppers_ab > 0)
|
|
|
|
|
range_rect->width += stepper_spacing;
|
|
|
|
|
|
|
|
|
|
if (n_steppers_cd > 0)
|
|
|
|
|
range_rect->width += stepper_spacing;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
if (n_steppers_p)
|
|
|
|
|
*n_steppers_p = n_steppers;
|
|
|
|
|
|
2006-06-09 13:48:07 +00:00
|
|
|
|
if (has_steppers_ab)
|
|
|
|
|
*has_steppers_ab = (n_steppers_ab > 0);
|
|
|
|
|
|
|
|
|
|
if (has_steppers_cd)
|
|
|
|
|
*has_steppers_cd = (n_steppers_cd > 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_compute_slider_position (GtkRange *range,
|
|
|
|
|
gdouble adjustment_value,
|
|
|
|
|
GdkRectangle *slider_rect)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
gint trough_border;
|
|
|
|
|
gboolean trough_under_steppers;
|
|
|
|
|
|
|
|
|
|
gtk_range_get_props (range, NULL, NULL, &trough_border, NULL,
|
|
|
|
|
&trough_under_steppers, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
gint y, bottom, top, height;
|
|
|
|
|
|
|
|
|
|
/* Slider fits into the trough, with stepper_spacing on either side,
|
|
|
|
|
* and the size/position based on the adjustment or fixed, depending.
|
|
|
|
|
*/
|
|
|
|
|
slider_rect->x = priv->trough.x + trough_border;
|
|
|
|
|
slider_rect->width = priv->trough.width - trough_border * 2;
|
|
|
|
|
|
|
|
|
|
/* Compute slider position/length */
|
|
|
|
|
top = priv->trough.y;
|
|
|
|
|
bottom = priv->trough.y + priv->trough.height;
|
|
|
|
|
|
|
|
|
|
if (! trough_under_steppers)
|
|
|
|
|
{
|
|
|
|
|
top += trough_border;
|
|
|
|
|
bottom -= trough_border;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* slider height is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough height in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0)
|
|
|
|
|
height = ((bottom - top) * (gtk_adjustment_get_page_size (priv->adjustment) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment))));
|
|
|
|
|
else
|
|
|
|
|
height = priv->min_slider_size;
|
|
|
|
|
|
|
|
|
|
if (height < priv->min_slider_size ||
|
|
|
|
|
priv->slider_size_fixed)
|
|
|
|
|
height = priv->min_slider_size;
|
|
|
|
|
|
|
|
|
|
height = MIN (height, priv->trough.height);
|
|
|
|
|
|
|
|
|
|
y = top;
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) != 0)
|
|
|
|
|
y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
|
|
|
|
|
y = CLAMP (y, top, bottom);
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
y = bottom - (y - top + height);
|
|
|
|
|
|
|
|
|
|
slider_rect->y = y;
|
|
|
|
|
slider_rect->height = height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gint x, left, right, width;
|
|
|
|
|
|
|
|
|
|
/* Slider fits into the trough, with stepper_spacing on either side,
|
|
|
|
|
* and the size/position based on the adjustment or fixed, depending.
|
|
|
|
|
*/
|
2014-11-25 22:12:08 +00:00
|
|
|
|
slider_rect->y = priv->trough.y + trough_border;
|
|
|
|
|
slider_rect->height = priv->trough.height - trough_border * 2;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
/* Compute slider position/length */
|
|
|
|
|
left = priv->trough.x;
|
|
|
|
|
right = priv->trough.x + priv->trough.width;
|
|
|
|
|
|
|
|
|
|
if (! trough_under_steppers)
|
|
|
|
|
{
|
|
|
|
|
left += trough_border;
|
|
|
|
|
right -= trough_border;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* slider width is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough width in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0)
|
|
|
|
|
width = ((right - left) * (gtk_adjustment_get_page_size (priv->adjustment) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment))));
|
|
|
|
|
else
|
|
|
|
|
width = priv->min_slider_size;
|
|
|
|
|
|
|
|
|
|
if (width < priv->min_slider_size ||
|
|
|
|
|
priv->slider_size_fixed)
|
|
|
|
|
width = priv->min_slider_size;
|
|
|
|
|
|
|
|
|
|
width = MIN (width, priv->trough.width);
|
|
|
|
|
|
|
|
|
|
x = left;
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) != 0)
|
|
|
|
|
x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
|
|
|
|
|
x = CLAMP (x, left, right);
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
x = right - (x - left + width);
|
|
|
|
|
|
2014-11-25 22:12:08 +00:00
|
|
|
|
slider_rect->x = x;
|
|
|
|
|
slider_rect->width = width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-29 00:47:31 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
rectangle_equal (const GdkRectangle *a,
|
|
|
|
|
const GdkRectangle *b)
|
|
|
|
|
{
|
|
|
|
|
return a->x == b->x
|
|
|
|
|
&& a->y == b->y
|
|
|
|
|
&& a->width == b->width
|
|
|
|
|
&& a->height == b->height;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_slider (GtkRange *range)
|
|
|
|
|
{
|
2014-11-29 00:47:31 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GdkRectangle new_slider;
|
|
|
|
|
|
|
|
|
|
gtk_range_compute_slider_position (range,
|
|
|
|
|
gtk_adjustment_get_value (priv->adjustment),
|
|
|
|
|
&new_slider);
|
|
|
|
|
|
|
|
|
|
if (rectangle_equal (&priv->slider, &new_slider))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_SLIDER);
|
|
|
|
|
|
|
|
|
|
priv->slider = new_slider;
|
|
|
|
|
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_SLIDER);
|
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_TROUGH);
|
|
|
|
|
|
|
|
|
|
gtk_range_update_mouse_location (range);
|
2014-11-29 00:23:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
2014-11-29 01:17:27 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
gboolean was_upper_sensitive, was_lower_sensitive;
|
|
|
|
|
|
|
|
|
|
was_upper_sensitive = priv->upper_sensitive;
|
|
|
|
|
switch (priv->upper_sensitivity)
|
|
|
|
|
{
|
|
|
|
|
case GTK_SENSITIVITY_AUTO:
|
|
|
|
|
priv->upper_sensitive =
|
|
|
|
|
(gtk_adjustment_get_value (priv->adjustment) <
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_ON:
|
|
|
|
|
priv->upper_sensitive = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_OFF:
|
|
|
|
|
priv->upper_sensitive = FALSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
was_lower_sensitive = priv->lower_sensitive;
|
|
|
|
|
switch (priv->lower_sensitivity)
|
|
|
|
|
{
|
|
|
|
|
case GTK_SENSITIVITY_AUTO:
|
|
|
|
|
priv->lower_sensitive =
|
|
|
|
|
(gtk_adjustment_get_value (priv->adjustment) > gtk_adjustment_get_lower (priv->adjustment));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_ON:
|
|
|
|
|
priv->lower_sensitive = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_OFF:
|
|
|
|
|
priv->lower_sensitive = FALSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Too many side effects can influence which stepper reacts to wat condition.
|
|
|
|
|
* So we just invalidate them all.
|
|
|
|
|
*/
|
|
|
|
|
if (was_upper_sensitive != priv->upper_sensitive ||
|
|
|
|
|
was_lower_sensitive != priv->lower_sensitive)
|
|
|
|
|
{
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_STEPPER_A);
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_STEPPER_B);
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_STEPPER_C);
|
|
|
|
|
gtk_range_queue_draw_location (range, MOUSE_STEPPER_D);
|
|
|
|
|
}
|
2014-11-29 00:23:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
2014-11-25 22:21:48 +00:00
|
|
|
|
gtk_range_calc_layout (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-05-04 18:35:01 +00:00
|
|
|
|
gint slider_width, stepper_size, trough_border, stepper_spacing;
|
2014-05-04 15:26:57 +00:00
|
|
|
|
GtkBorder border;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gint n_steppers;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gboolean has_steppers_ab;
|
|
|
|
|
gboolean has_steppers_cd;
|
|
|
|
|
gboolean trough_under_steppers;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GdkRectangle range_rect;
|
|
|
|
|
GtkWidget *widget;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* If we have a too-small allocation, we prefer the steppers over
|
|
|
|
|
* the trough/slider, probably the steppers are a more useful
|
|
|
|
|
* feature in small spaces.
|
|
|
|
|
*
|
|
|
|
|
* Also, we prefer to draw the range itself rather than the border
|
|
|
|
|
* areas if there's a conflict, since the borders will be decoration
|
|
|
|
|
* not controls. Though this depends on subclasses cooperating by
|
2010-08-16 06:27:49 +00:00
|
|
|
|
* not drawing on priv->range_rect.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
widget = GTK_WIDGET (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_get_props (range,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&slider_width, &stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
&trough_border,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&stepper_spacing, &trough_under_steppers,
|
2002-02-26 23:50:14 +00:00
|
|
|
|
NULL, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_calc_request (range,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
slider_width, stepper_size,
|
2014-05-04 18:35:01 +00:00
|
|
|
|
trough_border, stepper_spacing,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
&range_rect, &border, &n_steppers,
|
2014-11-21 07:00:52 +00:00
|
|
|
|
&has_steppers_ab, &has_steppers_cd);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
/* We never expand to fill available space in the small dimension
|
|
|
|
|
* (i.e. vertical scrollbars are always a fixed width)
|
|
|
|
|
*/
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
clamp_dimensions (widget, &range_rect, &border, TRUE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
clamp_dimensions (widget, &range_rect, &border, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
range_rect.x = border.left;
|
|
|
|
|
range_rect.y = border.top;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
priv->range_rect = range_rect;
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
|
|
|
|
gint stepper_width, stepper_height;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Steppers are the width of the range, and stepper_size in
|
|
|
|
|
* height, or if we don't have enough height, divided equally
|
|
|
|
|
* among available space.
|
|
|
|
|
*/
|
2014-05-04 18:35:01 +00:00
|
|
|
|
stepper_width = range_rect.width;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
if (trough_under_steppers)
|
|
|
|
|
stepper_width -= trough_border * 2;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (stepper_width < 1)
|
|
|
|
|
stepper_width = range_rect.width; /* screw the trough border */
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (n_steppers == 0)
|
|
|
|
|
stepper_height = 0; /* avoid divide by n_steppers */
|
|
|
|
|
else
|
|
|
|
|
stepper_height = MIN (stepper_size, (range_rect.height / n_steppers));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Stepper A */
|
|
|
|
|
|
2014-05-04 18:35:01 +00:00
|
|
|
|
priv->stepper_a.x = range_rect.x + trough_border * trough_under_steppers;
|
|
|
|
|
priv->stepper_a.y = range_rect.y + trough_border * trough_under_steppers;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_a.width = stepper_width;
|
|
|
|
|
priv->stepper_a.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_a.width = 0;
|
|
|
|
|
priv->stepper_a.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Stepper B */
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.x = priv->stepper_a.x;
|
|
|
|
|
priv->stepper_b.y = priv->stepper_a.y + priv->stepper_a.height;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_b)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.width = stepper_width;
|
|
|
|
|
priv->stepper_b.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.width = 0;
|
|
|
|
|
priv->stepper_b.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Stepper D */
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_d)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.width = stepper_width;
|
|
|
|
|
priv->stepper_d.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.width = 0;
|
|
|
|
|
priv->stepper_d.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.x = priv->stepper_a.x;
|
2014-05-04 18:35:01 +00:00
|
|
|
|
priv->stepper_d.y = range_rect.y + range_rect.height - priv->stepper_d.height - trough_border * trough_under_steppers;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Stepper C */
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.width = stepper_width;
|
|
|
|
|
priv->stepper_c.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.width = 0;
|
|
|
|
|
priv->stepper_c.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.x = priv->stepper_a.x;
|
|
|
|
|
priv->stepper_c.y = priv->stepper_d.y - priv->stepper_c.height;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* Now the trough is the remaining space between steppers B and C,
|
2006-06-09 13:48:07 +00:00
|
|
|
|
* if any, minus spacing
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
*/
|
2013-01-14 15:09:10 +00:00
|
|
|
|
priv->trough.x = range_rect.x;
|
|
|
|
|
priv->trough.y = priv->stepper_b.y + priv->stepper_b.height + stepper_spacing * has_steppers_ab;
|
|
|
|
|
priv->trough.width = range_rect.width;
|
|
|
|
|
priv->trough.height = priv->stepper_c.y - priv->trough.y - stepper_spacing * has_steppers_cd;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gint stepper_width, stepper_height;
|
|
|
|
|
|
|
|
|
|
/* Steppers are the height of the range, and stepper_size in
|
|
|
|
|
* width, or if we don't have enough width, divided equally
|
|
|
|
|
* among available space.
|
|
|
|
|
*/
|
2014-05-04 18:35:01 +00:00
|
|
|
|
stepper_height = range_rect.height;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
if (trough_under_steppers)
|
|
|
|
|
stepper_height -= trough_border * 2;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
if (stepper_height < 1)
|
|
|
|
|
stepper_height = range_rect.height; /* screw the trough border */
|
|
|
|
|
|
|
|
|
|
if (n_steppers == 0)
|
|
|
|
|
stepper_width = 0; /* avoid divide by n_steppers */
|
|
|
|
|
else
|
|
|
|
|
stepper_width = MIN (stepper_size, (range_rect.width / n_steppers));
|
|
|
|
|
|
|
|
|
|
/* Stepper A */
|
|
|
|
|
|
2014-05-04 18:35:01 +00:00
|
|
|
|
priv->stepper_a.x = range_rect.x + trough_border * trough_under_steppers;
|
|
|
|
|
priv->stepper_a.y = range_rect.y + trough_border * trough_under_steppers;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_a)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_a.width = stepper_width;
|
|
|
|
|
priv->stepper_a.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_a.width = 0;
|
|
|
|
|
priv->stepper_a.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Stepper B */
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.x = priv->stepper_a.x + priv->stepper_a.width;
|
|
|
|
|
priv->stepper_b.y = priv->stepper_a.y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_b)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.width = stepper_width;
|
|
|
|
|
priv->stepper_b.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_b.width = 0;
|
|
|
|
|
priv->stepper_b.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Stepper D */
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_d)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.width = stepper_width;
|
|
|
|
|
priv->stepper_d.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.width = 0;
|
|
|
|
|
priv->stepper_d.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-04 18:35:01 +00:00
|
|
|
|
priv->stepper_d.x = range_rect.x + range_rect.width - priv->stepper_d.width - trough_border * trough_under_steppers;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_d.y = priv->stepper_a.y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Stepper C */
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->has_stepper_c)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.width = stepper_width;
|
|
|
|
|
priv->stepper_c.height = stepper_height;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.width = 0;
|
|
|
|
|
priv->stepper_c.height = 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->stepper_c.x = priv->stepper_d.x - priv->stepper_c.width;
|
|
|
|
|
priv->stepper_c.y = priv->stepper_a.y;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
/* Now the trough is the remaining space between steppers B and C,
|
|
|
|
|
* if any
|
|
|
|
|
*/
|
2013-01-14 15:09:10 +00:00
|
|
|
|
priv->trough.x = priv->stepper_b.x + priv->stepper_b.width + stepper_spacing * has_steppers_ab;
|
|
|
|
|
priv->trough.y = range_rect.y;
|
|
|
|
|
priv->trough.width = priv->stepper_c.x - priv->trough.x - stepper_spacing * has_steppers_cd;
|
|
|
|
|
priv->trough.height = range_rect.height;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2014-11-29 00:47:31 +00:00
|
|
|
|
gtk_range_calc_slider (range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2014-11-29 01:17:27 +00:00
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 00:39:09 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_queue_draw_location (GtkRange *range,
|
|
|
|
|
MouseLocation location)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-11-29 00:39:09 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
|
|
|
|
const GdkRectangle *rect;
|
|
|
|
|
GdkRectangle allocation;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
switch (location)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_STEPPER_A:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->stepper_a;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_STEPPER_B:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->stepper_b;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_STEPPER_C:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->stepper_c;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_STEPPER_D:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->stepper_d;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_TROUGH:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->trough;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_SLIDER:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
rect = &priv->slider;
|
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case MOUSE_WIDGET:
|
|
|
|
|
case MOUSE_OUTSIDE:
|
2014-11-29 00:39:09 +00:00
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-29 00:39:09 +00:00
|
|
|
|
if (rect->width <= 0 || rect->height <= 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
gtk_widget_queue_draw_area (widget,
|
|
|
|
|
allocation.x + rect->x,
|
|
|
|
|
allocation.y + rect->y,
|
|
|
|
|
rect->width,
|
|
|
|
|
rect->height);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_marks (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-11-21 07:29:37 +00:00
|
|
|
|
GdkRectangle slider;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
if (!priv->recalc_marks)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->recalc_marks = FALSE;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2014-11-21 07:29:37 +00:00
|
|
|
|
gtk_range_compute_slider_position (range, priv->marks[i], &slider);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2014-11-21 07:29:37 +00:00
|
|
|
|
priv->mark_pos[i] = slider.x + slider.width / 2;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
else
|
2014-11-21 07:29:37 +00:00
|
|
|
|
priv->mark_pos[i] = slider.y + slider.height / 2;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
static gboolean
|
2014-07-03 00:37:55 +00:00
|
|
|
|
gtk_range_real_change_value (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll,
|
|
|
|
|
gdouble value)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-05-25 13:44:29 +00:00
|
|
|
|
/* potentially adjust the bounds _before_ we clamp */
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_emit (range, signals[ADJUST_BOUNDS], 0, value);
|
2002-02-15 05:53:08 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (priv->adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = CLAMP (value, gtk_adjustment_get_lower (priv->adjustment),
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->round_digits >= 0)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2004-11-10 03:20:11 +00:00
|
|
|
|
gdouble power;
|
2004-10-06 05:11:36 +00:00
|
|
|
|
gint i;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
i = priv->round_digits;
|
2004-10-06 05:11:36 +00:00
|
|
|
|
power = 1;
|
|
|
|
|
while (i--)
|
|
|
|
|
power *= 10;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
|
2004-10-06 05:11:36 +00:00
|
|
|
|
value = floor ((value * power) + 0.5) / power;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (priv->in_drag || priv->autoscroll_id)
|
2014-11-21 07:50:38 +00:00
|
|
|
|
gtk_adjustment_set_value (priv->adjustment, value);
|
|
|
|
|
else
|
|
|
|
|
gtk_adjustment_animate_to_value (priv->adjustment, value);
|
2014-07-03 00:37:55 +00:00
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
return FALSE;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
struct _GtkRangeStepTimer
|
|
|
|
|
{
|
|
|
|
|
guint timeout_id;
|
|
|
|
|
GtkScrollType step;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
second_timeout (gpointer data)
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_scroll (range, priv->timer->step);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
1998-04-09 02:55:46 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
initial_timeout (gpointer data)
|
1998-05-03 22:41:32 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
2014-11-21 06:16:12 +00:00
|
|
|
|
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT,
|
2010-12-02 22:01:12 +00:00
|
|
|
|
second_timeout,
|
|
|
|
|
range);
|
2013-10-22 13:43:43 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* remove self */
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_add_step_timer (GtkRange *range,
|
|
|
|
|
GtkScrollType step)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2005-11-22 12:40:15 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_return_if_fail (priv->timer == NULL);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
g_return_if_fail (step != GTK_SCROLL_NONE);
|
2005-11-22 12:40:15 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer = g_new (GtkRangeStepTimer, 1);
|
1999-02-16 04:29:00 +00:00
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
|
2010-12-02 22:01:12 +00:00
|
|
|
|
initial_timeout,
|
|
|
|
|
range);
|
2013-10-22 13:43:43 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer->step = step;
|
2002-02-23 14:46:21 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gtk_range_scroll (range, priv->timer->step);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1999-02-04 16:12:35 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_remove_step_timer (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
if (priv->timer)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->timer->timeout_id != 0)
|
|
|
|
|
g_source_remove (priv->timer->timeout_id);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->timer);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer = NULL;
|
1998-05-03 22:41:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_has_origin (GtkRange *range,
|
|
|
|
|
gboolean has_origin)
|
|
|
|
|
{
|
|
|
|
|
range->priv->has_origin = has_origin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
_gtk_range_get_has_origin (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
return range->priv->has_origin;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_stop_values (GtkRange *range,
|
|
|
|
|
gdouble *values,
|
|
|
|
|
gint n_values)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->marks);
|
|
|
|
|
priv->marks = g_new (gdouble, n_values);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->mark_pos);
|
|
|
|
|
priv->mark_pos = g_new (gint, n_values);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->n_marks = n_values;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < n_values; i++)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->marks[i] = values[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->recalc_marks = TRUE;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gint
|
|
|
|
|
_gtk_range_get_stop_positions (GtkRange *range,
|
|
|
|
|
gint **values)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gtk_range_calc_marks (range);
|
|
|
|
|
|
|
|
|
|
if (values)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
*values = g_memdup (priv->mark_pos, priv->n_marks * sizeof (gint));
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return priv->n_marks;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
2010-08-12 23:50:09 +00:00
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_round_digits:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @round_digits: the precision in digits, or -1
|
|
|
|
|
*
|
|
|
|
|
* Sets the number of digits to round the value to when
|
|
|
|
|
* it changes. See #GtkRange::change-value.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
2010-08-12 23:50:09 +00:00
|
|
|
|
void
|
2011-01-15 05:08:39 +00:00
|
|
|
|
gtk_range_set_round_digits (GtkRange *range,
|
|
|
|
|
gint round_digits)
|
2010-08-12 23:50:09 +00:00
|
|
|
|
{
|
2011-01-15 05:08:39 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (round_digits >= -1);
|
|
|
|
|
|
2014-06-09 13:21:11 +00:00
|
|
|
|
if (range->priv->round_digits != round_digits)
|
|
|
|
|
{
|
|
|
|
|
range->priv->round_digits = round_digits;
|
|
|
|
|
g_object_notify (G_OBJECT (range), "round-digits");
|
|
|
|
|
}
|
2011-01-15 05:08:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_round_digits:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the number of digits to round the value to when
|
|
|
|
|
* it changes. See #GtkRange::change-value.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the number of digits to round to
|
2011-01-15 05:08:39 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_range_get_round_digits (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), -1);
|
|
|
|
|
|
|
|
|
|
return range->priv->round_digits;
|
2010-08-12 23:50:09 +00:00
|
|
|
|
}
|
2010-08-13 01:22:59 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_steppers (GtkRange *range,
|
|
|
|
|
gboolean has_a,
|
|
|
|
|
gboolean has_b,
|
|
|
|
|
gboolean has_c,
|
|
|
|
|
gboolean has_d)
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
range->priv->has_stepper_a = has_a;
|
|
|
|
|
range->priv->has_stepper_b = has_b;
|
|
|
|
|
range->priv->has_stepper_c = has_c;
|
|
|
|
|
range->priv->has_stepper_d = has_d;
|
2014-11-25 21:00:11 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
2010-08-13 01:22:59 +00:00
|
|
|
|
}
|