|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.lib.min_interactor | +--sub_arctic.lib.base_interactor | +--sub_arctic.lib.h_slider_display | +--sub_arctic.lib.h_slider | +--sub_arctic.lib.h_scrollbar
This is a "style-free" horizontal scrollbar interactor. It works with the style_manager and a style object to get its style. It provides a variable sized thumb that represents how much of a whole is being presented.
Field Summary | |
protected int |
_cur_thumb_size
Size of current thumb (so we know if we need to replace it) |
protected double |
_thumb_percentage
This is the amount as a percentage (0..1) of size the thumb takes up. |
protected double |
_thumb_scale
The amount we scale thumb_percentage (which is in the range 0..1) by when return it (or accept it) as an integer through the part_b interface. |
protected int |
_usable_area
This holds the usable area of the scrollbar. |
Fields inherited from class sub_arctic.lib.h_slider |
_callback_obj,
DYNAMIC_CALLBACK,
STATIC_CALLBACK |
Fields inherited from class sub_arctic.lib.h_slider_display |
_back_img,
_boxed,
_large_inc,
_left_img,
_max_val,
_min_val,
_right_img,
_small_inc,
_thumb_img,
_thumb_shift,
_value |
Fields inherited from class sub_arctic.lib.base_interactor |
_child_index,
_child_list,
_clip_bounds,
_constraint_flags,
_enabled_constraint,
_flags,
_h,
_h_constraint,
_parent,
_part_a_constraint,
_part_b_constraint,
_user_data,
_visible_constraint,
_w,
_w_constraint,
_x,
_x_constraint,
_y,
_y_constraint,
default_child_hint |
Constructor Summary | |
h_scrollbar(callback_object co)
Minimal constructor for a horizontal scrollbar. |
|
h_scrollbar(int x,
int y,
int w,
callback_object co)
Create a horizontal scrollbar with some reasonable defaults. |
|
h_scrollbar(int x,
int y,
int w,
int min,
int max,
int init,
double percent,
int small,
int large,
callback_object co)
Create a horizontal scrollbar at a given location on the screen with a given width. |
Method Summary | |
void |
calculate_thumb_image()
This does the work of actually establish a proper thumb image. |
protected void |
compute_usable_area()
This computes the usable area of the scrollbar. |
void |
configure()
We override configure so we can automatically update the size of the scrollbar thumb. |
protected void |
init()
Internal function to initialize the scrollbar. |
int |
intrinsic_constraints()
Indicate which values (coordinates/sizes) of this object are intrinsically constrained by the internals of the object. |
int |
part_b()
Return the value of the part_b component of this object. |
void |
set_part_b(int v)
Set the part_b component of this object. |
protected void |
set_raw_part_b(int v)
Set part_b value directly bypassing the constraint system (but doing damage). |
void |
set_thumb_percentage(double d)
Set the percentage of the whole size the thumb is now occupying. |
void |
style_changed()
This function gets called when the system's style resources change or we are getting initialized. |
protected int |
thumb_offset()
Compute the offset to the thumb in pixels. |
double |
thumb_percentage()
Retrieve the amount of space covered by the thumb. |
double |
thumb_scale()
The amount we scale thumb_percentage (which is in the range 0..1) by when return it (or accept it) as an integer through the part_b interface. |
void |
thumb_scale(double v)
The amount we scale thumb_percentage (which is in the range 0..1) by when return it (or accept it) as an integer through the part_b interface. |
Methods inherited from class sub_arctic.lib.h_slider |
callback_obj,
drag_end,
drag_feedback,
drag_start,
dynamic_callback,
first_callback_num,
last_callback_num,
press,
release,
set_callback_obj,
static_callback |
Methods inherited from class sub_arctic.lib.h_slider_display |
back_img,
boxed,
conform,
draw_self_local,
large_inc,
left_img,
max_val,
min_val,
part_a,
right_img,
set_back_img,
set_boxed,
set_large_inc,
set_left_img,
set_max_val,
set_min_val,
set_part_a,
set_raw_part_a,
set_right_img,
set_small_inc,
set_thumb_img,
set_thumb_shift,
set_value,
small_inc,
thumb_img,
thumb_shift,
value |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected int _usable_area
protected double _thumb_scale
protected double _thumb_percentage
protected int _cur_thumb_size
Constructor Detail |
public h_scrollbar(int x, int y, int w, int min, int max, int init, double percent, int small, int large, callback_object co)
int
- x the x position of this object.int
- y the y position of this object.int
- w the width of this object.int
- min the min value of this object.int
- max the max value of this object.int
- init the initial value of this object.double
- percent the size of the scrollbar (larger than
zero, less than or equal to one).int
- small the small increment value (which occurs
when you press a end button).int
- large the large increment value (which occurs
when you click in the thumb area).callback_object
- co the object to send callbacks to (#0 is the
mouse has been released and the thumb is
stopped moving and #1 is the thumb is
being dragged).public h_scrollbar(int x, int y, int w, callback_object co)
int
- x the x position of the interactor.int
- y the x position of the interactor.int
- w the width of the interactor.callback_object
- co the object to send callbacks to.public h_scrollbar(callback_object co)
callback_object
- co the object to send callbacks toMethod Detail |
public int intrinsic_constraints()
protected int thumb_offset()
protected void compute_usable_area()
public int part_b()
protected void set_raw_part_b(int v)
int
- v the new value for part_b.public void set_part_b(int v)
int
- v the value new value of part_b.public double thumb_scale()
thumb_percentage()
public void thumb_scale(double v)
double
- v the new scale value.thumb_percentage()
public double thumb_percentage()
thumb_scale()
public void calculate_thumb_image()
public void set_thumb_percentage(double d)
double
- the percentage of the size of the scrollbar the thumb
is occupying (0.0 < this number <= 1.0)thumb_scale()
,
part_b()
protected void init()
public void style_changed()
public void configure()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |