2.2. hk_button

Represents a button in a form.

Inherits from hk_dsvisible.

set_action(action,object[,showmaximized[, registerchange]])

. when the button is pushed the action will be executed on the object Allowed actions are:

  • open_form

  • close_form

  • open_table

  • open_query

  • preview_report

  • print_report

  • goto_firstrow

  • goto_lastrow

  • goto_nextrow

  • goto_previousrow

  • insert_row

  • delete_row

  • store_row

  • action_query

The parameter 'object' is the name of the used object e.g. a form name (if you want to open a form).

The parameter 'showmaximized': if true show the window maximized else show the new window in its origin or default size.

The parameter 'registerchange': if this button is part of a form and any registerchange is true, the changes will be stored when you close the window

Example: to open the form "test" use


Example 2-1. Open a form when pushing a button

   1 button.set_action("open_form","test")

set_action(action,object[,showmaximized[, registerchange]])

. The same as the function above, except that 'action' is anumeric value. Allowed values are:

  • 0: open_form

  • 1: close_form

  • 2: open_table

  • 3: open_query

  • 4: preview_report

  • 5: print_report

  • 6: goto_firstrow

  • 7: goto_lastrow

  • 8: goto_nextrow

  • 9: goto_previousrow

  • 10: insert_row

  • 11: delete_row

  • 12: store_row

  • 13: action_query


Example 2-2. Open a form when pushing a button

   1 button.set_action(0,"test")

object()

returns the set object name.

action()

returns the set action number. For a detailled list see set_action

show_maximized()

returns wether the used object will be displayed maximized. This value is set with set_object()

set_database(database)

At least a database object of type hk_database has to be set to be able to automatically load forms etc.

database()

returns the set hk_database object.