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
|
||||
;
|
||||
@@ -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
|
||||
@@ -125,23 +125,24 @@ mLayoutColumnLayoutHorizontally:
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
|
||||
; prepare first row
|
||||
rcall mLayoutSetupFirstContiguous ; set max column widths to first row (r18, r19, Z)
|
||||
|
||||
|
||||
; possibly distribute free space to expandable columns
|
||||
push r22 ; spacing
|
||||
push r23 ; border
|
||||
push r25
|
||||
; rcall mLayoutColumnExpandColumns ; (r16-r23, r25)
|
||||
pop r25
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
; rcall mLayoutColumnCopyTmpFromFirstRow ; copy TMP of every column from first row to following (r18-r21, Z)
|
||||
push r25
|
||||
clr r25
|
||||
rcall mLayoutColumnPositionX ; (r12, r13, r16-r21, X)
|
||||
pop r25
|
||||
pop yl
|
||||
pop yh
|
||||
|
||||
rcall mLayoutColumnPositionX
|
||||
rcall mLayoutColumnCopyXTmpFromFirstRow
|
||||
|
||||
pop yh
|
||||
pop yl
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -157,14 +158,16 @@ mLayoutColumnLayoutVertically:
|
||||
push r22
|
||||
push r23
|
||||
push r25
|
||||
clr r25
|
||||
rcall mLayoutSetDefaultHeightToTmp ; (any, !Y)
|
||||
clr r25
|
||||
rcall mLayoutCopyTmpToHeight ; (r18, r19, Z)
|
||||
pop r25
|
||||
rcall mLayoutCopyTmpToHeight ; (r18, r19, Z)
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
; 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
|
||||
push r22 ; spacing
|
||||
@@ -172,33 +175,29 @@ mLayoutColumnLayoutVertically:
|
||||
; rcall mLayoutColumnExpandRows ; (r16-r23)
|
||||
pop r23
|
||||
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
|
||||
pop yh
|
||||
rcall mLayoutColumnPositionY
|
||||
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
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnCopyTmpFromFirstRow
|
||||
; @routine mLayoutColumnCopyXTmpFromFirstRow
|
||||
;
|
||||
; @param Y widget
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r18-r21, Z
|
||||
|
||||
mLayoutColumnCopyTmpFromFirstRow:
|
||||
push yl
|
||||
push yh
|
||||
ldi zl, LOW(mLayoutCallbackColumnCopyRow)
|
||||
ldi zh, HIGH(mLayoutCallbackColumnCopyRow)
|
||||
rcall mLayoutForEveryObjectContiguous ; (r18-r21, Y)
|
||||
pop yh
|
||||
pop yl
|
||||
mLayoutColumnCopyXTmpFromFirstRow:
|
||||
M_MLAYOUT_FOREVERY_CONT mLayoutCallbackColumnCopyRow
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -208,12 +207,12 @@ mLayoutColumnCopyTmpFromFirstRow:
|
||||
; @routine mLayoutCallbackColumnCopyRow
|
||||
;
|
||||
; @param Y widget
|
||||
; @clobbers r18, r19, r20, r21, r25
|
||||
; @clobbers r18, r19, r20, r21
|
||||
|
||||
mLayoutCallbackColumnCopyRow:
|
||||
push zl
|
||||
push zh
|
||||
rcall mLayoutColumnCopyTmpAcrossColumn ; (r18, r19, r20, r21, Z)
|
||||
rcall mLayoutColumnCopyXTmpAcrossColumn ; (r18, r19, r20, r21, X, Z)
|
||||
pop zh
|
||||
pop zl
|
||||
clc
|
||||
@@ -223,19 +222,21 @@ mLayoutCallbackColumnCopyRow:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnCopyTmpAcrossColumn
|
||||
; @routine mLayoutColumnCopyXTmpAcrossColumn
|
||||
;
|
||||
; @param Y widget
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r18, r19, r20, r21, Z
|
||||
; @clobbers r18, r19, r20, r21, X, Z
|
||||
|
||||
mLayoutColumnCopyTmpAcrossColumn:
|
||||
mLayoutColumnCopyXTmpAcrossColumn:
|
||||
push yl
|
||||
push yh
|
||||
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
||||
ldi zl, LOW(mLayoutCallbackSetTmp)
|
||||
ldi zh, HIGH(mLayoutCallbackSetTmp)
|
||||
ldd xl, Y+WIDGET_OFFS_X_LO
|
||||
ldd xh, Y+WIDGET_OFFS_X_HI
|
||||
ldi zl, LOW(mLayoutCallbackSetXTmp)
|
||||
ldi zh, HIGH(mLayoutCallbackSetXTmp)
|
||||
rcall mLayoutForEveryObjectSkipped ; (r18, r19, Y)
|
||||
pop yh
|
||||
pop yl
|
||||
@@ -274,7 +275,7 @@ mLayoutColumnCopyTmpFromFirstColumn:
|
||||
mLayoutCallbackColumnCopyColumn:
|
||||
push zl
|
||||
push zh
|
||||
rcall mLayoutColumnCopyTmpAcrossRow ; (r18, r19, r20, r21, Z)
|
||||
rcall mLayoutColumnCopyYTmpAcrossRow ; (r18, r19, r20, r21, Z)
|
||||
pop zh
|
||||
pop zl
|
||||
clc
|
||||
@@ -290,13 +291,15 @@ mLayoutCallbackColumnCopyColumn:
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r18, r19, r20, r21, Z
|
||||
|
||||
mLayoutColumnCopyTmpAcrossRow:
|
||||
mLayoutColumnCopyYTmpAcrossRow:
|
||||
push yl
|
||||
push yh
|
||||
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
||||
ldi zl, LOW(mLayoutCallbackSetTmp)
|
||||
ldi zh, HIGH(mLayoutCallbackSetTmp)
|
||||
ldd xl, Y+WIDGET_OFFS_Y_LO
|
||||
ldd xh, Y+WIDGET_OFFS_Y_HI
|
||||
ldi zl, LOW(mLayoutCallbackSetYTmp)
|
||||
ldi zh, HIGH(mLayoutCallbackSetYTmp)
|
||||
rcall mLayoutForEveryObjectContiguous ; (r18, r19, Y)
|
||||
pop yh
|
||||
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
|
||||
;
|
||||
@@ -314,7 +365,7 @@ mLayoutColumnCopyTmpAcrossRow:
|
||||
; @param r22 spacing between widgets
|
||||
; @param r23 border at beginning and and
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r12, r13, r16-r21, X
|
||||
; @clobbers r12, r13, r16-r21, X, Z
|
||||
|
||||
mLayoutColumnPositionX:
|
||||
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
|
||||
;
|
||||
@@ -340,7 +437,7 @@ mLayoutColumnPositionX:
|
||||
; @param r22 spacing between widgets
|
||||
; @param r23 border at beginning and end
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r12, r13, r16-r21, X
|
||||
; @clobbers r12, r13, r16-r21, X, Z
|
||||
|
||||
mLayoutColumnPositionY:
|
||||
mov xl, r23 ; start at border
|
||||
@@ -511,6 +608,4 @@ mLayoutColumnCalcAddSpacePerRow_ret:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user