| |interface Efl.Pack_Table @beta |├ (P) table_position |├ (P) table_size |├ (P) table_columns |├ (P) table_rows |├ (M) pack_table |├ (M) table_contents_get |├ (M) table_content_get
Looking at this again, it seems like this is somewhat similar to how on gfx.entity objects we have position, size, and geometry. It's nice to be able to set/access both axes in one call, so I think we should leave it.
I agree it is convenient to be able to access both axes at the same time. Let's leave table_size, but we still need a new name for it, though.
Furthermore, table_position is a property with only getter. Shouldn't this be a method then? or do we turn it into a r/w property and allow changing object's position?
I am not very happy with content_get and contents_get, but I see their value. They need better docs and maybe a different name.
Maybe table_cell instead of position? Feels weird if that has a setter since then there's pack and table_cell_get. Isn't there some kind of interface for calling on packed subobjects for things like this? Maybe there should be one?
I think I like table_cell_content_get for getting the object at x,y position too...
Allow me to summarize these interfaces because I am loosing perspective. Efl.Pack_Table and Efl.Pack_Linear are the interfaces to handle 2D and 1D arrangements of widgets, respectively. The important thing here is that they are consistent, I think.
This is their current state, and some name changes I propose:
|Efl.Pack_Linear||Description||Efl.Pack_Table Current name||Efl.Pack_Table Suggested new names|
|pack_begin, pack_end||Adds subobj at absolute position||N/A|
|pack_before, pack_after||Adds subobj relative to existing one||N/A|
|pack_at||Adds subobj at given index||table_pack||table_pack_at|
|pack_content_get||Retrieves subobj at given index||table_content_get|
|pack_index_get||Retrieve a subobj's index||table_position||table_position_get, table_coords_get|
|N/A||Retrieve ALL subobjs at given index||table_contents_get|
I don't think I want to introduce cell, because it has not been used anywhere else. I think position or coords are easily understood as the 2D versions of index.
Also, table_pack is missing an at at the end, for consistency.
What do you think?
This chart https://i.imgur.com/QONVIyz.gif
My concern with using position or coords in this context is that the first impression is that it somehow affects the position of the table object. I realize this can be clarified with docs, but I think we should try to keep terms contextualized.
I like big charts and I cannot lie.
You have a point there. Howe about cell_position_get or cell_coords_get ?
(We then use the table prefix for things that affect the whole table and cell for things that affect a single cell)
This is a rather useless API anyway... the user added the thing to the table, why should it be asking now for its position?
It's used in the code now, so there must be a reason for it...probably.
I really just don't like using those terms in any capacity here, so I'm only okay with that if we absolutely can't think of something better.
I think pack_table is okay. _table is postfix of pack like _at, _begin, _after.
To split properties is find to me. we can also provide setter method. (cell_column_set, cell_row_set)
And we have content_iterate to iterate over packed subobjects in Efl.Container. but i'm not sure table_content_iterate(table_cell_content_iterate) is good name to retrieve ALL subobjs at given index.
How to add child to 2D Container
|addView(View child)||In the case of TableLayout, TableRow tr = new TableRow(this); tr.addView(label); tableLayout.addView(tr);|
|addView(View child, int index)|
|addView(View child, int width, int height)||width and height are gfx sizes|
|addView(View child, LayoutParams params)|
|addView(View child, int index, LayoutParams params)|
|SetColumn(UIElement element, int value)|
|SetColumnSpan(UIElement element, int value)|
|SetRow(UIElement element, int value)|
|SetRowSpan(UIElement element, int value)|
|bool PackTable(Efl.Gfx.IEntity subobj, int col, int row, int colspan, int rowspan);|
How to access child by column and row
|View getChildAt(int index)||TableRow row = (TableRow)tableLayout.getChildAt(i); Button button = (Button)row.getChildAt(j);|
|no APIs. you can use Children property. e.g. grid.Children.Cast<UIElement>().Where(i => Grid.GetRow(i) == 0);|
|Eina.Iterator<Efl.Gfx.IEntity> GetTableContents(int col, int row, bool below);|
|Efl.Gfx.IEntity GetTableContent(int col, int row);|
How to get column and row properties of child
|no APIs (i can't find)||TableRow row = (TableRow)tableLayout.getChildAt(i); TableRow.LayoutParams param= (TableRow.LayoutParams) row.getLayoutParams(); param.column;|
|int GetColumn(UIElement element)|
|int GetColumnSpan(UIElement element)|
|int GetRow(UIElement element)|
|int GetRowSpan(UIElement element)|
|bool GetTablePosition(Efl.Gfx.IEntity subobj, out int col, out int row, out int colspan, out int rowspan)|
|Efl.Ui.Table (@segfaultxavi's suggestion)|
|bool GetCellColumn(Efl.Gfx.IEntity subobj, out int col, out int colspan)|
|bool GetCellRow(Efl.Gfx.IEntity subobj, out int row, out int rowspan)|
|Efl.Ui.Table (my suggestion)|
|bool SetCellColumn(Efl.Gfx.IEntity subobj, int col, int colspan)|
|bool SetCellRow(Efl.Gfx.IEntity subobj, int row, int rowspan)|
I think the separated property getter/setter are also useful, because EFL doesn't have common property struct(like LayoutParams in android).