gui2: bug hunt...
This commit is contained in:
@@ -24,20 +24,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine MLayout_LayoutColumnMode @global
|
|
||||||
;
|
|
||||||
; @param Y widget
|
|
||||||
; @clobbers any, !Y
|
|
||||||
|
|
||||||
MLayout_Layout_ColumnMode:
|
|
||||||
rcall mLayoutColumnLayoutHorizontally
|
|
||||||
; rcall mLayoutColumnLayoutVertically
|
|
||||||
ret
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine MLayout_OnGetDefaultWidth_ColumnMode @global
|
; @routine MLayout_OnGetDefaultWidth_ColumnMode @global
|
||||||
;
|
;
|
||||||
@@ -100,6 +86,20 @@ MLayout_OnGetDefaultHeight_ColumnMode:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine MLayout_LayoutColumnMode @global
|
||||||
|
;
|
||||||
|
; @param Y widget
|
||||||
|
; @clobbers any, !Y
|
||||||
|
|
||||||
|
MLayout_Layout_ColumnMode:
|
||||||
|
rcall mLayoutColumnLayoutHorizontally
|
||||||
|
rcall mLayoutColumnLayoutVertically
|
||||||
|
sec
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine mLayoutColumnLayoutHorizontally
|
; @routine mLayoutColumnLayoutHorizontally
|
||||||
@@ -125,23 +125,24 @@ mLayoutColumnLayoutHorizontally:
|
|||||||
pop r23
|
pop r23
|
||||||
pop r22
|
pop r22
|
||||||
|
|
||||||
|
|
||||||
; prepare first row
|
; prepare first row
|
||||||
rcall mLayoutSetupFirstContiguous ; set max column widths to first row (r18, r19, Z)
|
rcall mLayoutSetupFirstContiguous ; set max column widths to first row (r18, r19, Z)
|
||||||
|
|
||||||
; possibly distribute free space to expandable columns
|
; possibly distribute free space to expandable columns
|
||||||
push r22 ; spacing
|
push r22 ; spacing
|
||||||
push r23 ; border
|
push r23 ; border
|
||||||
|
push r25
|
||||||
; rcall mLayoutColumnExpandColumns ; (r16-r23, r25)
|
; rcall mLayoutColumnExpandColumns ; (r16-r23, r25)
|
||||||
|
pop r25
|
||||||
pop r23
|
pop r23
|
||||||
pop r22
|
pop r22
|
||||||
|
|
||||||
; rcall mLayoutColumnCopyTmpFromFirstRow ; copy TMP of every column from first row to following (r18-r21, Z)
|
rcall mLayoutColumnPositionX
|
||||||
push r25
|
rcall mLayoutColumnCopyXTmpFromFirstRow
|
||||||
clr r25
|
|
||||||
rcall mLayoutColumnPositionX ; (r12, r13, r16-r21, X)
|
pop yh
|
||||||
pop r25
|
pop yl
|
||||||
pop yl
|
|
||||||
pop yh
|
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -157,14 +158,16 @@ mLayoutColumnLayoutVertically:
|
|||||||
push r22
|
push r22
|
||||||
push r23
|
push r23
|
||||||
push r25
|
push r25
|
||||||
|
clr r25
|
||||||
rcall mLayoutSetDefaultHeightToTmp ; (any, !Y)
|
rcall mLayoutSetDefaultHeightToTmp ; (any, !Y)
|
||||||
|
clr r25
|
||||||
|
rcall mLayoutCopyTmpToHeight ; (r18, r19, Z)
|
||||||
pop r25
|
pop r25
|
||||||
rcall mLayoutCopyTmpToHeight ; (r18, r19, Z)
|
|
||||||
pop r23
|
pop r23
|
||||||
pop r22
|
pop r22
|
||||||
|
|
||||||
; prepare first column
|
; prepare first column
|
||||||
rcall mLayoutSetupFirstSkipped ; set max column widths to first column (r18, r19, Z)
|
rcall mLayoutSetupFirstSkipped ; set max column heights to first column (r18, r19, Z)
|
||||||
|
|
||||||
; possibly distribute free space to expandable columns
|
; possibly distribute free space to expandable columns
|
||||||
push r22 ; spacing
|
push r22 ; spacing
|
||||||
@@ -172,33 +175,29 @@ mLayoutColumnLayoutVertically:
|
|||||||
; rcall mLayoutColumnExpandRows ; (r16-r23)
|
; rcall mLayoutColumnExpandRows ; (r16-r23)
|
||||||
pop r23
|
pop r23
|
||||||
pop r22
|
pop r22
|
||||||
|
|
||||||
rcall mLayoutColumnCopyTmpFromFirstColumn ; copy TMP of every column from first row to following (r18-r21, Z)
|
|
||||||
|
|
||||||
rcall mLayoutColumnPositionY ; (r12, r13, r16-r21, X)
|
|
||||||
|
|
||||||
pop yl
|
rcall mLayoutColumnPositionY
|
||||||
pop yh
|
rcall mLayoutColumnCopyTmpFromFirstColumn
|
||||||
|
|
||||||
|
; rcall mLayoutColumnCopyTmpFromFirstColumn ; copy TMP of every column from first row to following (r18-r21, Z)
|
||||||
|
; rcall mLayoutColumnPositionAllY ; (r12, r13, r16-r21, Y)
|
||||||
|
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine mLayoutColumnCopyTmpFromFirstRow
|
; @routine mLayoutColumnCopyXTmpFromFirstRow
|
||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @param R25 widgets per row/column
|
; @param R25 widgets per row/column
|
||||||
; @clobbers r18-r21, Z
|
; @clobbers r18-r21, Z
|
||||||
|
|
||||||
mLayoutColumnCopyTmpFromFirstRow:
|
mLayoutColumnCopyXTmpFromFirstRow:
|
||||||
push yl
|
M_MLAYOUT_FOREVERY_CONT mLayoutCallbackColumnCopyRow
|
||||||
push yh
|
|
||||||
ldi zl, LOW(mLayoutCallbackColumnCopyRow)
|
|
||||||
ldi zh, HIGH(mLayoutCallbackColumnCopyRow)
|
|
||||||
rcall mLayoutForEveryObjectContiguous ; (r18-r21, Y)
|
|
||||||
pop yh
|
|
||||||
pop yl
|
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -208,12 +207,12 @@ mLayoutColumnCopyTmpFromFirstRow:
|
|||||||
; @routine mLayoutCallbackColumnCopyRow
|
; @routine mLayoutCallbackColumnCopyRow
|
||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @clobbers r18, r19, r20, r21, r25
|
; @clobbers r18, r19, r20, r21
|
||||||
|
|
||||||
mLayoutCallbackColumnCopyRow:
|
mLayoutCallbackColumnCopyRow:
|
||||||
push zl
|
push zl
|
||||||
push zh
|
push zh
|
||||||
rcall mLayoutColumnCopyTmpAcrossColumn ; (r18, r19, r20, r21, Z)
|
rcall mLayoutColumnCopyXTmpAcrossColumn ; (r18, r19, r20, r21, X, Z)
|
||||||
pop zh
|
pop zh
|
||||||
pop zl
|
pop zl
|
||||||
clc
|
clc
|
||||||
@@ -223,19 +222,21 @@ mLayoutCallbackColumnCopyRow:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine mLayoutColumnCopyTmpAcrossColumn
|
; @routine mLayoutColumnCopyXTmpAcrossColumn
|
||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @param R25 widgets per row/column
|
; @param R25 widgets per row/column
|
||||||
; @clobbers r18, r19, r20, r21, Z
|
; @clobbers r18, r19, r20, r21, X, Z
|
||||||
|
|
||||||
mLayoutColumnCopyTmpAcrossColumn:
|
mLayoutColumnCopyXTmpAcrossColumn:
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||||
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
||||||
ldi zl, LOW(mLayoutCallbackSetTmp)
|
ldd xl, Y+WIDGET_OFFS_X_LO
|
||||||
ldi zh, HIGH(mLayoutCallbackSetTmp)
|
ldd xh, Y+WIDGET_OFFS_X_HI
|
||||||
|
ldi zl, LOW(mLayoutCallbackSetXTmp)
|
||||||
|
ldi zh, HIGH(mLayoutCallbackSetXTmp)
|
||||||
rcall mLayoutForEveryObjectSkipped ; (r18, r19, Y)
|
rcall mLayoutForEveryObjectSkipped ; (r18, r19, Y)
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
@@ -274,7 +275,7 @@ mLayoutColumnCopyTmpFromFirstColumn:
|
|||||||
mLayoutCallbackColumnCopyColumn:
|
mLayoutCallbackColumnCopyColumn:
|
||||||
push zl
|
push zl
|
||||||
push zh
|
push zh
|
||||||
rcall mLayoutColumnCopyTmpAcrossRow ; (r18, r19, r20, r21, Z)
|
rcall mLayoutColumnCopyYTmpAcrossRow ; (r18, r19, r20, r21, Z)
|
||||||
pop zh
|
pop zh
|
||||||
pop zl
|
pop zl
|
||||||
clc
|
clc
|
||||||
@@ -290,13 +291,15 @@ mLayoutCallbackColumnCopyColumn:
|
|||||||
; @param R25 widgets per row/column
|
; @param R25 widgets per row/column
|
||||||
; @clobbers r18, r19, r20, r21, Z
|
; @clobbers r18, r19, r20, r21, Z
|
||||||
|
|
||||||
mLayoutColumnCopyTmpAcrossRow:
|
mLayoutColumnCopyYTmpAcrossRow:
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||||
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
||||||
ldi zl, LOW(mLayoutCallbackSetTmp)
|
ldd xl, Y+WIDGET_OFFS_Y_LO
|
||||||
ldi zh, HIGH(mLayoutCallbackSetTmp)
|
ldd xh, Y+WIDGET_OFFS_Y_HI
|
||||||
|
ldi zl, LOW(mLayoutCallbackSetYTmp)
|
||||||
|
ldi zh, HIGH(mLayoutCallbackSetYTmp)
|
||||||
rcall mLayoutForEveryObjectContiguous ; (r18, r19, Y)
|
rcall mLayoutForEveryObjectContiguous ; (r18, r19, Y)
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
@@ -305,6 +308,54 @@ mLayoutColumnCopyTmpAcrossRow:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine mLayoutColumnPositionAllX
|
||||||
|
;
|
||||||
|
; Set X and width to all columns of the row
|
||||||
|
;
|
||||||
|
; @param Y first widget of current row
|
||||||
|
; @param r22 spacing between widgets
|
||||||
|
; @param r23 border at beginning and and
|
||||||
|
; @param R25 widgets per row/column
|
||||||
|
; @clobbers r12, r13, r16-r21, X
|
||||||
|
|
||||||
|
mLayoutColumnPositionAllX:
|
||||||
|
mov xl, r23 ; start at border
|
||||||
|
clr xh
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
ldi zl, LOW(mLayoutCallbackColumnPositionXRow)
|
||||||
|
ldi zh, HIGH(mLayoutCallbackColumnPositionXRow)
|
||||||
|
rcall mLayoutForEveryObjectSkipped ; (r12, r13, r16-r21, Y)
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine mLayoutCallbackColumnPositionXRow
|
||||||
|
;
|
||||||
|
; @param Y widget
|
||||||
|
; @clobbers r12, r13, r16-r21, X
|
||||||
|
|
||||||
|
mLayoutCallbackColumnPositionXRow:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
push zl
|
||||||
|
push zh
|
||||||
|
rcall mLayoutColumnPositionX ; (r12, r13, r16-r21, X, Z)
|
||||||
|
pop zh
|
||||||
|
pop zl
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine mLayoutColumnPositionX
|
; @routine mLayoutColumnPositionX
|
||||||
;
|
;
|
||||||
@@ -314,7 +365,7 @@ mLayoutColumnCopyTmpAcrossRow:
|
|||||||
; @param r22 spacing between widgets
|
; @param r22 spacing between widgets
|
||||||
; @param r23 border at beginning and and
|
; @param r23 border at beginning and and
|
||||||
; @param R25 widgets per row/column
|
; @param R25 widgets per row/column
|
||||||
; @clobbers r12, r13, r16-r21, X
|
; @clobbers r12, r13, r16-r21, X, Z
|
||||||
|
|
||||||
mLayoutColumnPositionX:
|
mLayoutColumnPositionX:
|
||||||
mov xl, r23 ; start at border
|
mov xl, r23 ; start at border
|
||||||
@@ -331,6 +382,52 @@ mLayoutColumnPositionX:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine mLayoutColumnPositionAllY
|
||||||
|
;
|
||||||
|
; Set Y and height to all columns of the row
|
||||||
|
;
|
||||||
|
; @param Y first widget of current row
|
||||||
|
; @param r22 spacing between widgets
|
||||||
|
; @param r23 border at beginning and and
|
||||||
|
; @param R25 widgets per row/column
|
||||||
|
; @clobbers r12, r13, r16-r21, Y, Z
|
||||||
|
|
||||||
|
mLayoutColumnPositionAllY:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
ldi zl, LOW(mLayoutCallbackColumnPositionYColumn)
|
||||||
|
ldi zh, HIGH(mLayoutCallbackColumnPositionYColumn)
|
||||||
|
rcall mLayoutForEveryObjectContiguous ; (r12, r13, r16-r21, Y)
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine mLayoutCallbackColumnPositionYColumn
|
||||||
|
;
|
||||||
|
; @param Y widget
|
||||||
|
; @clobbers r12, r13, r16-r21, Y
|
||||||
|
|
||||||
|
mLayoutCallbackColumnPositionYColumn:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
push zl
|
||||||
|
push zh
|
||||||
|
rcall mLayoutColumnPositionY ; (r12, r13, r16-r21, X, Z)
|
||||||
|
pop zh
|
||||||
|
pop zl
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine mLayoutColumnPositionY
|
; @routine mLayoutColumnPositionY
|
||||||
;
|
;
|
||||||
@@ -340,7 +437,7 @@ mLayoutColumnPositionX:
|
|||||||
; @param r22 spacing between widgets
|
; @param r22 spacing between widgets
|
||||||
; @param r23 border at beginning and end
|
; @param r23 border at beginning and end
|
||||||
; @param R25 widgets per row/column
|
; @param R25 widgets per row/column
|
||||||
; @clobbers r12, r13, r16-r21, X
|
; @clobbers r12, r13, r16-r21, X, Z
|
||||||
|
|
||||||
mLayoutColumnPositionY:
|
mLayoutColumnPositionY:
|
||||||
mov xl, r23 ; start at border
|
mov xl, r23 ; start at border
|
||||||
@@ -511,6 +608,4 @@ mLayoutColumnCalcAddSpacePerRow_ret:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user