http://www.aftergrasp.com/download/agsetup_20080317.exe
----------------------------------------------------------------------------
Mon, 17 March 2008
Crashing bugs in XMLSAVE fixed, but it still does not write changes
made to the loaded data.
Many new commands TEXTLINESXY, TEXTSTRPOSITIONXY, DRAWLISTINSIDE,
DRAWLISTBEGIN, DRAWLISTEND, DRAWLISTNEXT, DRAWLISTPREV,
DRAWLISTLINEBEGIN, DRAWLISTLINEEND, DRAWLISTLINENEXT, DRAWLISTLINEPREV,
ARRAYINSERT and ARRAYDELETE.
ARRAYINSERT and ARRAYDELETE are for numericly indexed arrays only.
Insert is used to insert new members into an array, renumbering
upward members which follow. Delete to remove members, and renumber
downward members which follow.
ARRAYINSERT ARRAY START INSERTCOUNT
ARRAYINSERT ARRAY START INSERTARRAY
ARRAYDELETE ARRAY START DELETECOUNT
INSERTCOUNT and DELETECOUNT both default to 1.
Runable Example:
drawclear
test = array(a,b,c,d)
arrayinsert test 2 3
test[2] = x
test[3] = y
test[4] = z
arraydelete test 3
arrayinsert test 3 array(i,j,k)
messagebox strlist(@test) ; displays a, x, i, j, k, z, b, c, d
exitnow
TEXTLINESXY and TEXTSTRPOSITIONXY work like TEXTLINESHEIGHT and
TEXTSTRPOSITIONHEIGHT in that they calculate spacing. But instead of
returning height, they return an array of X Y positions, one coordinate
for every character in the TEXTSTRING. The first two elements in
the array are reserved for the width/height of the text area. Each
pair of integer elements which follow are the X, Y coordinates.
SET XYARRAY TEXTLINESXY(TEXTSTRING, WIDTH, STARTLINE)
SET XYARRAY TEXTLINESXY(TEXTSTRING, WIDTH, STARTLINE, LINECOUNT)
SET XYARRAY TEXTSTRPOSITIONXY(TEXTSTRING, WIDTH, STRPOSITION)
SET XYARRAY TEXTSTRPOSITIONXY(TEXTSTRING, WIDTH, STRPOSITION, ENDSTRPOSITION)
DRAWLISTINSIDE works a little like DRAWINSIDE, but it is given a array of
coordinates, and a region. It returns the index of which is the first coordinate
pair that is the upper left hand corner of a box which contains the coordinate.
DRAWLISTINSIDE returns 0 for no match. This is most useful for determining which
character someone clicked on in a block of complexly formatted text.
ARRAYINDEX = DRAWLISTINSIDE(XYARRAY, XPOS, YPOS)
ARRAYINDEX = DRAWLISTINSIDE(XYARRAY, XPOS, YPOS, MINX, MINY, MAXX, MAXY)
DRAWLISTBEGIN searches backward from INDEX for the first coordinate
identical to the coordinate at INDEX. DRAWLISTEND finds the last
coordinate identical to the coordinate at INDEX.
ARRAYINDEX = DRAWLISTBEGIN(XYARRAY, INDEX)
ARRAYINDEX = DRAWLISTEND(XYARRAY, INDEX)
The code for both is the same as this script code:
drawlistbegin:
declare index
index = @index*2
local xpos @xyarray[@index]
local ypos @xyarray[@index+1]
local result @index/2
for i from @index-2 to 2 step -2
if (@xpos==@xyarray[@i])&&(@ypos==@xyarray[@i+1])
local result @i/2
endif
next
return @result
drawlistend:
declare index
index = @index*2
local xpos @xyarray[@index]
local ypos @xyarray[@index+1]
local result @index/2
for i from @index+2 to @xyarray->dim1-2 step 2
if (@xpos==@xyarray[@i])&&(@ypos==@xyarray[@i+1])
local result @i/2
endif
next
return @result
DRAWLISTPREV searches backward from INDEX for the first coordinate
different from the coordinate at INDEX. DRAWLISTNEXT finds the next
coordinate different from the coordinate at INDEX.
ARRAYINDEX = DRAWLISTPREV(XYARRAY, INDEX)
ARRAYINDEX = DRAWLISTNEXT(XYARRAY, INDEX)
The code for both is the same as this script code:
drawlistprev:
declare index
index = @index*2
local xpos @xyarray[@index]
local ypos @xyarray[@index+1]
local result 1
for i from @index-2 to 2 step -2
if (@xpos!=@xyarray[@i])||(@ypos!=@xyarray[@i+1])
local result @i/2
break
endif
next
return @result
drawlistnext:
declare index
index = @index*2
local xpos @xyarray[@index]
local ypos @xyarray[@index+1]
local result @xyarray->dim1/2
for i from @index+2 to @xyarray->dim1-2 step 2
if (@xpos!=@xyarray[@i])||(@ypos!=@xyarray[@i+1])
local result @i/2
break
endif
next
return @result
DRAWLISTLINENEXT searches XYARRAY for next index which changes
Y position down, but has the same X position. If Y changes again, use
furthest right X.
DRAWLISTLINEPREV searches XYARRAY for previous index which changes
Y position up, but has the same X position. If Y changes again, use
furthest right X.
ARRAYINDEX = DRAWLISTLINENEXT(XYARRAY, INDEX)
ARRAYINDEX = DRAWLISTLINEPREV(XYARRAY, INDEX)
DRAWLISTLINEBEGIN searches XYARRAY for start of line.
DRAWLISTLINEEND searches XYARRAY for end of current line.
ARRAYINDEX = DRAWLISTLINEBEGIN(XYARRAY, INDEX)
ARRAYINDEX = DRAWLISTLINEEND(XYARRAY, INDEX)
Notes on use for cursor keys:
Left arrow does DRAWLISTNEXT
Right arrow does DRAWLISTPREV
Down arrow does DRAWLISTLINENEXT
Up arrow does DRAWLISTLINEPREV
Home does DRAWLISTLINEBEGIN
End does DRAWLISTLINEEND
Selecting a block of text, DRAWLISTBEGIN on start, and DRAWLISTEND
on selection end.
----------------------------------------------------------------------------