2.22. hk_form

Hk_form represents a form.

Inherits from hk_presentation.

load_form([name])

Loads the form from a file, where 'name' is the name of the form

save_form([name[,ask]])

Saves the form to a file, where 'name' is the name of the file. if 'ask' is true and the form already exists you will be asked before the old form will be overwritten. Returns True if successful else False.

new_grid()

The form has to be in design mode to use this function! The function will create a new hk_dsgrid in the upper left corner and returns it if successful.

new_lineedit()

The form has to be in design mode to use this function! The function will create a new hk_dslineedit in the upper left corner and returns it if successful.

new_bool()

The form has to be in design mode to use this function! The function will create a new hk_dsboolean in the upper left corner and returns it if successful.

new_combobox()

The form has to be in design mode to use this function! The function will create a new hk_dscombobox in the upper left corner and returns it if successful.

new_button()

The form has to be in design mode to use this function! The function will create a new hk_button in the upper left corner and returns it if successful.

new_rowselector()

The form has to be in design mode to use this function! The function will create a new hk_dsrowselector in the upper left corner and returns it if successful.

new_memo()

The form has to be in design mode to use this function! The function will create a new hk_dsmemo in the upper left corner and returns it if successful.

new_label()

The form has to be in design mode to use this function! The function will create a new hk_label in the upper left corner and returns it if successful.

set_designsize(width,height[,registerchange])

Sets the real size of the form. If you designed a form in i.e. 800x600 resolution and want to watch it with 1024x768 resolution, set this to 1024x768. Dynamic sized visible objects will be resized. All objects will be positioned new.

get_visible(number)

returns an existing visible object of type hk_visible identified by a unique identifier number.

Important

To find this number, click on the object. In the caption of the property editor you can see the number in brackets.

To change the hk_visible object to the type you need there are some type casting functions

Figure 2-6. Type casting


get_visible(name)

returns an existing visible object of type hk_visible identified by a unique text identifier. This is a user-defined unique identifier and can be set in the property editor

The next program shows you how to start a form:


Example 2-8. displaying a form

   1 myform=hk_this.datasource().database().new_formvisible()
   2 myform.load_form("authorform")
   3 myform.set_mode(myform.viewmode)