From b0635c56b0ff5113b85301a06aee7b71ce76bc22 Mon Sep 17 00:00:00 2001 From: totoro Date: Thu, 13 Apr 2017 00:09:11 +0200 Subject: [PATCH] add hk_form_table_cell_table, which enable to add table inside cell --- ds_files/ds_types.anubis | 58 +++++++++++++++++++++++++++++++++------------------------- model/types/hk_app.anubis | 2 +- model/types/hk_app_name.anubis | 2 +- model/types/hk_database.anubis | 2 +- model/types/hk_datetime_field_attr.anubis | 2 +- model/types/hk_help_text.anubis | 2 +- model/types/hk_icon.anubis | 2 +- model/types/hk_int_choice.anubis | 2 +- model/types/hk_int_choices.anubis | 2 +- model/types/hk_model.anubis | 2 +- model/types/hk_model_attr.anubis | 2 +- model/types/hk_model_column.anubis | 2 +- model/types/hk_model_field.anubis | 2 +- model/types/hk_table.anubis | 2 +- model/types/hk_text_choice.anubis | 2 +- model/types/hk_text_choices.anubis | 2 +- model/types/hk_text_field_attr.anubis | 2 +- view/types/hk_display.anubis | 2 +- view/types/hk_editor.anubis | 2 +- view/types/hk_editor_table.anubis | 30 ++++++++++++++++-------------- view/types/hk_fk_view.anubis | 2 +- view/types/hk_form.anubis | 2 +- view/types/hk_form_tab.anubis | 2 +- view/types/hk_form_table.anubis | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- view/types/hk_form_table_attribute.anubis | 71 ----------------------------------------------------------------------- view/types/hk_form_table_cell.anubis | 21 --------------------- view/types/hk_form_table_line.anubis | 21 --------------------- view/types/hk_viewer.anubis | 2 +- 28 files changed, 168 insertions(+), 177 deletions(-) delete mode 100644 view/types/hk_form_table_attribute.anubis delete mode 100644 view/types/hk_form_table_cell.anubis delete mode 100644 view/types/hk_form_table_line.anubis diff --git a/ds_files/ds_types.anubis b/ds_files/ds_types.anubis index 466de24..c0a3110 100644 --- a/ds_files/ds_types.anubis +++ b/ds_files/ds_types.anubis @@ -200,31 +200,7 @@ public define List(DS_Type_File) hayamiki_lib_types_description = ]) ]), - ds_type("HK_Form_Table_Cell", no_message, [ - alternative("hk_form_table_cell", [ - component(extern_type("HK_Form_Entry", view_types+"hk_form_entry.anubis"), "form_entry") - ]) - ]), - - ds_type("HK_Form_Table_Line", no_message, [ - alternative("hk_form_table_line", [ - component(list, extern_type("HK_Form_Table_Cell", view_types+"hk_form_table_cell.anubis"), "form_table_cells") - ]) - ]), - - ds_type("HK_Form_Table_Attribute", [ - alternative("hidden", [ - component(string, "name"), - component(string, "value") - ]) - ]), - - ds_type("HK_Form_Table", no_message, [ - alternative("hk_form_table", [ - component(list, extern_type("HK_Form_Table_Attribute", view_types+"hk_form_table_attribute.anubis"), "table_attr"), - component(list, extern_type("HK_Form_Table_Line", view_types+"hk_form_table_line.anubis"), "form_lines") - ]) - ]), + @@ -293,6 +269,38 @@ public define List(DS_Type_File) hayamiki_lib_types_description = ]) ]), + ]), + + ds_type_file(auto, name("hk_form_table"), + [ + ds_type("HK_Form_Table_Cell", no_message, [ + alternative("hk_form_table_cell", [ + component(extern_type("HK_Form_Entry", view_types+"hk_form_entry.anubis"), "form_entry") + ]), + alternative("hk_form_table_cell_table", [ + component(list, ds_type("HK_Form_Table_Line"), "form_lines") + ]) + ]), + + ds_type("HK_Form_Table_Line", no_message, [ + alternative("hk_form_table_line", [ + component(list, ds_type("HK_Form_Table_Cell"), "form_table_cells") + ]) + ]), + + ds_type("HK_Form_Table_Attribute", [ + alternative("hidden", [ + component(string, "name"), + component(string, "value") + ]) + ]), + + ds_type("HK_Form_Table", no_message, [ + alternative("hk_form_table", [ + component(list, ds_type("HK_Form_Table_Attribute"), "table_attr"), + component(list, ds_type("HK_Form_Table_Line"), "form_lines") + ]) + ]), ]) ] diff --git a/model/types/hk_app.anubis b/model/types/hk_app.anubis index b45bf16..8d99a66 100644 --- a/model/types/hk_app.anubis +++ b/model/types/hk_app.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_app_name.anubis b/model/types/hk_app_name.anubis index 84df608..673cc4d 100644 --- a/model/types/hk_app_name.anubis +++ b/model/types/hk_app_name.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_database.anubis b/model/types/hk_database.anubis index 5170a6e..4c88ccc 100644 --- a/model/types/hk_database.anubis +++ b/model/types/hk_database.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_datetime_field_attr.anubis b/model/types/hk_datetime_field_attr.anubis index 555dba2..ff99d26 100644 --- a/model/types/hk_datetime_field_attr.anubis +++ b/model/types/hk_datetime_field_attr.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_help_text.anubis b/model/types/hk_help_text.anubis index 9a69bbe..37633a0 100644 --- a/model/types/hk_help_text.anubis +++ b/model/types/hk_help_text.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_icon.anubis b/model/types/hk_icon.anubis index b4dc992..f542b88 100644 --- a/model/types/hk_icon.anubis +++ b/model/types/hk_icon.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_int_choice.anubis b/model/types/hk_int_choice.anubis index 73f7621..39f0e2f 100644 --- a/model/types/hk_int_choice.anubis +++ b/model/types/hk_int_choice.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_int_choices.anubis b/model/types/hk_int_choices.anubis index 3dc1f46..2b92366 100644 --- a/model/types/hk_int_choices.anubis +++ b/model/types/hk_int_choices.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_model.anubis b/model/types/hk_model.anubis index fe81cfb..cf089f4 100644 --- a/model/types/hk_model.anubis +++ b/model/types/hk_model.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_model_attr.anubis b/model/types/hk_model_attr.anubis index e21d9b8..a731e88 100644 --- a/model/types/hk_model_attr.anubis +++ b/model/types/hk_model_attr.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_model_column.anubis b/model/types/hk_model_column.anubis index 010f0c1..dd45334 100644 --- a/model/types/hk_model_column.anubis +++ b/model/types/hk_model_column.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_model_field.anubis b/model/types/hk_model_field.anubis index cff0337..fd24108 100644 --- a/model/types/hk_model_field.anubis +++ b/model/types/hk_model_field.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_table.anubis b/model/types/hk_table.anubis index dbc3d56..789e0f9 100644 --- a/model/types/hk_table.anubis +++ b/model/types/hk_table.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_text_choice.anubis b/model/types/hk_text_choice.anubis index bdec710..55ff9b5 100644 --- a/model/types/hk_text_choice.anubis +++ b/model/types/hk_text_choice.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_text_choices.anubis b/model/types/hk_text_choices.anubis index a19d593..98b89ba 100644 --- a/model/types/hk_text_choices.anubis +++ b/model/types/hk_text_choices.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/model/types/hk_text_field_attr.anubis b/model/types/hk_text_field_attr.anubis index b197cdf..eb4fdfe 100644 --- a/model/types/hk_text_field_attr.anubis +++ b/model/types/hk_text_field_attr.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_display.anubis b/view/types/hk_display.anubis index 1af329c..01c61c4 100644 --- a/view/types/hk_display.anubis +++ b/view/types/hk_display.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_editor.anubis b/view/types/hk_editor.anubis index 82d5bea..f2a30d5 100644 --- a/view/types/hk_editor.anubis +++ b/view/types/hk_editor.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_editor_table.anubis b/view/types/hk_editor_table.anubis index 4219c4f..71ff321 100644 --- a/view/types/hk_editor_table.anubis +++ b/view/types/hk_editor_table.anubis @@ -1,8 +1,8 @@ -/* +/* * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ @@ -13,6 +13,20 @@ transmit tools/basis.anubis public type HK_Editor_Table_Line:... +public define Maybe(HK_Editor_Table_Line) + from_Message + ( + Message _hk_editor_table_line_message + ) +. + +public define Message + to_Message + ( + HK_Editor_Table_Line _hk_editor_table_line + ). + + public type HK_Editor_Table_Cell: empty, column( @@ -40,21 +54,9 @@ public type HK_Editor_Table: ) . -public define Maybe(HK_Editor_Table_Line) - from_Message - ( - Message _hk_editor_table_line_message - ) -. - HK_Editor_Table_Cell message format =================================== -public define Message - to_Message - ( - HK_Editor_Table_Line _hk_editor_table_line - ). public define Message to_Message diff --git a/view/types/hk_fk_view.anubis b/view/types/hk_fk_view.anubis index 8fa9ea0..d1c6c05 100644 --- a/view/types/hk_fk_view.anubis +++ b/view/types/hk_fk_view.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_form.anubis b/view/types/hk_form.anubis index e860f6f..452dbf4 100644 --- a/view/types/hk_form.anubis +++ b/view/types/hk_form.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_form_tab.anubis b/view/types/hk_form_tab.anubis index 2dae8dd..25258c2 100644 --- a/view/types/hk_form_tab.anubis +++ b/view/types/hk_form_tab.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ diff --git a/view/types/hk_form_table.anubis b/view/types/hk_form_table.anubis index 9b69ba4..0605fdb 100644 --- a/view/types/hk_form_table.anubis +++ b/view/types/hk_form_table.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ @@ -10,9 +10,47 @@ transmit system/muscle.anubis transmit system/convert.anubis transmit tools/basis.anubis -transmit hayamiki_lib/view/types/hk_form_table_line.anubis -transmit hayamiki_lib/view/types/hk_form_table_attribute.anubis +transmit hayamiki_lib/view/types/hk_form_entry.anubis +public type HK_Form_Table_Line:... + +public define Maybe(HK_Form_Table_Line) + from_Message + ( + Message _hk_form_table_line_message + ) +. + +public define Message + to_Message + ( + HK_Form_Table_Line _hk_form_table_line + ). + + +public type HK_Form_Table_Cell: + hk_form_table_cell( + HK_Form_Entry form_entry + ), + hk_form_table_cell_table( + List(HK_Form_Table_Line) form_lines + ) +. + + +public type HK_Form_Table_Line: + hk_form_table_line( + List(HK_Form_Table_Cell) form_table_cells + ) +. + + +public type HK_Form_Table_Attribute: + hidden( + String name, + String value + ) +. public type HK_Form_Table: @@ -21,3 +59,59 @@ public type HK_Form_Table: List(HK_Form_Table_Line) form_lines ) . + + + + + + HK_Form_Table_Attribute message format + ====================================== + + +public define Message + to_Message + ( + HK_Form_Table_Attribute _hk_form_table_attribute + )= + with _hk_form_table_attribute_message = message((Word32)0), // + forget(add_string(_hk_form_table_attribute_message, "__TYPE__", "HK_Form_Table_Attribute")); + if _hk_form_table_attribute is + { + //Alternative hidden + hidden(_name, _value) then + forget(add_string(_hk_form_table_attribute_message, "__TYPE_ALT__", "hidden")); + // [type = String] hidden.name + forget(add_string(_hk_form_table_attribute_message, "name", _name)); + // [type = String] hidden.value + forget(add_string(_hk_form_table_attribute_message, "value", _value)), + + }; + _hk_form_table_attribute_message +. + +public define Maybe(HK_Form_Table_Attribute) + from_Message + ( + Message _hk_form_table_attribute_message + )= + if find_string(_hk_form_table_attribute_message, "__TYPE__") is {failure then failure, success(__type__) then + if find_string(_hk_form_table_attribute_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then + if __type__ = "HK_Form_Table_Attribute" then + //Alternative hidden + if __type_alt__ = "hidden" then //Alternative hidden + // [type = String] hidden.name + if find_string(_hk_form_table_attribute_message, "name") is {failure then failure, success(_name_) then + // [type = String] hidden.value + if find_string(_hk_form_table_attribute_message, "value") is {failure then failure, success(_value_) then + + success(hidden(_name_, _value_)) + }} + else + failure //No valid Alternative found ! + else + failure //Type not found in message ! + }} +. + + + diff --git a/view/types/hk_form_table_attribute.anubis b/view/types/hk_form_table_attribute.anubis deleted file mode 100644 index d2c5700..0000000 --- a/view/types/hk_form_table_attribute.anubis +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Created by 伝作 (Densaku). - * Types & Messages generator written by フランスのトトロ aka (David RENÉ) - * Date: 2017-04-12 - * Time: 22:22:45 - * - */ - -transmit system/muscle.anubis -transmit system/convert.anubis -transmit tools/basis.anubis - - - - -public type HK_Form_Table_Attribute: - hidden( - String name, - String value - ) -. - - HK_Form_Table_Attribute message format - ====================================== - - -public define Message - to_Message - ( - HK_Form_Table_Attribute _hk_form_table_attribute - )= - with _hk_form_table_attribute_message = message((Word32)0), // - forget(add_string(_hk_form_table_attribute_message, "__TYPE__", "HK_Form_Table_Attribute")); - if _hk_form_table_attribute is - { - //Alternative hidden - hidden(_name, _value) then - forget(add_string(_hk_form_table_attribute_message, "__TYPE_ALT__", "hidden")); - // [type = String] hidden.name - forget(add_string(_hk_form_table_attribute_message, "name", _name)); - // [type = String] hidden.value - forget(add_string(_hk_form_table_attribute_message, "value", _value)), - - }; - _hk_form_table_attribute_message -. - -public define Maybe(HK_Form_Table_Attribute) - from_Message - ( - Message _hk_form_table_attribute_message - )= - if find_string(_hk_form_table_attribute_message, "__TYPE__") is {failure then failure, success(__type__) then - if find_string(_hk_form_table_attribute_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then - if __type__ = "HK_Form_Table_Attribute" then - //Alternative hidden - if __type_alt__ = "hidden" then //Alternative hidden - // [type = String] hidden.name - if find_string(_hk_form_table_attribute_message, "name") is {failure then failure, success(_name_) then - // [type = String] hidden.value - if find_string(_hk_form_table_attribute_message, "value") is {failure then failure, success(_value_) then - - success(hidden(_name_, _value_)) - }} - else - failure //No valid Alternative found ! - else - failure //Type not found in message ! - }} -. - diff --git a/view/types/hk_form_table_cell.anubis b/view/types/hk_form_table_cell.anubis deleted file mode 100644 index 1a0b5bf..0000000 --- a/view/types/hk_form_table_cell.anubis +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Created by 伝作 (Densaku). - * Types & Messages generator written by フランスのトトロ aka (David RENÉ) - * Date: 2017-04-12 - * Time: 22:22:45 - * - */ - -transmit system/muscle.anubis -transmit system/convert.anubis -transmit tools/basis.anubis - -transmit hayamiki_lib/view/types/hk_form_entry.anubis - - - -public type HK_Form_Table_Cell: - hk_form_table_cell( - HK_Form_Entry form_entry - ) -. diff --git a/view/types/hk_form_table_line.anubis b/view/types/hk_form_table_line.anubis deleted file mode 100644 index 296dfa1..0000000 --- a/view/types/hk_form_table_line.anubis +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Created by 伝作 (Densaku). - * Types & Messages generator written by フランスのトトロ aka (David RENÉ) - * Date: 2017-04-12 - * Time: 22:22:45 - * - */ - -transmit system/muscle.anubis -transmit system/convert.anubis -transmit tools/basis.anubis - -transmit hayamiki_lib/view/types/hk_form_table_cell.anubis - - - -public type HK_Form_Table_Line: - hk_form_table_line( - List(HK_Form_Table_Cell) form_table_cells - ) -. diff --git a/view/types/hk_viewer.anubis b/view/types/hk_viewer.anubis index 4956224..5f42055 100644 --- a/view/types/hk_viewer.anubis +++ b/view/types/hk_viewer.anubis @@ -2,7 +2,7 @@ * Created by 伝作 (Densaku). * Types & Messages generator written by フランスのトトロ aka (David RENÉ) * Date: 2017-04-12 - * Time: 22:22:45 + * Time: 23:52:21 * */ -- libgit2 0.21.4