CHECK Controls & STATE3

From a 2020 discussion…

MUST probably should have emphasized.

Taking it a bit further, I tried setting PROP:State3Value in code. However, this was ONLY applied to the control when STATE3(Value) had been included for the check control on the window. There does not appear to be PROP:State3 itself that presumably might be required prior to using PROP:State3Value.

Am I missing something here or has SV simply not fully implemented the feature?

You can create a state3 check by using CREATE:State3. Then your PROP:State3Value will work as expected.

  PROGRAM

  MAP
  END

FEQ          LONG
CheckUse     BYTE

Window        WINDOW('State3'),AT(,,100,100),GRAY,FONT('Segoe UI',9)
              END

  CODE
  
  OPEN(Window)
  FEQ = CREATE(0,CREATE:state3)
  FEQ{PROP:Text} = 'Click Me'
  SETPOSITION(FEQ,2, 2)
  UNHIDE(FEQ)
  DO DisplaySettings
  FEQ{PROP:Use} = CheckUse
  FEQ{PROP:State3Value} = 2
  ACCEPT
    CASE EVENT()
    OF EVENT:Accepted
      DO DisplaySettings
    END    
  END
  
DisplaySettings               ROUTINE
  
  0{PROP:Text} = 'Check Value: ' & CheckUse

So a different control than CREATE:Check. Never would have expected that.
Unfortunately, being able to turn STATE3 on/off based on another control as I had hoped, becomes a bit more problematic.

It is doable, though.

Faking it might be better if one ever needs to revisit the code.

I don’t know, man. Seems pretty simple to write a class that does the thing. In the Init(), pass the original checkFEQ. Create a hidden state3 checkbox. Mimic a few properties. Write a method called setCheckType. Unhide the one you want. Hide the one you don’t.

Agree in principle, especially now that your reply prompted a reminder of the parent parameter in CREATE. However, using hide/unhide on string(s) included on the window MIGHT be made to convey the same information (or actually more) for the users.