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

WINDOWS

Split a window


To "split" a window try changing the value of "T" in FN FBScroll to allow room for the headers:
COMPILE 0, _caseInsensitive

LOCAL FN buildWnd
  WINDOW#1,"Date+Scroll.Demo",(30,40)-(400,300)
  EDIT FIELD#1,"Headers go up here.",(60,10)-(250,30),213,2

  EDIT FIELD#2,"",(100,60)-(200,80),5,2           'Date
  EDIT FIELD#3,"Use vertical scroll.",(90,130)-(220,150),5,2
  EDIT FIELD#4,"Bottom",(100,210)-(200,230),5,2
  SCROLL BUTTON#1,1,1,8,5,,_scrollVert
  SCROLL BUTTON#2,1,1,8,5,,_scrollHorz
  CALL IUDATESTRING([_Time],_LongDate,LongDate$)
  EDIT$(2)=RIGHT$(LongDate$,4)
END FN

LOCAL MODE
DIM T,L,B,R
LOCAL FN FBScroll(DeltaHorz,DeltaVert)
  LONG IF DeltaHorz OR DeltaVert
    AUTOCLIP = 0
    'Change T to width of top margin
    T = 35 : L = 0 : B = WINDOW(_height)-1 : R = WINDOW(_width)-1
    RGN&=FN NEWRGN
    CALL SCROLLRECT(T,DeltaHorz,DeltaVert,RGN&)
    CALL INVALRGN(RGN&)
    CALL DISPOSERGN(RGN&)
    FieldHndl& = [WNDBLK + WINDOW(WINDOW(_activeWnd))*16 + 4]
    WHILE FieldHndl&
      FieldPtr&=[[[FieldHndl&]+8]]
      CALL OFFSETRECT(#FieldPtr&+_teDestRect,DeltaHorz,DeltaVert)
      CALL OFFSETRECT(#FieldPtr&+_teViewRect,DeltaHorz,DeltaVert)
      FieldHndl& = [[FieldHndl&]]
    WEND
    NextControl&=[WINDOW(_WndPointer)+_wControlList]
    WHILE NextControl&
      CRfCon&=(FN GETCREFCON(NextControl&) AND &E0000000) >> 29
      LONG IF CRfCon& <> 5 AND CRfCon& <> 6
        CALL OFFSETRECT(#[NextControl&]+_ContrlRect,DeltaHorz%,DeltaVert%)
      END IF
      NextControl& = [[NextControl&]+_NextControl]
    WEND
    WINDOW FILL                                 
    AUTOCLIP = 1
  END IF
END FN

LOCAL FN doDialog
  evnt=DIALOG(0)
  id=DIALOG(evnt)
  SELECT evnt
    CASE _btnClick
      moveDir=(BUTTON - BUTTON(id))*25
      SELECT id
        CASE 1
          FN FBScroll(0,moveDir)
        CASE 2
          FN FBScroll(moveDir,0)
      END SELECT
    CASE _wndClose
      END
  END SELECT
END FN

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