<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Dear Maurizio,<br>
    <br>
    The selectstate of a control tells whether the control accepts
    (Able) or does not accept (Unable) keyboard/mouse input. In your
    example, its initial selectstate is Able. To change the selectstate,
    use the functions enableControl and disableControl. For instance,
    add the following control to your dialog:<br>
    <br>
    <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { newLS&nbsp; = True<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , newDef = ButtonControl "Enable/Disable"
      [ControlFunction (toggle id1)]<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
    </tt><br>
    and include its callback function:<br>
    <br>
    <tt>&nbsp; toggle id1 (able,pst)<br>
      &nbsp;&nbsp;&nbsp; = (not able,appPIO (if able disableControl enableControl id1)
      pst)<br>
    </tt><br>
    This creates a button control with a local boolean state (initially
    True), that, when clicked, toggles the current selectstate of the
    custom control. <br>
    <br>
    Object I/O has no support for telling a control whether or not the
    mouse is entering or leaving a control. I am not sure if that is
    what you're after. <br>
    <br>
    Regards,<br>
    Peter<br>
    <br>
    On 5/17/2011 11:14 AM, Ferreira Maurizio wrote:
    <blockquote
cite="mid:E89B74EF2DA1894882807F197A1212220C6B43D330@itgoa00ms-020.selingdom.local"
      type="cite">
      <pre wrap="">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

</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>


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

Il presente messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate ed &egrave; destinato esclusivamente al destinatario sopra indicato, il quale &egrave; l'unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilit&agrave;, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato &egrave; avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario &egrave; severamente proibito, ed &egrave; 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.

</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
clean-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:clean-list@science.ru.nl">clean-list@science.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/clean-list">http://mailman.science.ru.nl/mailman/listinfo/clean-list</a>
</pre>
    </blockquote>
  </body>
</html>