[Cuis-dev] Mold tool for GUI

Hilaire Fernandes hfern at free.fr
Sun Apr 16 09:04:26 PDT 2023


Hi folks,

Here is a first example of form declarations and validations:

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. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230416/b9c425b0/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/b9c425b0/attachment-0001.png>


More information about the Cuis-dev mailing list