[clean-list] How can I select/unselect a custom control ?

Ferreira Maurizio maurizio.ferreira at seling.it
Tue May 17 11:14:48 MEST 2011


How can I select/unselect a custom control ?

It seems to me there are no functions to set/unset the select state of a custom control,
neither it changes state as you click on it or on another control in the same dialog.
In the following example I would like to change from selected state (Red) to Unselected (Green).

Any suggestion ?

Regards
Maurizio

module hello

import StdEnv, StdIO

Start world
  #(ids,world) = openIds 2 world
  = startIO NDI "ps" (snd o openDialog 1 (hello ids) ) [ProcessClose closeProcess] world

where

  hello [id1,id2] = Dialog "Hello dialog"
          (CustomControl {w=50,h=30} showcustom [ ControlPos (Left, zero)
                                                , ControlId id1
                                                , ControlSelectState Able
                                                , ControlFunction myfun
                                                ]
          :+:
          EditControl "" (PixelWidth 100) 1 [ControlPos (Left, zero), ControlId id2]
          )
          [ WindowClose  (noLS closeProcess)
          , WindowViewSize {w=150, h=80}
          , WindowPos (Fix, OffsetVector {vx=400, vy=350})
          ]

  myfun st = st

  showcustom Able {newFrame} picture
    # picture = setPenColour Red picture
    = fill newFrame picture

  showcustom Unable {newFrame} picture
    # picture = setPenColour Green picture
    = fill newFrame picture

-------------- next part --------------


-----------------------------------------------------------------------------

Il presente messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate ed ? destinato esclusivamente al destinatario sopra indicato, il quale ? l'unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilit?, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato ? avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario ? severamente proibito, ed ? pregato di rinviarlo immediatamente al mittente distruggendone l'originale. 


This message, together with its annex(es), contains information to be deemed strictly confidential and is destined only to the addressee(s) identified above who only may use, copy and, under his/their responsibility, further disseminate it. If anyone received this message by mistake or reads it without entitlement is forewarned that keeping, copying, disseminating or distributing this message to persons other than the addressee(s) is strictly forbidden and is asked to transmit it immediately to the sender and to erase the original message received.



More information about the clean-list mailing list