[futurebasic] Re: [FB] Greyed items in a Dialog

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Mel & Carol Patrick <mel@...>
Date: Tue, 18 May 1999 08:33:28 -0700
>No, I use the Dialog Manager to tell me when the user "hits" an item in
>the dialog. The dialog has a sort of event loop which handles this
>nicely. That part is not a concern to me. I just want to know how to
>gray out or disable a dialog item.

Heres a snippet of one of the DLOG functions (got lots of DLOG functions)
that I use for item control hilighting.

'
LOCAL FN EnableDlgItem(DLOGptr&,whichItem,enabled)
  DIM rect;8:'                                               common rect
  CALL GETDITEM(DLOGptr&,whichItem,theType,theHandle&,rect):'       read
  LONG IF (theType AND _CtrlItem) = _CtrlItem
    IF enabled THEN Highlight = 0 ELSE Highlight = 255
    CALL HILITECONTROL (theHandle&, Highlight)
  END IF
END FN

Pass it the DLOGptr (the window pointer for the DLOG), the item # in the
dlog and _True or _False (for enable/disable).

Heres one for toggling a check box :

'
LOCAL FN GetControlVal(DLOGptr&,whichItem):'              values a check box
  DIM rect;8:'                                                   common rect
  CALL GETDITEM(DLOGptr&,whichItem,theType,theHandle&,rect):'           read
END FN=FN GETCTLVALUE(theHandle&):'                            get the value
'
LOCAL FN ToggleDlgCheckBox(DLOGptr&,whichItem):'     toggles a check box
  DIM rect;8:'                                               common rect
  CALL GETDITEM(DLOGptr&,whichItem,theType,theHandle&,rect):'       read
  CALL SETCTLVALUE (theHandle&,(FN GETCTLVALUE(theHandle&) AND 1) XOR 1)
  theVal=FN GetControlVal(DLOGptr&,whichItem):'   then the control val
END FN = theVal
'

Even got ones for a series of radio buttons if anyone needs it.

Mel Patrick
mel@...