Class Button

Summary

#
  This is the parent class of the button classes, including
  checkboxes.

  A {Button} produces and {Event} of code {0} when the button is
  depressed, and code {1} when it is released.

  By default, when a button holds the keyboard focus a dashed
  line appears just within the button.  Then, when return is
  pressed an event of code {2} is generated.  The method
  {_Dialog.set_initial_focus()} can be used to have the button
  have the focus when the dialog is first displayed.

  Buttons also repeatedly produce an event of -1 whilst they
  are held down, rather like a repeating keyboard press.  The
  delay between the initial repeat event and subsequent repeat
  events is set in the parent dialog (see above).

Superclasses:
Component, Toggle

Package:
(main)
File:
_button.icn
Methods:
clear_is_checked, go_down, go_up, handle_event, set_img, set_imgs, set_is_checked, set_label, set_no_keyboard, set_parent_button_group, tick, toggle_is_checked

Methods inherited from Component:
accepts_tab_focus, attrib, clear_accepts_tab_focus, clear_draw_border, clear_is_shaded, clear_no_updates, display, do_shading, error, final_setup, finally, firstly, generate_all_components, generate_components, get_cbwin_reference, get_cwin_reference, get_h_reference, get_parent_Dialog, get_parent_buffer_win, get_parent_win, get_visible_reference, get_w_reference, get_x_reference, get_y_reference, got_focus, handle_notify, in_region, is_hidden, is_shaded, is_unhidden, is_unshaded, lost_focus, parse_pos, redisplay, resize, set_abs_coords, set_abs_size, set_accepts_tab_focus, set_align, set_attribs, set_attribs_list, set_draw_border, set_is_shaded, set_no_updates, set_parent_Dialog, set_pos, set_size, set_tooltip, toggle_draw_border, toggle_is_shaded, unique_end, unique_start

Methods inherited from MetaComponent:
set_fields

Methods inherited from Ticker:
is_ticking, retime_ticker, set_ticker, stop_ticker

Methods inherited from Toggle:
get_status, into_cbg, is_checked, set_parent_check_box_group

Fields:
img_down, img_h, img_up, img_w, is_checkbox_flag, is_checked_flag, is_down, is_held, label, no_keyboard_flag, parent_button_group, parent_check_box_group, repeat_delay

Source code.

Details
Constructor

Button(argv)

Methods:

clear_is_checked()

#
  Set the status to unchecked.

This method overrides clear_is_checked in class Toggle

go_down()


go_up()


handle_event(e)

This method overrides handle_event in class Component

set_img(x)

#
  Set the image (if any) to the given string, which should be in Icon image
  format.
  @param x   The image


set_imgs(x, y)

#
  Set the up/down images (if any) to the strings provided,
  which should be in Icon image format.
  The two images must have the same dimensions.
  @param x   The up image
  @param y   The down image


set_is_checked()

#
  Set the status to checked.

This method overrides set_is_checked in class Toggle

set_label(x)

#
  Set the label of the button, if any.
  @param x   The label


set_no_keyboard()

#
  Invoking this method disables the keyboard control over the
  button described above.  No dashed line will ever appear in
  the button display and return will have no effect on the
  button even if it has the focus.


set_parent_button_group(x)


tick()

This method overrides tick in class Ticker

toggle_is_checked()

#
  Toggle the checked status of the button.  This method, and
  the following two methods, may be
  inappropriate for non-toggle styles of button.

This method overrides toggle_is_checked in class Toggle
Fields:
img_down

img_h

img_up

img_w

is_checkbox_flag

is_checked_flag

is_down

is_held

label

no_keyboard_flag

parent_button_group

parent_check_box_group

repeat_delay


This page produced by UniDoc on 2021/04/15 @ 23:59:53.