[futurebasic] Re: [FB] EF color change TROUBLE according to data

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2000 : Group Archive : Group : All Groups

From: "Terrald J. Smith" <tjsmith@...>
Date: Wed, 12 Jul 2000 06:20:02 -0500
Here is code that I changed to to try and convert to FB^3...It works and
does not flicker

> But if I use Robin's idea, each Edit Field must be highlighted in advance.
> then final appearance is full of flickers!
> 
> Is there any other idea ?

LOCAL FN hideObj(wndClass,FBrefNum)
  DIM t,l,b,r
  DIM objElem,ctrlHndl&,TEHndl&
  objElem = FN pGgetRef(wndClass,FBrefNum)
  SELECT gObjKind
    CASE _buttonObj
      LONG IF gObjZType
        ctrlHndl& = BUTTON&(FBrefNum)
        LONG IF ctrlHndl&
          t;8 = [ctrlHndl&]+_contrlRect
          LONG IF l > -4000
            CALL OFFSETRECT(t,-5000,0)
            BUTTON FBrefNum,,,@t
          END IF
        END IF
      END IF
    CASE _styleObj
      TEHndl& = TEHANDLE(FBrefNum)
      t;8 = [TEHndl&]+ _TEViewRect
      LONG IF t > -4000
        CALL INVALRECT(gObjSelT)
        CALL OFFSETRECT(#[TEHndl&],-5000,-5000)   'move it off the top
        CALL OFFSETRECT(#[TEHndl&]+ _TEViewRect,-5000,-5000)
        gObjBGreen = gObjZType
        gObjZtype  = _statFramed
      END IF
  END SELECT
END FN
LOCAL FN showObj(wndClass,FBrefNum)
  DIM t,l,b,r
  DIM objElem,ctrlHndl&,TEHndl&
  objElem = FN pGgetRef(wndClass,FBrefNum)
  SELECT gObjKind
    CASE _buttonObj
      LONG IF gObjZType
        ctrlHndl& = BUTTON&(FBrefNum)
        LONG IF ctrlHndl&
          t;8 = [ctrlHndl&]+_contrlRect
          LONG IF l < -4000
            BUTTON FBrefNum,,,@gObjT
          END IF
        END IF
      END IF
    CASE _styleObj
      TEHndl& = TEHANDLE(FBrefNum)
      t;8 = [TEHndl&]+ _TEViewRect
      LONG IF t < -4000
        CALL OFFSETRECT(#[TEHndl&],5000,5000)
        CALL OFFSETRECT(#[TEHndl&]+ _TEViewRect,5000,5000)
        CALL INVALRECT(gObjSelT)
        gObjZtype  = gObjBGreen
      END IF
  END SELECT
END FN

LOCAL FN CHANGETEXT(COLORF,gSTYLE,gCOLOR)
  LONG IF EDIT$(ABS(COLORF))<>gCOLORTEXT$
    FN hideObj(gWhichClass,COLORF)
    EDIT FIELD -ABS(COLORF),gCOLORTEXT$,,_NOFRAMEDNOCR
    'SETSELECT 0,_maxInt
    SELECT gSTYLE                                 'NORMAL
      CASE 0
        SELECT gCOLOR
          CASE 0                                  'BLACK
            EDIT TEXT _geneva,,0,,0,0,0
          CASE 1                                  'RED
            EDIT TEXT _geneva,,0,,-1,0,0
          CASE 2                                  'BLUE
            EDIT TEXT _geneva,,0,,0,0,-1
        END SELECT
      CASE 1                                      'BOLD
        SELECT gCOLOR
          CASE 0                                  'BLACK
            EDIT TEXT _geneva,,1,,0,0,0
          CASE 1                                  'RED
            EDIT TEXT _geneva,,1,,-1,0,0
        END SELECT
    END SELECT
    IF COLORF>0 THEN EDIT FIELD -COLORF,,,_STATNOFRAMED
    EDIT FIELD 0
    FN showObj(gWhichClass,COLORF)
  END IF
  COLOR=_ZBlack
  TEXT _geneva,12,0
END FN


The Dummy,
Terrald