hk_button

Represents a button in a form. If set_is_togglebutton(True) was called, this button toggles, otherwise it will go to non-pushed state after being clicked

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

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

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.

set_is_togglebutton(istoggle [,registerchange [,forcesetting]])

if istoggle is True, the button will remain in its pushed or non-pushed state after clicking, else it will always switch back to non-pushed state

is_togglebutton()

returns whether or not this is a toggle button

set_is_pushed(ispushed [,registerchange [,forcesetting]])

if this is a togglebutton you can set its default state. If ispushed is True it will start as a pushed button

is_pushed()

returns whether or not this togglebutton is in pushed state. If this button is not a togglebutton the result is undefined.