FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

PG PRO

Show/hide list in PG


STAZ sent me these and while it was not for a list, it worked perfectly:
'
' This set of functions let you show or hide
' window objects. FN showObj works with fields and
' buttons. FN showUserObj works with user items
'

DEF FN pGcountObj(objListID)       USING GLBLcountObj&
DEF FN pGgetObj(objListID,objElem) USING GLBLgetObj&
DEF FN pGputObj(objListID,objElem) USING GLBLputObj&
DEF FN pGgetRef(objListID,theRef)  USING GLBLgetRef&
'=================
LOCAL FN showObj(wClass,objRef,show)
  '---------------------------------------
  objElem = FN pGgetRef(wClass,objRef)
  FN pGgetObj(wClass,objElem)
  LONG IF show
    
    LONG IF gObjKind > 100
      gObjKind = gObjKind - 100
      FN pGputObj(wClass,objElem)
      LONG IF WINDOW(_outputWClass) = wClass
        oldFld = WINDOW(_EFNum)
        SELECT gObjKind
          CASE _styleObj
            gObjZJust = gObjZJust + (gObjFRed<<2)
            LONG IF gObjResID
              resHndl& = FN GETRESOURCE(_"pG3t",gObjResID)
              LONG IF resHndl&
                EDIT FIELD -gObjRef,&resHndl&,(gObjL,gObjT)-(gObjR,gObjB),gObjZType,gObjZJust
              END IF
            XELSE
              EDIT FIELD -gObjRef,"",@gObjT,gObjZType,gObjZJust
            END IF
          CASE _pictObj
            LONG IF gObjResID
              PICTURE FIELD gObjRef,%gObjResID,@gObjT,gObjZType,gObjZJust
            XELSE
              PICTURE FIELD gObjRef,"",@gObjT,gObjZType,gObjZJust
            END IF
          CASE _buttonObj
            LONG IF gObjZType
              objText$ = STR#(_baseID,gObjElement)
              BUTTON gObjRef,gObjCtrlVal,objText$,@gObjT,gObjZType
            END IF
        END SELECT
        EDIT FIELD oldFld
      END IF
    END IF
    
  XELSE
    LONG IF gObjKind < 100
      LONG IF WINDOW(_outputWClass) = wClass
        SELECT gObjKind
          CASE _styleObj
            EDIT FIELD CLOSE gObjRef
          CASE _pictObj
            PICTURE FIELD CLOSE gObjRef
          CASE _buttonObj
            BUTTON CLOSE gObjRef
        END SELECT
      END IF
      gObjKind = gObjKind + 100
      FN pGputObj(wClass,objElem)
    END IF
    
  END IF
END FN

'=================
LOCAL FN showUserObj(wClass,objCon,show)
  '---------------------------------------
  FN pGgetObj(wClass,objCon)
  LONG IF show
    LONG IF gObjKind > 100
      gObjKind = gObjKind - 100
      LONG IF WINDOW(_outputWClass) = wClass
        CALL INVALRECT(gObjSelT)
      END IF
    END IF
  XELSE
    LONG IF gObjKind < 100
      gObjKind = gObjKind + 100
      LONG IF WINDOW(_outputWClass) = wClass
        CALL ERASERECT(gObjSelT)
      END IF
    END IF
  END IF
  FN pGputObj(wClass,objCon)
END FN

'=================
LOCAL FN showAllObjects(wClass)
  '---------------------------------------
  count = FN pGcountObj(wClass)
  LONG IF count
    FOR obj = 1 TO count
      FN pGgetObj(wClass,obj)
      FN showObj(wClass,obj,_zTrue)
    NEXT obj
  END IF
END FN
GB

I found a solution to the problem previously discussed. Namely, treat the scroll list as a button, _grayBtn the critter, then hide it. To show simply reverse the process.

Thanks for the code, but I already have that code. My problem was with lists. You can't hide them unless you first dim them. It took me a while to figure that out.

Tedd