mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-06-29 11:40:38 +00:00
Begins implementing ways to watch UDTs.
Still in a non-working state.
This commit is contained in:
parent
96a8d40227
commit
2fc7380fa6
|
@ -7,7 +7,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
STATIC AS _OFFSET vw_idehwnd
|
STATIC AS _OFFSET vw_idehwnd
|
||||||
STATIC vw_buffer$
|
STATIC vw_buffer$
|
||||||
DIM AS LONG vw_i, vw_tempIndex, vw_localIndex, vw_varSize, vw_cmdsize
|
DIM AS LONG vw_i, vw_tempIndex, vw_localIndex, vw_varSize, vw_cmdsize
|
||||||
DIM AS _OFFSET vw_address, vw_lbound, vw_ubound
|
DIM AS _OFFSET vw_address, vw_elementoffset, vw_lbound, vw_ubound
|
||||||
DIM AS _MEM vw_m, vw_m2
|
DIM AS _MEM vw_m, vw_m2
|
||||||
DIM AS _BYTE vw_isarray
|
DIM AS _BYTE vw_isarray
|
||||||
DIM vw_start!, vw_temp$, vw_cmd$, vw_value$, vw_k&, vw_buf$, vw_scope$, vw_varType$
|
DIM vw_start!, vw_temp$, vw_cmd$, vw_value$, vw_k&, vw_buf$, vw_scope$, vw_varType$
|
||||||
|
@ -19,8 +19,8 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
SUB unlockvWatchHandle
|
SUB unlockvWatchHandle
|
||||||
SUB set_qbs_size (target AS _OFFSET, BYVAL length&)
|
SUB set_qbs_size (target AS _OFFSET, BYVAL length&)
|
||||||
FUNCTION stop_program_state&
|
FUNCTION stop_program_state&
|
||||||
FUNCTION check_lbound%&(array AS _OFFSET)
|
FUNCTION check_lbound%& (array AS _OFFSET)
|
||||||
FUNCTION check_ubound%&(array AS _OFFSET)
|
FUNCTION check_ubound%& (array AS _OFFSET)
|
||||||
END DECLARE
|
END DECLARE
|
||||||
|
|
||||||
$IF WIN THEN
|
$IF WIN THEN
|
||||||
|
@ -259,14 +259,15 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
vw_isarray = _CV(_BYTE, MID$(vw_value$, 5, 1))
|
vw_isarray = _CV(_BYTE, MID$(vw_value$, 5, 1))
|
||||||
vw_localIndex = CVL(MID$(vw_value$, 6, 4))
|
vw_localIndex = CVL(MID$(vw_value$, 6, 4))
|
||||||
vw_arrayIndex = CVL(MID$(vw_value$, 10, 4))
|
vw_arrayIndex = CVL(MID$(vw_value$, 10, 4))
|
||||||
vw_varSize = CVL(MID$(vw_value$, 14, 4))
|
vw_elementoffset = _CV(_OFFSET, MID$(vw_value$, 14, LEN(vw_elementoffset)))
|
||||||
vw_i = CVI(MID$(vw_value$, 18, 2))
|
vw_varSize = CVL(MID$(vw_value$, 14 + LEN(vw_elementoffset), 4))
|
||||||
|
vw_i = CVI(MID$(vw_value$, 18 + LEN(vw_elementoffset), 2))
|
||||||
IF vw_i THEN
|
IF vw_i THEN
|
||||||
vw_scope$ = MID$(vw_value$, 20, vw_i)
|
vw_scope$ = MID$(vw_value$, 20 + LEN(vw_elementoffset), vw_i)
|
||||||
vw_i = CVI(MID$(vw_value$, 20 + vw_i, 2))
|
vw_i = CVI(MID$(vw_value$, 20 + LEN(vw_elementoffset) + vw_i, 2))
|
||||||
vw_varType$ = RIGHT$(vw_value$, vw_i)
|
vw_varType$ = RIGHT$(vw_value$, vw_i)
|
||||||
ELSE
|
ELSE
|
||||||
vw_i = CVI(MID$(vw_value$, 20, 2))
|
vw_i = CVI(MID$(vw_value$, 20 + LEN(vw_elementoffset), 2))
|
||||||
vw_varType$ = RIGHT$(vw_value$, vw_i)
|
vw_varType$ = RIGHT$(vw_value$, vw_i)
|
||||||
END IF
|
END IF
|
||||||
IF vw_cmd$ = "get global var" THEN
|
IF vw_cmd$ = "get global var" THEN
|
||||||
|
@ -280,6 +281,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
END IF
|
END IF
|
||||||
vw_address = _MEMGET(vw_m, vw_address, _OFFSET) 'first resolve pass
|
vw_address = _MEMGET(vw_m, vw_address, _OFFSET) 'first resolve pass
|
||||||
vw_address = _MEMGET(vw_m, vw_address, _OFFSET) 'second resolve pass
|
vw_address = _MEMGET(vw_m, vw_address, _OFFSET) 'second resolve pass
|
||||||
|
vw_address = vw_address + vw_elementoffset
|
||||||
|
|
||||||
IF vw_isarray THEN
|
IF vw_isarray THEN
|
||||||
vw_lbound = check_lbound%&(vw_address)
|
vw_lbound = check_lbound%&(vw_address)
|
||||||
|
@ -482,5 +484,4 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
PUT #vw_ideHost, , vw_cmd$
|
PUT #vw_ideHost, , vw_cmd$
|
||||||
vw_cmd$ = ""
|
vw_cmd$ = ""
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
END SUB
|
END SUB
|
||||||
|
|
|
@ -7390,7 +7390,7 @@ SUB DebugMode
|
||||||
END IF
|
END IF
|
||||||
GOSUB GetVarSize
|
GOSUB GetVarSize
|
||||||
IF LEN(cmd$) THEN
|
IF LEN(cmd$) THEN
|
||||||
cmd$ = cmd$ + MKL$(tempIndex&) + _MK$(_BYTE, usedVariableList(tempIndex&).isarray) + MKL$(usedVariableList(tempIndex&).localIndex) + MKL$(tempArrayIndex&) + MKL$(varSize&) + MKI$(LEN(usedVariableList(tempIndex&).subfunc)) + usedVariableList(tempIndex&).subfunc + MKI$(LEN(usedVariableList(tempIndex&).varType)) + usedVariableList(tempIndex&).varType
|
cmd$ = cmd$ + MKL$(tempIndex&) + _MK$(_BYTE, usedVariableList(tempIndex&).isarray) + MKL$(usedVariableList(tempIndex&).localIndex) + MKL$(tempArrayIndex&) + _MK$(_OFFSET, usedVariableList(tempIndex&).elementOffset) + MKL$(varSize&) + MKI$(LEN(usedVariableList(tempIndex&).subfunc)) + usedVariableList(tempIndex&).subfunc + MKI$(LEN(usedVariableList(tempIndex&).varType)) + usedVariableList(tempIndex&).varType
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
END IF
|
END IF
|
||||||
LOOP
|
LOOP
|
||||||
|
@ -7649,6 +7649,7 @@ SUB showvWatchPanel (this AS vWatchPanelType, currentScope$, totalVisibleVariabl
|
||||||
thisName$ = LEFT$(thisName$, LEN(thisName$) - 1) + _
|
thisName$ = LEFT$(thisName$, LEN(thisName$) - 1) + _
|
||||||
LTRIM$(STR$(tempArrayIndex&)) + ")"
|
LTRIM$(STR$(tempArrayIndex&)) + ")"
|
||||||
END IF
|
END IF
|
||||||
|
thisName$ = thisName$ + usedVariableList(tempIndex&).elements
|
||||||
item$ = thisName$ + SPACE$(longestVarName - LEN(thisName$)) + " = "
|
item$ = thisName$ + SPACE$(longestVarName - LEN(thisName$)) + " = "
|
||||||
IF usedVariableList(tempIndex&).subfunc = currentScope$ OR usedVariableList(tempIndex&).subfunc = "" THEN
|
IF usedVariableList(tempIndex&).subfunc = currentScope$ OR usedVariableList(tempIndex&).subfunc = "" THEN
|
||||||
isString = (INSTR(usedVariableList(tempIndex&).varType, "STRING *") > 0 OR usedVariableList(tempIndex&).varType = "STRING")
|
isString = (INSTR(usedVariableList(tempIndex&).varType, "STRING *") > 0 OR usedVariableList(tempIndex&).varType = "STRING")
|
||||||
|
@ -7963,7 +7964,7 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction)
|
||||||
FOR y = 1 TO totalVariablesCreated
|
FOR y = 1 TO totalVariablesCreated
|
||||||
usedVariableList(y).mostRecentValue = ""
|
usedVariableList(y).mostRecentValue = ""
|
||||||
IF usedVariableList(y).watch THEN
|
IF usedVariableList(y).watch THEN
|
||||||
thisLen = LEN(usedVariableList(y).name)
|
thisLen = LEN(usedVariableList(y).name) + LEN(usedVariableList(y).elements)
|
||||||
IF usedVariableList(y).isarray THEN
|
IF usedVariableList(y).isarray THEN
|
||||||
thisLen = thisLen + LEN(STR$(CVL(RIGHT$(usedVariableList(y).indexes, 4)))) - 1
|
thisLen = thisLen + LEN(STR$(CVL(RIGHT$(usedVariableList(y).indexes, 4)))) - 1
|
||||||
END IF
|
END IF
|
||||||
|
@ -8065,20 +8066,26 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction)
|
||||||
v$ = ideinputbox$("Watch UDT", temp$, "", "", 45, 0, ok)
|
v$ = ideinputbox$("Watch UDT", temp$, "", "", 45, 0, ok)
|
||||||
IF ok THEN
|
IF ok THEN
|
||||||
IF LEFT$(v$, 1) <> "." THEN v$ = "." + v$
|
IF LEFT$(v$, 1) <> "." THEN v$ = "." + v$
|
||||||
|
usedVariableList(varDlgList(y).index).elements = v$
|
||||||
v$ = lineformat$(UCASE$(v$))
|
v$ = lineformat$(UCASE$(v$))
|
||||||
getid usedVariableList(varDlgList(y).index).id
|
getid usedVariableList(varDlgList(y).index).id
|
||||||
Error_Happened = 0
|
Error_Happened = 0
|
||||||
result$ = udtreference$("", v$, typ)
|
result$ = udtreference$("", v$, typ)
|
||||||
IF Error_Happened THEN
|
IF Error_Happened THEN
|
||||||
|
Error_Happened = 0
|
||||||
result = idemessagebox("Error", Error_Message, "#OK")
|
result = idemessagebox("Error", Error_Message, "#OK")
|
||||||
usedVariableList(varDlgList(y).index).watch = 0
|
usedVariableList(varDlgList(y).index).watch = 0
|
||||||
|
usedVariableList(varDlgList(y).index).elements = ""
|
||||||
|
usedVariableList(varDlgList(y).index).elementOffset = 0
|
||||||
GOTO unWatch
|
GOTO unWatch
|
||||||
ELSE
|
ELSE
|
||||||
result = idemessagebox("Result", v$ + "\n" + result$ + "\n" + STR$(typ), "#OK")
|
'result = idemessagebox("Result", v$ + "\n" + result$ + "\n" + STR$(typ), "#OK")
|
||||||
usedVariableList(varDlgList(y).index).watch = 0: GOTO unWatch 'temporarily
|
usedVariableList(varDlgList(y).index).elementOffset = VAL(MID$(result$, _INSTRREV(result$, sp3) + 1))
|
||||||
END IF
|
END IF
|
||||||
ELSE
|
ELSE
|
||||||
usedVariableList(varDlgList(y).index).watch = 0
|
usedVariableList(varDlgList(y).index).watch = 0
|
||||||
|
usedVariableList(varDlgList(y).index).elements = ""
|
||||||
|
usedVariableList(varDlgList(y).index).elementOffset = 0
|
||||||
GOTO unWatch
|
GOTO unWatch
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
@ -8284,264 +8291,6 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar, returnAction)
|
||||||
RETURN
|
RETURN
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION ideelementwatchbox$(currentPath$, elementIndexes$, ok)
|
|
||||||
|
|
||||||
'-------- generic dialog box header --------
|
|
||||||
PCOPY 4, 0
|
|
||||||
PCOPY 0, 2
|
|
||||||
PCOPY 0, 1
|
|
||||||
SCREEN , , 1, 0
|
|
||||||
focus = 1
|
|
||||||
DIM p AS idedbptype
|
|
||||||
DIM o(1 TO 100) AS idedbotype
|
|
||||||
DIM sep AS STRING * 1
|
|
||||||
sep = CHR$(0)
|
|
||||||
'-------- end of generic dialog box header --------
|
|
||||||
|
|
||||||
'-------- init --------
|
|
||||||
|
|
||||||
ok = 0
|
|
||||||
variableNameColor = 3
|
|
||||||
typeColumnColor = 15
|
|
||||||
selectedBG = 2
|
|
||||||
|
|
||||||
totalElements = LEN(elementIndexes$) \ 4
|
|
||||||
REDIM varDlgList(1 TO totalElements) AS varDlgList
|
|
||||||
dialogHeight = (totalElements) + 4
|
|
||||||
i = 0
|
|
||||||
IF dialogHeight > idewy + idesubwindow - 6 THEN
|
|
||||||
dialogHeight = idewy + idesubwindow - 6
|
|
||||||
END IF
|
|
||||||
IF dialogHeight < 5 THEN dialogHeight = 5
|
|
||||||
|
|
||||||
|
|
||||||
GOSUB buildList
|
|
||||||
dialogWidth = 6 + longestName + maxTypeLen
|
|
||||||
IF dialogWidth < 40 THEN dialogWidth = 40
|
|
||||||
IF dialogWidth > idewx - 8 THEN dialogWidth = idewx - 8
|
|
||||||
|
|
||||||
idepar p, dialogWidth, dialogHeight, "Add UDT Elements"
|
|
||||||
|
|
||||||
i = i + 1: varListBox = i
|
|
||||||
o(varListBox).typ = 2
|
|
||||||
o(varListBox).y = 2
|
|
||||||
o(varListBox).w = dialogWidth - 4: o(i).h = dialogHeight - 4
|
|
||||||
IF o(varListBox).txt = 0 THEN o(varListBox).txt = idenewtxt(l$) ELSE idetxt(o(varListBox).txt) = l$
|
|
||||||
|
|
||||||
i = i + 1: buttonSet = i
|
|
||||||
o(buttonSet).typ = 3
|
|
||||||
o(buttonSet).y = dialogHeight
|
|
||||||
IF o(buttonSet).txt = 0 THEN
|
|
||||||
o(buttonSet).txt = idenewtxt("#Add All" + sep + "#Remove All" + sep + "#Close")
|
|
||||||
END IF
|
|
||||||
|
|
||||||
'-------- end of init --------
|
|
||||||
|
|
||||||
'-------- generic init --------
|
|
||||||
FOR i = 1 TO 100: o(i).par = p: NEXT 'set parent info of objects
|
|
||||||
'-------- end of generic init --------
|
|
||||||
|
|
||||||
DO 'main loop
|
|
||||||
|
|
||||||
'-------- generic display dialog box & objects --------
|
|
||||||
idedrawpar p
|
|
||||||
f = 1: cx = 0: cy = 0
|
|
||||||
FOR i = 1 TO 100
|
|
||||||
IF o(i).typ THEN
|
|
||||||
'prepare object
|
|
||||||
o(i).foc = focus - f 'focus offset
|
|
||||||
o(i).cx = 0: o(i).cy = 0
|
|
||||||
idedrawobj o(i), f 'display object
|
|
||||||
IF o(i).cx THEN cx = o(i).cx: cy = o(i).cy
|
|
||||||
END IF
|
|
||||||
NEXT i
|
|
||||||
lastfocus = f - 1
|
|
||||||
'-------- end of generic display dialog box & objects --------
|
|
||||||
|
|
||||||
'-------- custom display changes --------
|
|
||||||
COLOR 0, 7
|
|
||||||
temp$ = currentPath$
|
|
||||||
IF LEN(temp$) > p.w - 4 THEN temp$ = STRING$(3, 250) + RIGHT$(temp$, p.w - 7)
|
|
||||||
_PRINTSTRING (p.x + 2, p.y + 1), temp$
|
|
||||||
|
|
||||||
'-------- end of custom display changes --------
|
|
||||||
|
|
||||||
'update visual page and cursor position
|
|
||||||
PCOPY 1, 0
|
|
||||||
IF cx THEN SCREEN , , 0, 0: LOCATE cy, cx, 1: SCREEN , , 1, 0
|
|
||||||
|
|
||||||
'-------- read input --------
|
|
||||||
change = 0
|
|
||||||
DO
|
|
||||||
GetInput
|
|
||||||
IF mWHEEL THEN change = 1
|
|
||||||
IF KB THEN change = 1
|
|
||||||
IF mCLICK THEN mousedown = 1: change = 1
|
|
||||||
IF mRELEASE THEN mouseup = 1: change = 1
|
|
||||||
IF mB THEN change = 1
|
|
||||||
alt = KALT: IF alt <> oldalt THEN change = 1
|
|
||||||
oldalt = alt
|
|
||||||
_LIMIT 100
|
|
||||||
LOOP UNTIL change
|
|
||||||
IF alt AND NOT KCTRL THEN idehl = 1 ELSE idehl = 0
|
|
||||||
'convert "alt+letter" scancode to letter's ASCII character
|
|
||||||
altletter$ = ""
|
|
||||||
IF alt AND NOT KCTRL THEN
|
|
||||||
IF LEN(K$) = 1 THEN
|
|
||||||
k = ASC(UCASE$(K$))
|
|
||||||
IF k >= 65 AND k <= 90 THEN altletter$ = CHR$(k)
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
SCREEN , , 0, 0: LOCATE , , 0: SCREEN , , 1, 0
|
|
||||||
'-------- end of read input --------
|
|
||||||
|
|
||||||
'-------- generic input response --------
|
|
||||||
info = 0
|
|
||||||
IF K$ = "" THEN K$ = CHR$(255)
|
|
||||||
IF KSHIFT = 0 AND K$ = CHR$(9) THEN focus = focus + 1
|
|
||||||
IF (KSHIFT AND K$ = CHR$(9)) OR (INSTR(_OS$, "MAC") AND K$ = CHR$(25)) THEN focus = focus - 1: K$ = ""
|
|
||||||
IF focus < 1 THEN focus = lastfocus
|
|
||||||
IF focus > lastfocus THEN focus = 1
|
|
||||||
f = 1
|
|
||||||
FOR i = 1 TO 100
|
|
||||||
t = o(i).typ
|
|
||||||
IF t THEN
|
|
||||||
focusoffset = focus - f
|
|
||||||
ideobjupdate o(i), focus, f, focusoffset, K$, altletter$, mB, mousedown, mouseup, mX, mY, info, mWHEEL
|
|
||||||
END IF
|
|
||||||
NEXT
|
|
||||||
'-------- end of generic input response --------
|
|
||||||
IF (focus = 2 AND info <> 0) THEN 'add all
|
|
||||||
FOR y = 1 TO totalElements
|
|
||||||
varDlgList(y).selected = -1
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag) = variableNameColor
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag2) = typeColumnColor
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).bgColorFlag) = selectedBG
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).indicator) = 43 '+
|
|
||||||
NEXT
|
|
||||||
_CONTINUE
|
|
||||||
END IF
|
|
||||||
|
|
||||||
IF (focus = 3 AND info <> 0) THEN 'remove all
|
|
||||||
FOR y = 1 TO totalElements
|
|
||||||
varDlgList(y).selected = 0
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag) = 16
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag2) = 2
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).bgColorFlag) = 17
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).indicator) = 32 'space
|
|
||||||
NEXT
|
|
||||||
_CONTINUE
|
|
||||||
END IF
|
|
||||||
|
|
||||||
IF K$ = CHR$(27) OR (focus = 4 AND info <> 0) THEN
|
|
||||||
'build element list to return
|
|
||||||
WHILE mb: GetInput: WEND
|
|
||||||
EXIT FUNCTION
|
|
||||||
END IF
|
|
||||||
|
|
||||||
IF mCLICK AND focus = 1 THEN 'list click
|
|
||||||
IF timeElapsedSince(lastClick!) < .3 AND clickedItem = o(varListBox).sel THEN
|
|
||||||
GOTO toggleWatch
|
|
||||||
END IF
|
|
||||||
lastClick! = TIMER
|
|
||||||
IF o(varListBox).sel > 0 THEN clickedItem = o(varListBox).sel
|
|
||||||
_CONTINUE
|
|
||||||
END IF
|
|
||||||
|
|
||||||
IF (K$ = CHR$(13) AND focus = 1) THEN
|
|
||||||
K$ = ""
|
|
||||||
toggleWatch:
|
|
||||||
y = ABS(o(varListBox).sel)
|
|
||||||
|
|
||||||
IF y >= 1 AND y <= totalElements THEN
|
|
||||||
varDlgList(y).selected = NOT varDlgList(y).selected
|
|
||||||
IF varDlgList(y).selected THEN
|
|
||||||
varType$ = typeNames$(y)
|
|
||||||
IF INSTR(varType$, "STRING *") THEN varType$ = "STRING"
|
|
||||||
nativeDataTypes$ = "@_BYTE@_UNSIGNED _BYTE@BYTE@UNSIGNED BYTE@INTEGER@_UNSIGNED INTEGER@UNSIGNED INTEGER@LONG@_UNSIGNED LONG@UNSIGNED LONG@_INTEGER64@INTEGER64@_UNSIGNED _INTEGER64@UNSIGNED INTEGER64@SINGLE@DOUBLE@_FLOAT@FLOAT@STRING@"
|
|
||||||
IF INSTR(nativeDataTypes$, varType$) = 0 THEN
|
|
||||||
'It's a UDT
|
|
||||||
elementIndexes2$ = ""
|
|
||||||
thisUDT = 0
|
|
||||||
E = 0
|
|
||||||
FOR i = 1 TO lasttype
|
|
||||||
IF RTRIM$(udtxcname(i)) = varType$ THEN thisUDT = i: EXIT FOR
|
|
||||||
NEXT
|
|
||||||
|
|
||||||
i = 0
|
|
||||||
DO
|
|
||||||
IF E = 0 THEN E = udtxnext(thisUDT) ELSE E = udtenext(E)
|
|
||||||
IF E = 0 THEN EXIT DO
|
|
||||||
elementIndexes2$ = elementIndexes2$ + MKL$(E)
|
|
||||||
i = i + 1
|
|
||||||
LOOP
|
|
||||||
v$ = ideelementwatchbox$(currentPath$ + RTRIM$(udtecname(varDlgList(y).index)) + ".", elementIndexes2$, ok2)
|
|
||||||
IF ok2 THEN
|
|
||||||
ELSE
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag) = variableNameColor
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag2) = typeColumnColor
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).bgColorFlag) = selectedBG
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).indicator) = 43 '+
|
|
||||||
ELSE
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag) = 16
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).colorFlag2) = 2
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).bgColorFlag) = 17
|
|
||||||
ASC(idetxt(o(varListBox).txt), varDlgList(y).indicator) = 32 'space
|
|
||||||
END IF
|
|
||||||
END IF
|
|
||||||
_CONTINUE
|
|
||||||
END IF
|
|
||||||
|
|
||||||
'end of custom controls
|
|
||||||
mousedown = 0
|
|
||||||
mouseup = 0
|
|
||||||
LOOP
|
|
||||||
|
|
||||||
'idevariablewatchbox$ = ""
|
|
||||||
EXIT FUNCTION
|
|
||||||
|
|
||||||
buildList:
|
|
||||||
maxTypeLen = 0
|
|
||||||
DIM typeNames$(1 TO totalElements)
|
|
||||||
FOR x = 1 TO totalElements
|
|
||||||
thisType = CVL(MID$(elementIndexes$, x * 4 - 3, 4))
|
|
||||||
IF LEN(RTRIM$(udtecname(thisType))) > longestName THEN longestName = LEN(RTRIM$(udtecname(thisType)))
|
|
||||||
varDlgList(x).index = thisType
|
|
||||||
id.t = udtetype(thisType)
|
|
||||||
id.tsize = udtesize(thisType)
|
|
||||||
typeNames$(x) = id2fulltypename$
|
|
||||||
thisLen = LEN(typeNames$(x))
|
|
||||||
IF thisLen > maxTypeLen THEN maxTypeLen = thisLen
|
|
||||||
NEXT
|
|
||||||
|
|
||||||
l$ = ""
|
|
||||||
FOR x = 1 TO totalElements
|
|
||||||
thisElement = CVL(MID$(elementIndexes$, x * 4 - 3, 4))
|
|
||||||
l$ = l$ + CHR$(17)
|
|
||||||
varDlgList(x).bgColorFlag = LEN(l$) + 1
|
|
||||||
l$ = l$ + CHR$(17)
|
|
||||||
|
|
||||||
l$ = l$ + CHR$(16)
|
|
||||||
varDlgList(x).colorFlag = LEN(l$) + 1
|
|
||||||
varDlgList(x).indicator = LEN(l$) + 2
|
|
||||||
l$ = l$ + CHR$(16) + " "
|
|
||||||
|
|
||||||
thisName$ = RTRIM$(udtecname(thisElement))
|
|
||||||
text$ = thisName$ + CHR$(16)
|
|
||||||
varDlgList(x).colorFlag2 = LEN(l$) + LEN(text$) + 1
|
|
||||||
text$ = text$ + CHR$(2) + " "
|
|
||||||
text$ = text$ + SPACE$(longestName - LEN(thisName$))
|
|
||||||
text$ = text$ + " " + typeNames$(x) + SPACE$(maxTypeLen - LEN(typeNames$(x)))
|
|
||||||
|
|
||||||
l$ = l$ + text$
|
|
||||||
IF x < totalElements THEN l$ = l$ + sep
|
|
||||||
NEXT
|
|
||||||
RETURN
|
|
||||||
END FUNCTION
|
|
||||||
|
|
||||||
FUNCTION formatRange$(__text$)
|
FUNCTION formatRange$(__text$)
|
||||||
'__text$ is a series of MKL$(values) concatenated
|
'__text$ is a series of MKL$(values) concatenated
|
||||||
temp$ = __text$
|
temp$ = __text$
|
||||||
|
|
|
@ -113,7 +113,7 @@ TYPE usedVarList
|
||||||
AS _BYTE used, watch, isarray
|
AS _BYTE used, watch, isarray
|
||||||
AS STRING name, cname, varType, includedFile, subfunc, mostRecentValue
|
AS STRING name, cname, varType, includedFile, subfunc, mostRecentValue
|
||||||
AS STRING watchRange, indexes, elements 'for Arrays and UDTs
|
AS STRING watchRange, indexes, elements 'for Arrays and UDTs
|
||||||
AS _OFFSET baseAddress
|
AS _OFFSET elementOffset
|
||||||
END TYPE
|
END TYPE
|
||||||
|
|
||||||
DIM SHARED totalVariablesCreated AS LONG
|
DIM SHARED totalVariablesCreated AS LONG
|
||||||
|
|
Loading…
Reference in a new issue