|
|||||||||
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.multi_button | +--sub_arctic.lib.toggle
This class is a common superclass for checkbox and radio_button. This object currently may be instantiated to get the old subarctic look, but this may go away in the future.
Toggles may be put into groups in by selecting some toggle (some instance of this class or its subclasses) as the "leader" of the group. Having done this, you should create the leader object with no other toggle as its "group_with" parameter when you create it. When you create all the other members of the group however, they should be "linked" to the leader either by naming the leader in the constructor or by using the add_to_group_of with the leader as the "name" of the group. You can drop any items from the group by using the drop_from_group. A toggle may be in only one group at a time. If you drop the leader from a group, the remaining members stay in the group and "elect" a new leader (although it doesn't matter, since they are already in the group).
Frequently, people can use the text_toggle_collection object and get the behaviors they need for forming groups without understanding the above.
text_toggle_collection
Field Summary | |
protected static loaded_image[] |
_default_look
Images for default normal appearance of a toggle. |
protected toggle |
_group_link
Link for circular list of radio button group. |
Fields inherited from class sub_arctic.lib.multi_button |
_callback_obj,
_cur_state,
_in_transition,
_state_looks,
_transition_looks,
BUTTON_ACTION_CALLBACK |
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 | |
toggle(int x,
int y,
callback_object call_obj)
Default appearance constructor. |
|
toggle(int x,
int y,
loaded_image[] st_looks,
loaded_image[] trans_looks,
toggle group_with,
callback_object call_obj)
Full constructor. |
Method Summary | |
void |
add_to_group_of(toggle other)
Add us to the group the given toggle is in. |
static loaded_image[] |
default_look()
Images for default normal appearance of a toggle. |
static loaded_image[] |
default_transition()
Images for default transition appearance of a toggle. |
void |
drop_from_group()
Drop us from our current group |
toggle |
group_link()
Link for circular list of radio button group. |
protected toggle |
group_prev()
Return the previous toggle in our circular group list. |
int |
next_state()
Override next_state to provide group behavior. |
void |
set_cur_state(int st)
Override set_cur_state to reset other group members (if any) if we are being set (put in state 1). |
Methods inherited from class sub_arctic.lib.multi_button |
calc_size,
callback_obj,
cur_state,
do_action,
do_callback,
draw_self_local,
first_callback_num,
get_state_look,
get_transition_look,
inout_drag_end,
inout_drag_enter,
inout_drag_exit,
inout_drag_start,
intrinsic_constraints,
last_callback_num,
part_a,
press,
release,
set_callback_obj,
set_looks,
set_part_a,
set_raw_part_a,
set_state_look,
set_transition_look,
state_looks,
transition_looks |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected toggle _group_link
protected static loaded_image[] _default_look
Constructor Detail |
public toggle(int x, int y, loaded_image[] st_looks, loaded_image[] trans_looks, toggle group_with, callback_object call_obj)
int
- x x position of the toggle.int
- y y position of the toggle.loaded_image[]
- st_looks set of images for normal looks.loaded_image[]
- trans_looks set of images for looks during
transitions between states (can be
null to denote not special transition
appearances).toggle
- group_with toggle to group this with to get
radio_button semantics (or null for
no grouping).callback_object
- call_obj object that gets callbacks about
state changes.public toggle(int x, int y, callback_object call_obj)
int
- x x position of the toggle.int
- y y position of the toggle.callback_object
- call_obj object that gets callbacks about
state changes.Method Detail |
public toggle group_link()
public void set_cur_state(int st)
int
- st new state.public int next_state()
protected toggle group_prev()
public void drop_from_group()
public void add_to_group_of(toggle other)
toggle
- other the toggle whose group we are joining.public static loaded_image[] default_look()
public static loaded_image[] default_transition()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |