User Tools

Site Tools


prop_defermove.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:DeferMove ====== Previous pageReturn to chapter overviewNext page

A property of the SYSTEM built-in variable that defers the resizing and/or movement of controls until the end of the ACCEPT loop or SYSTEM{PROP:DeferMove} is reset to zero (0). This disables the immediate effect of all assignments to position and size properties, enabling the library to perform all moves at once (which eliminates temporarily overlapping controls). The absolute value of the number assigned to SYSTEM{PROP:DeferMove} defines the number of deferred moves for which space is pre-allocated (automatically expanded when necessary, but less efficient and may fail). Assigning a positive number automatically resets PROP:DeferMove to zero at the next ACCEPT, while a negative number leaves it set until explicitly reset to zero (0).

In multi-threaded applications, the setting of SYSTEM{PROP:DeferMove} to a non-zero value initiates the deferred move for the current thread only.

NoteBox.jpg

PROP:DeferMove is ignored if PROP:LazyDisplay is set to zero (0).

Example:

WinView WINDOW('View'),AT(0,0,320,200),MDI,MAX,HVSCROLL

        IMAGE(),AT(0,0,,),USE(?Image)

        BUTTON('New Picture'),AT(160,180,60,20),USE(?NewPic)

        BUTTON('Close'),AT(80,180,60,20),USE(?Close)

       END

FileName    STRING(64)                 !Filename variable

ImageWidth  SHORT

ImageHeight SHORT

CODE

OPEN(WinView)

DISABLE(?LastPic)

IF NOT FILEDIALOG('Choose File to View',FileName,'BitMap|*.BMP|PCX|*.PCX',0)

 RETURN                        !Return if no file chosen

END

?Image{PROP:Text} = FileName

ACCEPT

 CASE ACCEPTED()

 OF ?NewPic

  IF NOT FILEDIALOG('Choose File to View',FileName,'BitMap|*.BMP|PCX|*.PCX',0)

   BREAK                       !Return if no file chosen

  END

  ?Image{PROP:Text} = FileName

  SYSTEM{PROP:DeferMove} = 4               !Defer move and resize

  ImageWidth = ?Image{PROP:Width}          !1 move

  ImageHeight = ?Image{PROP:Height}        !2 moves

  IF ImageWidth > 320

   ?Image{PROP:Width} = 320

   ?Image{PROP:XPos} = 0

  ELSE

   ?Image{PROP:XPos} = (320 - ImageWidth) / 2    !Center horizontally

  END

  IF ImageHeight > 180

   ?Image{PROP:Height} = 180

   ?Image{PROP:YPos} = 0

  ELSE

   ?Image{PROP:YPos} = (180 - ImageHeight) / 2   !Center vertically

  END

 OF ?Close

  BREAK

 END

END             !Moves and resizing happens at the end of the ACCEPT loop

prop_defermove.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1