Commit 4eca48b04bc42361f415fa13f5e4bd40b8a84156
1 parent
a5ad7778
introduce edit_view_table_form and rename edit_view into edit_view_list_form
Showing
29 changed files
with
521 additions
and
61 deletions
Show diff stats
ds_files/ds_types.anubis
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | read densaku_lib/types/densaku.anubis |
| 11 | 11 | |
| 12 | 12 | define String model_types = "hayamiki_lib/model/types/". |
| 13 | +define String view_types = "hayamiki_lib/view/types/". | |
| 13 | 14 | |
| 14 | 15 | public define List(DS_Type) hayamiki_lib_types_description = |
| 15 | 16 | [ |
| ... | ... | @@ -204,12 +205,52 @@ public define List(DS_Type) hayamiki_lib_types_description = |
| 204 | 205 | ]) |
| 205 | 206 | ]), |
| 206 | 207 | |
| 208 | + ds_type("HK_View_Editor_Cell", [ | |
| 209 | + alternative("ve_cell", [ | |
| 210 | + component(extern_type("VT_edit_entry", "hayamiki_lib/view/view_table_types.anubis"), "edit_entry") | |
| 211 | + ]) | |
| 212 | + ]), | |
| 213 | + | |
| 214 | + ds_type("HK_View_Editor_Line", [ | |
| 215 | + alternative("ve_line", [ | |
| 216 | + component(list, extern_type("HK_View_Editor_Cell", view_types+"hk_view_editor_cell.anubis"), "ve_cells") | |
| 217 | + ]) | |
| 218 | + ]), | |
| 219 | + | |
| 220 | + ds_type("HK_View_Editor_Table", [ | |
| 221 | + alternative("ve_table", [ | |
| 222 | + component(list, extern_type("HK_View_Editor_Line", view_types+"hk_view_editor_line.anubis"), "ve_lines") | |
| 223 | + ]) | |
| 224 | + ]), | |
| 225 | + | |
| 226 | + ds_type("HK_Edit_View_Cell", [ | |
| 227 | + alternative("ev_cell", [ | |
| 228 | + component(string, "column_name") | |
| 229 | + ]) | |
| 230 | + ]), | |
| 231 | + | |
| 232 | + ds_type("HK_Edit_View_Line", [ | |
| 233 | + alternative("ev_line", [ | |
| 234 | + component(list, extern_type("HK_Edit_View_Cell", model_types+"hk_edit_view_cell.anubis"), "ev_cells") | |
| 235 | + ]) | |
| 236 | + ]), | |
| 237 | + | |
| 238 | + ds_type("HK_Edit_View_Table", [ | |
| 239 | + alternative("ev_table", [ | |
| 240 | + component(list, extern_type("HK_Edit_View_Line", model_types+"hk_edit_view_line.anubis"), "ev_lines") | |
| 241 | + ]) | |
| 242 | + ]), | |
| 243 | + | |
| 207 | 244 | ds_type("HK_Edit_View", [ |
| 208 | 245 | enum("edit_view_all"), |
| 209 | - alternative("edit_view", [ | |
| 246 | + alternative("edit_view_list_form", [ | |
| 210 | 247 | component(string, "view_name"), |
| 211 | 248 | component(list, string, "columns"), |
| 212 | 249 | component(list, extern_type("HK_FK_View", model_types+"hk_fk_view.anubis"), "fk_view") |
| 250 | + ]), | |
| 251 | + alternative("edit_view_table_form", [ | |
| 252 | + component(string, "view_name"), | |
| 253 | + component(extern_type("HK_Edit_View_Table", model_types+"hk_edit_view_table.anubis"), "ev_table") | |
| 213 | 254 | ]) |
| 214 | 255 | ]), |
| 215 | 256 | ... | ... |
model/display.anubis
| ... | ... | @@ -27,12 +27,12 @@ public define HK_List_View |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | public define HK_Edit_View |
| 30 | - edit_view | |
| 30 | + edit_view_list_form | |
| 31 | 31 | ( |
| 32 | 32 | String view_name, |
| 33 | 33 | List(String) columns |
| 34 | 34 | )= |
| 35 | - edit_view(view_name, columns, []) | |
| 35 | + edit_view_list_form(view_name, columns, []) | |
| 36 | 36 | . |
| 37 | 37 | |
| 38 | 38 | ... | ... |
model/types/hk_app.anubis
model/types/hk_app_name.anubis
model/types/hk_database.anubis
model/types/hk_datetime_field_attr.anubis
model/types/hk_display.anubis
model/types/hk_edit_view.anubis
| 1 | 1 | /* |
| 2 | 2 | * Created by 伝作 (Densaku). |
| 3 | 3 | * Types & Messages generator written by フランスのトトロ aka (David RENÉ) |
| 4 | - * Date: 2017-03-18 | |
| 5 | - * Time: 23:38:31 | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | 6 | * |
| 7 | 7 | */ |
| 8 | 8 | |
| ... | ... | @@ -10,14 +10,19 @@ transmit system/muscle.anubis |
| 10 | 10 | transmit system/convert.anubis |
| 11 | 11 | transmit tools/basis.anubis |
| 12 | 12 | |
| 13 | +transmit hayamiki_lib/model/types/hk_edit_view_table.anubis | |
| 13 | 14 | transmit hayamiki_lib/model/types/hk_fk_view.anubis |
| 14 | 15 | |
| 15 | 16 | public type HK_Edit_View: |
| 16 | - edit_view_all, | |
| 17 | - edit_view( | |
| 18 | - String view_name, | |
| 19 | - List(String) columns, | |
| 20 | - List(HK_FK_View) fk_view | |
| 17 | + edit_view_all, | |
| 18 | + edit_view_list_form( | |
| 19 | + String view_name, | |
| 20 | + List(String) columns, | |
| 21 | + List(HK_FK_View) fk_view | |
| 22 | + ), | |
| 23 | + edit_view_table_form( | |
| 24 | + String view_name, | |
| 25 | + HK_Edit_View_Table ev_table | |
| 21 | 26 | ) |
| 22 | 27 | . |
| 23 | 28 | |
| ... | ... | @@ -38,16 +43,24 @@ public define Message |
| 38 | 43 | edit_view_all then |
| 39 | 44 | forget(add_string(_hk_edit_view_message, "__TYPE_ALT__", "edit_view_all")), |
| 40 | 45 | |
| 41 | - //Alternative edit_view | |
| 42 | - edit_view(_view_name, __columns, __fk_view) then | |
| 43 | - forget(add_string(_hk_edit_view_message, "__TYPE_ALT__", "edit_view")); | |
| 44 | - // [type = String] edit_view.view_name | |
| 46 | + //Alternative edit_view_list_form | |
| 47 | + edit_view_list_form(_view_name, __columns, __fk_view) then | |
| 48 | + forget(add_string(_hk_edit_view_message, "__TYPE_ALT__", "edit_view_list_form")); | |
| 49 | + // [type = String] edit_view_list_form.view_name | |
| 45 | 50 | forget(add_string(_hk_edit_view_message, "view_name", _view_name)); |
| 46 | - // [type = List(String)] edit_view.columns | |
| 51 | + // [type = List(String)] edit_view_list_form.columns | |
| 47 | 52 | map_forget((String _columns) |-> add_string(_hk_edit_view_message, "columns", _columns), __columns); |
| 48 | - // [type = List(HK_FK_View)] edit_view.fk_view | |
| 53 | + // [type = List(HK_FK_View)] edit_view_list_form.fk_view | |
| 49 | 54 | map_forget((HK_FK_View _fk_view) |-> add_message(_hk_edit_view_message, "fk_view", to_Message(_fk_view)), __fk_view), |
| 50 | 55 | |
| 56 | + //Alternative edit_view_table_form | |
| 57 | + edit_view_table_form(_view_name, _ev_table) then | |
| 58 | + forget(add_string(_hk_edit_view_message, "__TYPE_ALT__", "edit_view_table_form")); | |
| 59 | + // [type = String] edit_view_table_form.view_name | |
| 60 | + forget(add_string(_hk_edit_view_message, "view_name", _view_name)); | |
| 61 | + // [type = HK_Edit_View_Table] edit_view_table_form.ev_table | |
| 62 | + forget(add_message(_hk_edit_view_message, "ev_table", to_Message(_ev_table))), | |
| 63 | + | |
| 51 | 64 | }; |
| 52 | 65 | _hk_edit_view_message |
| 53 | 66 | . |
| ... | ... | @@ -63,18 +76,28 @@ public define Maybe(HK_Edit_View) |
| 63 | 76 | //Alternative edit_view_all (NO TYPE) |
| 64 | 77 | if __type_alt__ = "edit_view_all" then |
| 65 | 78 | success(edit_view_all) |
| 66 | - else //Alternative edit_view | |
| 67 | - if __type_alt__ = "edit_view" then //Alternative edit_view | |
| 68 | - // [type = String] edit_view.view_name | |
| 79 | + else //Alternative edit_view_list_form | |
| 80 | + if __type_alt__ = "edit_view_list_form" then //Alternative edit_view_list_form | |
| 81 | + // [type = String] edit_view_list_form.view_name | |
| 69 | 82 | if find_string(_hk_edit_view_message, "view_name") is {failure then failure, success(view_name) then |
| 70 | - // [type = List(String)] edit_view.columns | |
| 83 | + // [type = List(String)] edit_view_list_form.columns | |
| 71 | 84 | with columns = find_string_list(_hk_edit_view_message, "columns"), |
| 72 | - // [type = List(HK_FK_View)] edit_view.fk_view | |
| 85 | + // [type = List(HK_FK_View)] edit_view_list_form.fk_view | |
| 73 | 86 | with mb_fk_view = map_escape(( Message msg ) |-> (Maybe(HK_FK_View)) from_Message(msg), find_messages(_hk_edit_view_message, "fk_view")), |
| 74 | 87 | if mb_fk_view is {failure then failure, success(fk_view) then |
| 75 | 88 | |
| 76 | - success(edit_view(view_name, columns, fk_view)) | |
| 89 | + success(edit_view_list_form(view_name, columns, fk_view)) | |
| 77 | 90 | }} |
| 91 | + else //Alternative edit_view_table_form | |
| 92 | + if __type_alt__ = "edit_view_table_form" then //Alternative edit_view_table_form | |
| 93 | + // [type = String] edit_view_table_form.view_name | |
| 94 | + if find_string(_hk_edit_view_message, "view_name") is {failure then failure, success(view_name) then | |
| 95 | + // [type = HK_Edit_View_Table] edit_view_table_form.ev_table | |
| 96 | + if find_message(_hk_edit_view_message, "ev_table") is {failure then failure, success(ev_table_msg) then | |
| 97 | + if (Maybe(HK_Edit_View_Table))from_Message(ev_table_msg) is {failure then failure, success(ev_table) then | |
| 98 | + | |
| 99 | + success(edit_view_table_form(view_name, ev_table)) | |
| 100 | + }}} | |
| 78 | 101 | else |
| 79 | 102 | failure //No valid Alternative found ! |
| 80 | 103 | else | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | + | |
| 14 | +public type HK_Edit_View_Cell: | |
| 15 | + ev_cell( | |
| 16 | + String column_name | |
| 17 | + ) | |
| 18 | +. | |
| 19 | + | |
| 20 | + HK_Edit_View_Cell message format | |
| 21 | + ================================ | |
| 22 | + | |
| 23 | + | |
| 24 | +public define Message | |
| 25 | + to_Message | |
| 26 | + ( | |
| 27 | + HK_Edit_View_Cell _hk_edit_view_cell | |
| 28 | + )= | |
| 29 | + with _hk_edit_view_cell_message = message((Word32)0), // | |
| 30 | + forget(add_string(_hk_edit_view_cell_message, "__TYPE__", "HK_Edit_View_Cell")); | |
| 31 | + if _hk_edit_view_cell is | |
| 32 | + { | |
| 33 | + //Alternative ev_cell | |
| 34 | + ev_cell(_column_name) then | |
| 35 | + forget(add_string(_hk_edit_view_cell_message, "__TYPE_ALT__", "ev_cell")); | |
| 36 | + // [type = String] ev_cell.column_name | |
| 37 | + forget(add_string(_hk_edit_view_cell_message, "column_name", _column_name)), | |
| 38 | + | |
| 39 | + }; | |
| 40 | + _hk_edit_view_cell_message | |
| 41 | +. | |
| 42 | + | |
| 43 | +public define Maybe(HK_Edit_View_Cell) | |
| 44 | + from_Message | |
| 45 | + ( | |
| 46 | + Message _hk_edit_view_cell_message | |
| 47 | + )= | |
| 48 | + if find_string(_hk_edit_view_cell_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 49 | + if find_string(_hk_edit_view_cell_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 50 | + if __type__ = "HK_Edit_View_Cell" then | |
| 51 | + //Alternative ev_cell | |
| 52 | + if __type_alt__ = "ev_cell" then //Alternative ev_cell | |
| 53 | + // [type = String] ev_cell.column_name | |
| 54 | + if find_string(_hk_edit_view_cell_message, "column_name") is {failure then failure, success(column_name) then | |
| 55 | + | |
| 56 | + success(ev_cell(column_name)) | |
| 57 | + } | |
| 58 | + else | |
| 59 | + failure //No valid Alternative found ! | |
| 60 | + else | |
| 61 | + failure //Type not found in message ! | |
| 62 | + }} | |
| 63 | +. | |
| 64 | + | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | +transmit hayamiki_lib/model/types/hk_edit_view_cell.anubis | |
| 14 | + | |
| 15 | +public type HK_Edit_View_Line: | |
| 16 | + ev_line( | |
| 17 | + List(HK_Edit_View_Cell) ev_cells | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_Edit_View_Line message format | |
| 22 | + ================================ | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_Edit_View_Line _hk_edit_view_line | |
| 29 | + )= | |
| 30 | + with _hk_edit_view_line_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_edit_view_line_message, "__TYPE__", "HK_Edit_View_Line")); | |
| 32 | + if _hk_edit_view_line is | |
| 33 | + { | |
| 34 | + //Alternative ev_line | |
| 35 | + ev_line(__ev_cells) then | |
| 36 | + forget(add_string(_hk_edit_view_line_message, "__TYPE_ALT__", "ev_line")); | |
| 37 | + // [type = List(HK_Edit_View_Cell)] ev_line.ev_cells | |
| 38 | + map_forget((HK_Edit_View_Cell _ev_cells) |-> add_message(_hk_edit_view_line_message, "ev_cells", to_Message(_ev_cells)), __ev_cells), | |
| 39 | + | |
| 40 | + }; | |
| 41 | + _hk_edit_view_line_message | |
| 42 | +. | |
| 43 | + | |
| 44 | +public define Maybe(HK_Edit_View_Line) | |
| 45 | + from_Message | |
| 46 | + ( | |
| 47 | + Message _hk_edit_view_line_message | |
| 48 | + )= | |
| 49 | + if find_string(_hk_edit_view_line_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 50 | + if find_string(_hk_edit_view_line_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 51 | + if __type__ = "HK_Edit_View_Line" then | |
| 52 | + //Alternative ev_line | |
| 53 | + if __type_alt__ = "ev_line" then //Alternative ev_line | |
| 54 | + // [type = List(HK_Edit_View_Cell)] ev_line.ev_cells | |
| 55 | + with mb_ev_cells = map_escape(( Message msg ) |-> (Maybe(HK_Edit_View_Cell)) from_Message(msg), find_messages(_hk_edit_view_line_message, "ev_cells")), | |
| 56 | + if mb_ev_cells is {failure then failure, success(ev_cells) then | |
| 57 | + | |
| 58 | + success(ev_line(ev_cells)) | |
| 59 | + } | |
| 60 | + else | |
| 61 | + failure //No valid Alternative found ! | |
| 62 | + else | |
| 63 | + failure //Type not found in message ! | |
| 64 | + }} | |
| 65 | +. | |
| 66 | + | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | +transmit hayamiki_lib/model/types/hk_edit_view_line.anubis | |
| 14 | + | |
| 15 | +public type HK_Edit_View_Table: | |
| 16 | + ev_table( | |
| 17 | + List(HK_Edit_View_Line) ev_lines | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_Edit_View_Table message format | |
| 22 | + ================================= | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_Edit_View_Table _hk_edit_view_table | |
| 29 | + )= | |
| 30 | + with _hk_edit_view_table_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_edit_view_table_message, "__TYPE__", "HK_Edit_View_Table")); | |
| 32 | + if _hk_edit_view_table is | |
| 33 | + { | |
| 34 | + //Alternative ev_table | |
| 35 | + ev_table(__ev_lines) then | |
| 36 | + forget(add_string(_hk_edit_view_table_message, "__TYPE_ALT__", "ev_table")); | |
| 37 | + // [type = List(HK_Edit_View_Line)] ev_table.ev_lines | |
| 38 | + map_forget((HK_Edit_View_Line _ev_lines) |-> add_message(_hk_edit_view_table_message, "ev_lines", to_Message(_ev_lines)), __ev_lines), | |
| 39 | + | |
| 40 | + }; | |
| 41 | + _hk_edit_view_table_message | |
| 42 | +. | |
| 43 | + | |
| 44 | +public define Maybe(HK_Edit_View_Table) | |
| 45 | + from_Message | |
| 46 | + ( | |
| 47 | + Message _hk_edit_view_table_message | |
| 48 | + )= | |
| 49 | + if find_string(_hk_edit_view_table_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 50 | + if find_string(_hk_edit_view_table_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 51 | + if __type__ = "HK_Edit_View_Table" then | |
| 52 | + //Alternative ev_table | |
| 53 | + if __type_alt__ = "ev_table" then //Alternative ev_table | |
| 54 | + // [type = List(HK_Edit_View_Line)] ev_table.ev_lines | |
| 55 | + with mb_ev_lines = map_escape(( Message msg ) |-> (Maybe(HK_Edit_View_Line)) from_Message(msg), find_messages(_hk_edit_view_table_message, "ev_lines")), | |
| 56 | + if mb_ev_lines is {failure then failure, success(ev_lines) then | |
| 57 | + | |
| 58 | + success(ev_table(ev_lines)) | |
| 59 | + } | |
| 60 | + else | |
| 61 | + failure //No valid Alternative found ! | |
| 62 | + else | |
| 63 | + failure //Type not found in message ! | |
| 64 | + }} | |
| 65 | +. | |
| 66 | + | ... | ... |
model/types/hk_fk_view.anubis
model/types/hk_help_text.anubis
model/types/hk_icon.anubis
model/types/hk_int_choice.anubis
model/types/hk_int_choices.anubis
model/types/hk_list_view.anubis
model/types/hk_model.anubis
model/types/hk_model_attr.anubis
model/types/hk_model_column.anubis
model/types/hk_model_field.anubis
model/types/hk_table.anubis
model/types/hk_text_choice.anubis
model/types/hk_text_choices.anubis
model/types/hk_text_field_attr.anubis
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | +transmit hayamiki_lib/view/view_table_types.anubis | |
| 14 | + | |
| 15 | +public type HK_View_Editor_Cell: | |
| 16 | + ve_cell( | |
| 17 | + VT_edit_entry edit_entry | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_View_Editor_Cell message format | |
| 22 | + ================================== | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_View_Editor_Cell _hk_view_editor_cell | |
| 29 | + )= | |
| 30 | + with _hk_view_editor_cell_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_view_editor_cell_message, "__TYPE__", "HK_View_Editor_Cell")); | |
| 32 | + if _hk_view_editor_cell is | |
| 33 | + { | |
| 34 | + //Alternative ve_cell | |
| 35 | + ve_cell(_edit_entry) then | |
| 36 | + forget(add_string(_hk_view_editor_cell_message, "__TYPE_ALT__", "ve_cell")); | |
| 37 | + // [type = VT_edit_entry] ve_cell.edit_entry | |
| 38 | + forget(add_message(_hk_view_editor_cell_message, "edit_entry", to_Message(_edit_entry))), | |
| 39 | + | |
| 40 | + }; | |
| 41 | + _hk_view_editor_cell_message | |
| 42 | +. | |
| 43 | + | |
| 44 | +public define Maybe(HK_View_Editor_Cell) | |
| 45 | + from_Message | |
| 46 | + ( | |
| 47 | + Message _hk_view_editor_cell_message | |
| 48 | + )= | |
| 49 | + if find_string(_hk_view_editor_cell_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 50 | + if find_string(_hk_view_editor_cell_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 51 | + if __type__ = "HK_View_Editor_Cell" then | |
| 52 | + //Alternative ve_cell | |
| 53 | + if __type_alt__ = "ve_cell" then //Alternative ve_cell | |
| 54 | + // [type = VT_edit_entry] ve_cell.edit_entry | |
| 55 | + if find_message(_hk_view_editor_cell_message, "edit_entry") is {failure then failure, success(edit_entry_msg) then | |
| 56 | + if (Maybe(VT_edit_entry))from_Message(edit_entry_msg) is {failure then failure, success(edit_entry) then | |
| 57 | + | |
| 58 | + success(ve_cell(edit_entry)) | |
| 59 | + }} | |
| 60 | + else | |
| 61 | + failure //No valid Alternative found ! | |
| 62 | + else | |
| 63 | + failure //Type not found in message ! | |
| 64 | + }} | |
| 65 | +. | |
| 66 | + | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | +transmit hayamiki_lib/view/types/hk_view_editor_cell.anubis | |
| 14 | + | |
| 15 | +public type HK_View_Editor_Line: | |
| 16 | + ve_line( | |
| 17 | + List(HK_View_Editor_Cell) ve_cells | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_View_Editor_Line message format | |
| 22 | + ================================== | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_View_Editor_Line _hk_view_editor_line | |
| 29 | + )= | |
| 30 | + with _hk_view_editor_line_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_view_editor_line_message, "__TYPE__", "HK_View_Editor_Line")); | |
| 32 | + if _hk_view_editor_line is | |
| 33 | + { | |
| 34 | + //Alternative ve_line | |
| 35 | + ve_line(__ve_cells) then | |
| 36 | + forget(add_string(_hk_view_editor_line_message, "__TYPE_ALT__", "ve_line")); | |
| 37 | + // [type = List(HK_View_Editor_Cell)] ve_line.ve_cells | |
| 38 | + map_forget((HK_View_Editor_Cell _ve_cells) |-> add_message(_hk_view_editor_line_message, "ve_cells", to_Message(_ve_cells)), __ve_cells), | |
| 39 | + | |
| 40 | + }; | |
| 41 | + _hk_view_editor_line_message | |
| 42 | +. | |
| 43 | + | |
| 44 | +public define Maybe(HK_View_Editor_Line) | |
| 45 | + from_Message | |
| 46 | + ( | |
| 47 | + Message _hk_view_editor_line_message | |
| 48 | + )= | |
| 49 | + if find_string(_hk_view_editor_line_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 50 | + if find_string(_hk_view_editor_line_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 51 | + if __type__ = "HK_View_Editor_Line" then | |
| 52 | + //Alternative ve_line | |
| 53 | + if __type_alt__ = "ve_line" then //Alternative ve_line | |
| 54 | + // [type = List(HK_View_Editor_Cell)] ve_line.ve_cells | |
| 55 | + with mb_ve_cells = map_escape(( Message msg ) |-> (Maybe(HK_View_Editor_Cell)) from_Message(msg), find_messages(_hk_view_editor_line_message, "ve_cells")), | |
| 56 | + if mb_ve_cells is {failure then failure, success(ve_cells) then | |
| 57 | + | |
| 58 | + success(ve_line(ve_cells)) | |
| 59 | + } | |
| 60 | + else | |
| 61 | + failure //No valid Alternative found ! | |
| 62 | + else | |
| 63 | + failure //Type not found in message ! | |
| 64 | + }} | |
| 65 | +. | |
| 66 | + | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-03 | |
| 5 | + * Time: 23:52:46 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | +transmit hayamiki_lib/view/types/hk_view_editor_line.anubis | |
| 14 | + | |
| 15 | +public type HK_View_Editor_Table: | |
| 16 | + ve_table( | |
| 17 | + List(HK_View_Editor_Line) ve_lines | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_View_Editor_Table message format | |
| 22 | + =================================== | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_View_Editor_Table _hk_view_editor_table | |
| 29 | + )= | |
| 30 | + with _hk_view_editor_table_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_view_editor_table_message, "__TYPE__", "HK_View_Editor_Table")); | |
| 32 | + if _hk_view_editor_table is | |
| 33 | + { | |
| 34 | + //Alternative ve_table | |
| 35 | + ve_table(__ve_lines) then | |
| 36 | + forget(add_string(_hk_view_editor_table_message, "__TYPE_ALT__", "ve_table")); | |
| 37 | + // [type = List(HK_View_Editor_Line)] ve_table.ve_lines | |
| 38 | + map_forget((HK_View_Editor_Line _ve_lines) |-> add_message(_hk_view_editor_table_message, "ve_lines", to_Message(_ve_lines)), __ve_lines), | |
| 39 | + | |
| 40 | + }; | |
| 41 | + _hk_view_editor_table_message | |
| 42 | +. | |
| 43 | + | |
| 44 | +public define Maybe(HK_View_Editor_Table) | |
| 45 | + from_Message | |
| 46 | + ( | |
| 47 | + Message _hk_view_editor_table_message | |
| 48 | + )= | |
| 49 | + if find_string(_hk_view_editor_table_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 50 | + if find_string(_hk_view_editor_table_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 51 | + if __type__ = "HK_View_Editor_Table" then | |
| 52 | + //Alternative ve_table | |
| 53 | + if __type_alt__ = "ve_table" then //Alternative ve_table | |
| 54 | + // [type = List(HK_View_Editor_Line)] ve_table.ve_lines | |
| 55 | + with mb_ve_lines = map_escape(( Message msg ) |-> (Maybe(HK_View_Editor_Line)) from_Message(msg), find_messages(_hk_view_editor_table_message, "ve_lines")), | |
| 56 | + if mb_ve_lines is {failure then failure, success(ve_lines) then | |
| 57 | + | |
| 58 | + success(ve_table(ve_lines)) | |
| 59 | + } | |
| 60 | + else | |
| 61 | + failure //No valid Alternative found ! | |
| 62 | + else | |
| 63 | + failure //Type not found in message ! | |
| 64 | + }} | |
| 65 | +. | |
| 66 | + | ... | ... |
view/view_table_types.anubis
| ... | ... | @@ -15,6 +15,7 @@ public type VT_edit_selector: |
| 15 | 15 | |
| 16 | 16 | public type VT_edit_entry: |
| 17 | 17 | hidden (String name, String value), |
| 18 | + label (String s_name), | |
| 18 | 19 | primary_key (String idx), |
| 19 | 20 | information (String s_name, String c_name, String v_name, Int width, HK_Help_Text help), //s_name = show_name for translation, v_name = string to show |
| 20 | 21 | text (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name |
| ... | ... | @@ -46,7 +47,8 @@ public type HK_V_Edit_Tab: |
| 46 | 47 | . |
| 47 | 48 | |
| 48 | 49 | public type VT_edit: |
| 49 | - vt_edit(String table_name, String view_name, List(VT_edit_entry) list, List(HK_V_Edit_Tab) tabs). | |
| 50 | + vt_edit_list_form(String table_name, String view_name, List(VT_edit_entry) list, List(HK_V_Edit_Tab) tabs), | |
| 51 | + vt_edit_table_form(String table_name, String view_name, | |
| 50 | 52 | |
| 51 | 53 | |
| 52 | 54 | public type VT_view_model_entry: | ... | ... |