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

TEXT

Convert Edit Field to Static Edit Field and back


The following code will change an active EF to a static EF and back again:
COMPILE 0, _caseInsensitive

LOCAL FN changeEFType(type%)
  GET FIELD efHndl&,1
  EDIT FIELD#1,&efHndl&,,type%
  KILL FIELD efHndl&
END FN

LOCAL FN buildWnd
  WINDOW#1,"Change EFType.demo",(0,0)-(350,180),_docNoGrow
  EDIT FIELD#1,"Sample Text",(30,30)-(300,100),_framed,_leftJust
  BUTTON#1,_activeBtn,"Static EF",(80,120)-(180,150),_push
  BUTTON#2,_activeBtn,"Active EF",(200,120)-(300,150),_push
END FN

LOCAL FN doDialog
  evnt=DIALOG(0)
  id=DIALOG(evnt)
  SELECT evnt
    CASE _btnClick
      SELECT id
        CASE 1                                    
          FN changeEFType(5)                      'Static EF
          EDIT FIELD(0)                           'Deactivate EF
        CASE 2                                  
          FN changeEFType(2)                      'Active EF
          EDIT FIELD(1)                           'Activate EF
      END SELECT
    CASE _wndClose
      END
  END SELECT
END FN

FN buildWnd
ON DIALOG FN doDialog
DO
  HANDLEEVENTS
UNTIL 0
Steve Van Voorst