gui2: mlayout works now (in column mode)!
This commit is contained in:
@@ -383,7 +383,7 @@ mkTestWidgets:
|
||||
push xl ; MLayout
|
||||
push xh
|
||||
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, LOW(RESSSOURCE_TXT_KITCHEN)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_KITCHEN)
|
||||
bigcall Label_new
|
||||
|
||||
@@ -301,7 +301,7 @@ mLayoutCallbackGridX:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutCallbackGridX
|
||||
; @routine mLayoutCallbackPackX
|
||||
;
|
||||
; @param Y widget
|
||||
; @param r22 spacing between widgets
|
||||
@@ -328,6 +328,60 @@ mLayoutCallbackPackX:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutCallbackGridY
|
||||
;
|
||||
; @param Y widget
|
||||
; @param r22 spacing between widgets
|
||||
; @param X current Y pos
|
||||
; @clobbers r10-r13, r16-r21
|
||||
|
||||
mLayoutCallbackGridY:
|
||||
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||
ldd r21, Y+WIDGET_OFFS_TMP_HI
|
||||
std Y+WIDGET_OFFS_Y_LO, xl ; set new Y
|
||||
std Y+WIDGET_OFFS_Y_HI, xh
|
||||
add xl, r20 ; add cell width
|
||||
adc xh, r21
|
||||
add xl, r22 ; add spacing
|
||||
adc xh, r22
|
||||
sub xh, r22
|
||||
clc
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutCallbackPackY
|
||||
;
|
||||
; @param Y widget
|
||||
; @param r22 spacing between widgets
|
||||
; @clobbers r10-r13, r16-r21, X
|
||||
|
||||
mLayoutCallbackPackY:
|
||||
ldd r10, Y+WIDGET_OFFS_TMP_LO ; calculated cell width
|
||||
ldd r11, Y+WIDGET_OFFS_TMP_HI
|
||||
ldd r12, Y+WIDGET_OFFS_HEIGHT_LO ; default width
|
||||
ldd r13, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
lsr r17 ; WIDGET_PACK_VSELF0_BIT = 2 -> shift 2 times right
|
||||
lsr r17
|
||||
andi r17, 3
|
||||
rcall mLayoutPackCell ; R21:R20=relative pos, R19:R18=new size (r16, r17, r18, r19)
|
||||
ldd xl, Y+WIDGET_OFFS_Y_LO
|
||||
ldd xh, Y+WIDGET_OFFS_Y_HI
|
||||
add xl, r20
|
||||
adc xh, r21
|
||||
std Y+WIDGET_OFFS_Y_LO, xl
|
||||
std Y+WIDGET_OFFS_Y_HI, xh
|
||||
std Y+WIDGET_OFFS_HEIGHT_LO, r18
|
||||
std Y+WIDGET_OFFS_HEIGHT_HI, r19
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutCallbackPositionY
|
||||
@@ -347,37 +401,6 @@ add xl, r20
|
||||
adc xh, r21
|
||||
clc
|
||||
ret
|
||||
|
||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||
sbrs r16, WIDGET_FLAGS_VISIBLE_BIT
|
||||
rjmp mLayoutCallbackPositionY_ret
|
||||
ldd r10, Y+WIDGET_OFFS_TMP_LO ; calculated cell width
|
||||
ldd r11, Y+WIDGET_OFFS_TMP_HI
|
||||
ldd r12, Y+WIDGET_OFFS_HEIGHT_LO ; default height
|
||||
ldd r13, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
lsr r17 ; WIDGET_PACK_VSELF0_BIT = 2 -> shift 2 times right
|
||||
lsr r17
|
||||
andi r17, 3
|
||||
push r18
|
||||
push r19
|
||||
rcall mLayoutPackCell ; R21:R20=relative pos (r16, r17, r18, r19)
|
||||
pop r19
|
||||
pop r18
|
||||
add r20, xl
|
||||
adc r21, xh
|
||||
std Y+WIDGET_OFFS_Y_LO, r20 ; set new Y
|
||||
std Y+WIDGET_OFFS_Y_HI, r21
|
||||
; std Y+WIDGET_OFFS_HEIGHT_LO, r12 ; set new height
|
||||
; std Y+WIDGET_OFFS_HEIGHT_HI, r13
|
||||
add xl, r18 ; advance Y
|
||||
adc xh, r19
|
||||
add xl, r22 ; add spacing
|
||||
adc xh, r22
|
||||
sub xh, r22
|
||||
mLayoutCallbackPositionY_ret:
|
||||
clc
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
@@ -128,20 +128,10 @@ mLayoutColumnLayoutHorizontally:
|
||||
|
||||
; 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
|
||||
rcall mLayoutColumnExpandColumns ; (r16-r23)
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
rcall mLayoutColumnExpandColumns ; (r16-r23)
|
||||
rcall mLayoutColumnGridX
|
||||
rcall mLayoutColumnCopyXTmpFromFirstRow
|
||||
push r25
|
||||
clr r25
|
||||
rcall mLayoutColumnPackX ; (r10-r13, r16-r21, X)
|
||||
pop r25
|
||||
rcall mLayoutColumnPackX ; (r10-r13, r16-r21, X)
|
||||
|
||||
pop yh
|
||||
pop yl
|
||||
@@ -168,22 +158,12 @@ mLayoutColumnLayoutVertically:
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
; prepare first column
|
||||
rcall mLayoutSetupFirstSkipped ; set max column heights to first column (r18, r19, Z)
|
||||
|
||||
; possibly distribute free space to expandable columns
|
||||
push r22 ; spacing
|
||||
push r23 ; border
|
||||
; rcall mLayoutColumnExpandRows ; (r16-r23)
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
rcall mLayoutColumnPositionY
|
||||
rcall mLayoutSetupFirstSkipped ; set max column heights to first column (r18, r19, Z)
|
||||
rcall mLayoutColumnExpandRows ; (r16-r23)
|
||||
rcall mLayoutColumnGridY
|
||||
rcall mLayoutColumnCopyTmpFromFirstColumn
|
||||
rcall mLayoutColumnPackY ; (r10-r13, r16-r21, X)
|
||||
|
||||
; 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
|
||||
@@ -310,54 +290,6 @@ mLayoutColumnCopyYTmpAcrossRow:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @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 mLayoutColumnGridX ; (r12, r13, r16-r21, X, Z)
|
||||
pop zh
|
||||
pop zl
|
||||
pop yh
|
||||
pop yl
|
||||
clc
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnGridX
|
||||
;
|
||||
@@ -396,77 +328,34 @@ mLayoutColumnGridX:
|
||||
; @clobbers r10-r13, r16-r21, X
|
||||
|
||||
mLayoutColumnPackX:
|
||||
M_MLAYOUT_FOREVERY_CONT mLayoutCallbackPackX ; (r10-r13, r16-r21, X)
|
||||
push r25
|
||||
clr r25
|
||||
M_MLAYOUT_FOREVERY_CONT mLayoutCallbackPackX ; (r10-r13, r16-r21, X)
|
||||
pop r25
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnPositionAllY
|
||||
; @routine mLayoutColumnGridY
|
||||
;
|
||||
; Set Y and height to all columns of the row
|
||||
; Set Y and height to all rows of a column
|
||||
;
|
||||
; @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
|
||||
;
|
||||
; 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 end
|
||||
; @param R25 widgets per row/column
|
||||
; @clobbers r12, r13, r16-r21, X, Z
|
||||
|
||||
mLayoutColumnPositionY:
|
||||
mLayoutColumnGridY:
|
||||
mov xl, r23 ; start at border
|
||||
clr xh
|
||||
push yl
|
||||
push yh
|
||||
ldi zl, LOW(mLayoutCallbackPositionY)
|
||||
ldi zh, HIGH(mLayoutCallbackPositionY)
|
||||
rcall mLayoutForEveryObjectSkipped ; (r12, r13, r16-r21, Y)
|
||||
ldi zl, LOW(mLayoutCallbackGridY)
|
||||
ldi zh, HIGH(mLayoutCallbackGridY)
|
||||
rcall mLayoutForEveryObjectSkipped ; (r12, r13, r16-r21, Y)
|
||||
pop yh
|
||||
pop yl
|
||||
ret
|
||||
@@ -474,6 +363,26 @@ mLayoutColumnPositionY:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnPackY
|
||||
;
|
||||
; Pack each widget inside its cell.
|
||||
;
|
||||
; @param Y first widget of current row
|
||||
; @param r22 spacing between widgets
|
||||
; @param r23 border at beginning and and
|
||||
; @clobbers r10-r13, r16-r21, X
|
||||
|
||||
mLayoutColumnPackY:
|
||||
push r25
|
||||
clr r25
|
||||
M_MLAYOUT_FOREVERY_CONT mLayoutCallbackPackY ; (r10-r13, r16-r21, X)
|
||||
pop r25
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnExpandColumns
|
||||
;
|
||||
@@ -530,8 +439,8 @@ mLayoutColumnExpandColumns_ret:
|
||||
mLayoutColumnCalcAddSpacePerColumn:
|
||||
push r22
|
||||
push r23
|
||||
rcall mLayoutColumnCalcAdditionalSpace ; r21:r20=additional space (R18, R19)
|
||||
brcc mLayoutColumnCalcAddSpacePerElement_ret
|
||||
rcall mLayoutColumnCalcAdditionalSpaceContiguous ; r21:r20=additional space (R18, R19)
|
||||
brcc mLayoutColumnCalcAddSpacePerColumn_ret
|
||||
push r20
|
||||
push r21
|
||||
ldi r22, (1<<WIDGET_PACK_HSELF1_BIT) | (1<<WIDGET_PACK_HSELF0_BIT) ; mask
|
||||
@@ -542,7 +451,7 @@ mLayoutColumnCalcAddSpacePerColumn:
|
||||
pop r21
|
||||
pop r20
|
||||
tst r22
|
||||
breq mLayoutColumnCalcAddSpacePerElement_none ; don't divide by zero!
|
||||
breq mLayoutColumnCalcAddSpacePerColumn_none ; don't divide by zero!
|
||||
|
||||
push r25
|
||||
bigcall Utils_Divu16_16_16 ; r17:r16=space per expandable widget (r25)
|
||||
@@ -550,12 +459,12 @@ mLayoutColumnCalcAddSpacePerColumn:
|
||||
mov r20, r16
|
||||
mov r21, r17
|
||||
sec
|
||||
rjmp mLayoutColumnCalcAddSpacePerElement_ret
|
||||
mLayoutColumnCalcAddSpacePerElement_none:
|
||||
rjmp mLayoutColumnCalcAddSpacePerColumn_ret
|
||||
mLayoutColumnCalcAddSpacePerColumn_none:
|
||||
clr r20
|
||||
clr r21
|
||||
clc
|
||||
mLayoutColumnCalcAddSpacePerElement_ret:
|
||||
mLayoutColumnCalcAddSpacePerColumn_ret:
|
||||
pop r23
|
||||
pop r22
|
||||
ret
|
||||
@@ -564,7 +473,7 @@ mLayoutColumnCalcAddSpacePerElement_ret:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnCalcAdditionalSpace
|
||||
; @routine mLayoutColumnCalcAdditionalSpaceContiguous
|
||||
;
|
||||
; Calculate additional space in a row.
|
||||
;
|
||||
@@ -577,7 +486,7 @@ mLayoutColumnCalcAddSpacePerElement_ret:
|
||||
; @return r21:r20 available additional space
|
||||
; @clobbers r18, r19
|
||||
|
||||
mLayoutColumnCalcAdditionalSpace:
|
||||
mLayoutColumnCalcAdditionalSpaceContiguous:
|
||||
push r18
|
||||
push r19
|
||||
rcall mLayoutSumContiguous ; r21:r20 needed minimum row width (r18, r19)
|
||||
@@ -585,17 +494,17 @@ mLayoutColumnCalcAdditionalSpace:
|
||||
pop r18
|
||||
sub r18, r20
|
||||
sbc r19, r21
|
||||
brcs mLayoutColumnCalcAdditionalSpace_none
|
||||
breq mLayoutColumnCalcAdditionalSpace_none
|
||||
brcs mLayoutColumnCalcAdditionalSpaceContiguous_none
|
||||
breq mLayoutColumnCalcAdditionalSpaceContiguous_none
|
||||
mov r20, r18
|
||||
mov r21, r19
|
||||
sec
|
||||
rjmp mLayoutColumnCalcAdditionalSpace_ret
|
||||
mLayoutColumnCalcAdditionalSpace_none:
|
||||
rjmp mLayoutColumnCalcAdditionalSpaceContiguous_ret
|
||||
mLayoutColumnCalcAdditionalSpaceContiguous_none:
|
||||
clr r20
|
||||
clr r21
|
||||
clc
|
||||
mLayoutColumnCalcAdditionalSpace_ret:
|
||||
mLayoutColumnCalcAdditionalSpaceContiguous_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -607,18 +516,32 @@ mLayoutColumnCalcAdditionalSpace_ret:
|
||||
; Calculate additional space per expandable widget in a column.
|
||||
;
|
||||
; @param Y first widget of current row
|
||||
; @param r25 widgets per row/column
|
||||
; @param R25 widgets per row/column
|
||||
; @return CFLAG set if there is additional space to distribute
|
||||
; @return r21:r20 space to add to every expandable widget
|
||||
; @clobbers r16-r23
|
||||
; @clobbers r16-r21
|
||||
|
||||
mLayoutColumnExpandRows:
|
||||
rcall mLayoutColumnCalcAddSpacePerRow ; r21:r20=additional space (r16-r23)
|
||||
push yl
|
||||
push yh
|
||||
bigcall OBJ_GetParent
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ldd r18, Y+WIDGET_OFFS_HEIGHT_LO
|
||||
ldd r19, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
rcall mLayoutColumnCalcAddSpacePerRow ; r21:r20=additional space (r16-r23)
|
||||
brcc mLayoutColumnExpandRows_ret
|
||||
|
||||
ldi r22, (1<<WIDGET_PACK_VSELF1_BIT) | (1<<WIDGET_PACK_VSELF0_BIT) ; mask
|
||||
ldi r23, (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; value
|
||||
rcall mLayoutExpandMatchingPackSkipped ; (r18, r19)
|
||||
push r22
|
||||
push r23
|
||||
ldi r22, (1<<WIDGET_PACK_VSELF1_BIT) | (1<<WIDGET_PACK_VSELF0_BIT) ; mask
|
||||
ldi r23, (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; value
|
||||
rcall mLayoutExpandMatchingPackSkipped ; (r18, r19)
|
||||
pop r23
|
||||
pop r22
|
||||
|
||||
mLayoutColumnExpandRows_ret:
|
||||
ret
|
||||
@@ -629,53 +552,90 @@ mLayoutColumnExpandRows_ret:
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnCalcAddSpacePerRow
|
||||
;
|
||||
; Calculate additional space per expandable widget in a row.
|
||||
; Calculate additional space per expandable widget in a column.
|
||||
;
|
||||
; @param Y first widget of current row
|
||||
; @param r19:r18 width of parent widget
|
||||
; @return CFLAG set if there is additional space to distribute
|
||||
; @return r21:r20 space to add to every expandable widget
|
||||
; @param r22 spacing between widgets
|
||||
; @param r23 border at beginning and and
|
||||
; @param r25 widgets per row/column
|
||||
; @clobbers r16-r23
|
||||
; @clobbers r16-r21
|
||||
|
||||
mLayoutColumnCalcAddSpacePerRow:
|
||||
rcall mLayoutSumSkipped ; r21:r20 needed minimum row width (r18, r19)
|
||||
ldd r18, Y+WIDGET_OFFS_HEIGHT_LO
|
||||
ldd r19, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
sub r18, r20
|
||||
sbc r19, r21
|
||||
brcc mLayoutColumnCalcAddSpacePerRow_none
|
||||
breq mLayoutColumnCalcAddSpacePerRow_none
|
||||
; r19:r18=space to distribute
|
||||
push r18
|
||||
push r19
|
||||
ldi r22, (1<<WIDGET_PACK_VSELF1_BIT) | (1<<WIDGET_PACK_VSELF0_BIT) ; mask
|
||||
ldi r23, (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; value
|
||||
rcall mLayoutCountChildrenMatchingPackSkipped ; r20=num of matching children (r18, r19)
|
||||
pop r19
|
||||
pop r18
|
||||
tst r20
|
||||
breq mLayoutColumnCalcAddSpacePerRow_none ; don't divide by zero!
|
||||
mov r22, r20
|
||||
clr r23
|
||||
mov r20, r18
|
||||
mov r21, r19
|
||||
push r25
|
||||
bigcall Utils_Divu16_16_16 ; r17:r16=space per expandable widget
|
||||
pop r25
|
||||
mov r20, r16
|
||||
mov r21, r17
|
||||
sec
|
||||
rjmp mLayoutColumnCalcAddSpacePerRow_ret
|
||||
push r22
|
||||
push r23
|
||||
rcall mLayoutColumnCalcAdditionalSpaceSkipped ; r21:r20=additional space (R18, R19)
|
||||
brcc mLayoutColumnCalcAddSpacePerRow_ret
|
||||
push r20
|
||||
push r21
|
||||
ldi r22, (1<<WIDGET_PACK_VSELF1_BIT) | (1<<WIDGET_PACK_VSELF0_BIT) ; mask
|
||||
ldi r23, (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; value
|
||||
rcall mLayoutCountMatchingPackContiguous ; r20=num of matching items (r18, r19)
|
||||
mov r22, r20
|
||||
clr r23
|
||||
pop r21
|
||||
pop r20
|
||||
tst r22
|
||||
breq mLayoutColumnCalcAddSpacePerRow_none ; don't divide by zero!
|
||||
|
||||
push r25
|
||||
bigcall Utils_Divu16_16_16 ; r17:r16=space per expandable widget (r25)
|
||||
pop r25
|
||||
mov r20, r16
|
||||
mov r21, r17
|
||||
sec
|
||||
rjmp mLayoutColumnCalcAddSpacePerRow_ret
|
||||
mLayoutColumnCalcAddSpacePerRow_none:
|
||||
clr r20
|
||||
clr r21
|
||||
clc
|
||||
clr r20
|
||||
clr r21
|
||||
clc
|
||||
mLayoutColumnCalcAddSpacePerRow_ret:
|
||||
pop r23
|
||||
pop r22
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine mLayoutColumnCalcAdditionalSpaceSkipped
|
||||
;
|
||||
; Calculate additional space in a row.
|
||||
;
|
||||
; @param Y first widget of current row
|
||||
; @param r19:r18 width of parent widget
|
||||
; @param r22 spacing between widgets
|
||||
; @param r23 border at beginning and and
|
||||
; @param r25 widgets per row/column
|
||||
; @return CFLAG set if there is additional space to distribute
|
||||
; @return r21:r20 available additional space
|
||||
; @clobbers r18, r19
|
||||
|
||||
mLayoutColumnCalcAdditionalSpaceSkipped:
|
||||
push r18
|
||||
push r19
|
||||
rcall mLayoutSumSkipped ; r21:r20 needed minimum row width (r18, r19)
|
||||
pop r19
|
||||
pop r18
|
||||
sub r18, r20
|
||||
sbc r19, r21
|
||||
brcs mLayoutColumnCalcAdditionalSpaceSkipped_none
|
||||
breq mLayoutColumnCalcAdditionalSpaceSkipped_none
|
||||
mov r20, r18
|
||||
mov r21, r19
|
||||
sec
|
||||
rjmp mLayoutColumnCalcAdditionalSpaceSkipped_ret
|
||||
mLayoutColumnCalcAdditionalSpaceSkipped_none:
|
||||
clr r20
|
||||
clr r21
|
||||
clc
|
||||
mLayoutColumnCalcAdditionalSpaceSkipped_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user