+DbHint
+DbHint
supplies autocomplete suggestions from the database.
(gui 'nam '(+Var +DbHint +TextField) '*UsrNam '(nam +User) 30)
This example shows a +TextField
that has been extended with two
classes, +Var
and +DbHint
. +Var
connects the field to a variable and +DbHint
fetches
autocomplete suggestions from the database. As you can see,
+DbHint
is given the argument '(nam +User)
. This
tells it to fetch the property "nam" from the class "+User". See also +hint, +Var and +TextField.
+Dflt
(diaform 'lst prg)
diaForm
is a form that has a dual nature in that it can
behave both as a form and as a dialog. When called from a form, by pressing
a button (POST) it shows up as a dialog. Otherwise, when called via a link
(GET), it shows up as a form. diaform
is commonly used in
search dialogs, often together with an idForm
. This way,
functionality to search for, select and edit objects is combined in a single
page of the application.
(de choItem (Dst)
(diaform '(Dst)
(<grid> "--.-."
...
... )
(gui 'query '(+QueryChart) (cho)
...
... )
(<table> 'chart (choTtl ,"Items" 'nr '+Item)
...
... )
(<spread>
...
... ) ) )
See also form, idForm, dialog.
(dialog Env . Prg)
(disable Flg)
NIL
argument. It overrides the standard form enable/disable, in that it can
disable the form even if it would be otherwise enabled. This affects all
components in this form. The following example makes a form read-only until
Christmas:
(form NIL
(disable (> (12 24) (cdr (date (date))))) # Disable whole form
(gui ..)
.. )
In a disabled form, individual components can be activated using the
+Rid
prefix class. See also +Rid.
(delButton Able @Txt)
+DelRowButton
+DnButton
+Drop
(gui '(+Able +UpField) '(not (: home obj jpg)) 30)
(gui '(+Drop +Button) '(field -1)
'(if (: home obj jpg) ,"Uninstall" ,"Install")
'(cond
((: home obj jpg)
(ask ,"Uninstall Picture?"
(put!> (: home top 1 obj) 'jpg NIL) ) )
((: drop) (blob! (: home obj) 'jpg @)) ) )
Note "'(field -1)" in the example above. This part refers to the +UpField.
See also +Button, field, +Able, +UpField and gui.
+DstButton
+DstButton
, Destination button, has a dual behaviour,
manifesting itself as a button or a plain link. The button is always labeled
as "@", but if +DstButton
is used in a dialog which chooses an
object to be stored in a field of the calling form it manifests as a button.
In this case, pressing the button stores the object in the destination
field. Otherwise, +DstButton
manifests itself as a plain link
and clicking the link causes a jump to that object. Typical usage is in
choice (search) dialogs, which are used both for jumping to objects and for
selecting objects in other forms.+DstButton
when presenting the
search result in a QueryChart
. Since we are not about to choose
an object to be stored in a field of the calling form, this
+DstButton
will manifest as a link and cause a jump to an
object.
'((This) (list This This (: pa) (: ma) (: mate) (: job) (: dat)))
And presenting the result in a table:
(<table> 'chart NIL
'((btn) (NIL "Name") (NIL "Father") (NIL "Mother") (NIL "Partner") (NIL "Occupation") (NIL "born"))
(do (cho)
(<row> (alternating)
(gui 1 '(+DstButton) Dst)
(gui 2 '(+ObjView +TextField) '(: nm))
(gui 3 '(+ObjView +TextField) '(: nm))
(gui 4 '(+ObjView +TextField) '(: nm))
(gui 5 '(+ObjView +TextField) '(: nm))
(gui 6 '(+TextField))
(gui 7 '(+DateField)) ) ) )
See also +Set, +Able, +Close, +PickButton.
+DateField
(gui '(+DateField) 10)
The date format displayed and accepted by the +DateField is determined by
the current locale, and the field returns an error when a date not matching
the locale is entered. +DateField does some extra work to handle user input,
independant of locale. Entering a small number is expanded to mean day of
the current month, and entering larger numbers expand to day/ month or
day/month/year.