+DbHintsupplies autocomplete suggestions from the database.
This example shows a
(gui 'nam '(+Var +DbHint +TextField) '*UsrNam '(nam +User) 30)
+TextFieldthat has been extended with two classes,
+Varconnects the field to a variable and
+DbHintfetches autocomplete suggestions from the database. As you can see,
+DbHintis given the argument
'(nam +User). This tells it to fetch the property "nam" from the class "+User". See also +hint, +Var and +TextField.
(diaform 'lst prg)
diaFormis 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.
diaformis 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.
See also form, idForm, dialog.
(de choItem (Dst) (diaform '(Dst) (<grid> "--.-." ... ... ) (gui 'query '(+QueryChart) (cho) ... ... ) (<table> 'chart (choTtl ,"Items" 'nr '+Item) ... ... ) (<spread> ... ... ) ) )
(dialog Env . Prg)
NILargument. 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:
In a disabled form, individual components can be activated using the
(form NIL (disable (> (12 24) (cdr (date (date))))) # Disable whole form (gui ..) .. )
+Ridprefix class. See also +Rid.
(delButton Able @Txt)
Note "'(field -1)" in the example above. This part refers to the +UpField. See also +Button, field, +Able, +UpField and gui.
(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 @)) ) )
+DstButton, Destination button, has a dual behaviour, manifesting itself as a button or a plain link. The button is always labeled as "@", but if
+DstButtonis 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,
+DstButtonmanifests 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.
+DstButtonwhen 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
+DstButtonwill manifest as a link and cause a jump to an object.
And presenting the result in a table:
'((This) (list This This (: pa) (: ma) (: mate) (: job) (: dat)))
See also +Set, +Able, +Close, +PickButton.
(<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)) ) ) )
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.
(gui '(+DateField) 10)