Little game of the day. Get link Facebook X Pinterest Email Other Apps - September 16, 2015 Little game of the day.Put a TGridPanelLayout on a (FMX) form, select the first RowItem and fix it's Percent value to 10 :)Workaround -> edit the FMX and set both row value at once Get link Facebook X Pinterest Email Other Apps Comments Eli MSeptember 16, 2015 at 4:15 AMIt's as designed. It automatically averages the percentages between the number of rows. Does it need a better design? Probably.ReplyDeleteRepliesReplyAsbjørn HeidSeptember 16, 2015 at 4:28 AMIt should be a weight then, not a percentage.ReplyDeleteRepliesReplyPaul TOTHSeptember 16, 2015 at 4:48 AMthe problem is that the value is set, and then the average is made.Row[x] = Row[x] / Sum(Rows) * 10010 / (10 + 50) * 100 = 1,6666650 / (10 + 50) * 100= 83,3333this component need a custom editor to fix all the values at once.ReplyDeleteRepliesReplyLars FosdalSeptember 16, 2015 at 4:57 AM.dfm view as text, edit to desired. Remember to total to 100.Err... that was VCL - can you view as text for FMX?ReplyDeleteRepliesReplyPaul TOTHSeptember 16, 2015 at 5:04 AMLars Fosdal yes that's what I did to set 4 rows at 25%ReplyDeleteRepliesReplymezenSeptember 16, 2015 at 6:12 AMTGridPanel on XE (only VCL) has the same behaviour, nothing new :-\ReplyDeleteRepliesReplyBruce McGeeSeptember 16, 2015 at 6:22 AMOr do it in code. Don't forget BeginUpdate/EndUpdate.ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
It's as designed. It automatically averages the percentages between the number of rows. Does it need a better design? Probably.
ReplyDeleteIt should be a weight then, not a percentage.
ReplyDeletethe problem is that the value is set, and then the average is made.
ReplyDeleteRow[x] = Row[x] / Sum(Rows) * 100
10 / (10 + 50) * 100 = 1,66666
50 / (10 + 50) * 100= 83,3333
this component need a custom editor to fix all the values at once.
.dfm view as text, edit to desired. Remember to total to 100.
ReplyDeleteErr... that was VCL - can you view as text for FMX?
Lars Fosdal yes that's what I did to set 4 rows at 25%
ReplyDeleteTGridPanel on XE (only VCL) has the same behaviour, nothing new :-\
ReplyDeleteOr do it in code. Don't forget BeginUpdate/EndUpdate.
ReplyDelete