[Cuis-dev] Mold tool for GUI

Mariano Montone marianomontone at gmail.com
Sun Apr 16 10:41:49 PDT 2023


Very nice 👏

El dom., 16 abr. 2023 13:05, Hilaire Fernandes via Cuis-dev <
cuis-dev at lists.cuis.st> escribió:

> Hi folks,
>
> Here is a first example of form declarations and validations:
> [image: form]
>
>   | mold panel |
>     mold := Mold new.
>     (mold stringField)
>         label: 'Firstname:';
>         on: #propertyValue of: ValueHolder new;
>         beRequired.
>     (mold stringField)
>         label: 'Lastname:';
>         on: #propertyValue of: ValueHolder new;
>         addCondition: [:input| input size >= 2]
>         labeled: [:input | 'There is no such short name.'];
>         beRequired: 'Lastname required.'.
>     (mold dateField )
>         label: 'Birth date:';
>         on: #propertyValue of: ValueHolder new;
>         beRequired.
>
>     panel := nil.
>     panel := PluggableDialogPanel
>         open: mold
>         label: 'Example One'
>         view: #renderForms
>         accept: [mold validate.
>             panel morphExtent: panel minimumExtent. "I don't like to do it manually"
>             mold isValid     ifTrue: [
>                 mold save.
>                 panel delete] ]
>
>
> It is in the Cuis-Smalltalk-UI repo, I also added a PluggableDialogPanel.
>
> One point I don't like, not related to the forms, is after each form
> validation I have to manualy resize the Panel, because depending on error
> message. See my comment in the code example.
> Hilaire
>
>
> --
> GNU Dr. Geohttp://drgeo.euhttp://blog.drgeo.eu
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230416/0a06f6e7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran de 2023-04-16 17-54-07.png
Type: image/png
Size: 20337 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230416/0a06f6e7/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran de 2023-04-16 17-54-07.png
Type: image/png
Size: 20337 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230416/0a06f6e7/attachment-0003.png>


More information about the Cuis-dev mailing list