Commit fed6db131cf6d306092a560ce5764ee87a6f4436
1 parent
aa1d8b53
add HK_Form_Table_Attribute to HK_Form_Table
Showing
30 changed files
with
108 additions
and
29 deletions
Show diff stats
ds_files/ds_types.anubis
| ... | ... | @@ -210,8 +210,16 @@ public define List(DS_Type) hayamiki_lib_types_description = |
| 210 | 210 | ]) |
| 211 | 211 | ]), |
| 212 | 212 | |
| 213 | + ds_type("HK_Form_Table_Attribute", [ | |
| 214 | + alternative("hidden", [ | |
| 215 | + component(string, "name"), | |
| 216 | + component(string, "value") | |
| 217 | + ]) | |
| 218 | + ]), | |
| 219 | + | |
| 213 | 220 | ds_type("HK_Form_Table", no_message, [ |
| 214 | 221 | alternative("hk_form_table", [ |
| 222 | + component(list, extern_type("HK_Form_Table_Attribute", view_types+"hk_form_table_attribute.anubis"), "table_attr"), | |
| 215 | 223 | component(list, extern_type("HK_Form_Table_Line", view_types+"hk_form_table_line.anubis"), "form_lines") |
| 216 | 224 | ]) |
| 217 | 225 | ]), | ... | ... |
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_help_text.anubis
model/types/hk_icon.anubis
model/types/hk_int_choice.anubis
model/types/hk_int_choices.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
view/types/hk_display.anubis
view/types/hk_edit_view.anubis
view/types/hk_edit_view_table.anubis
view/types/hk_edit_view_table_cell.anubis
view/types/hk_edit_view_table_line.anubis
view/types/hk_fk_view.anubis
view/types/hk_form.anubis
view/types/hk_form_tab.anubis
view/types/hk_form_table.anubis
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | * Created by 伝作 (Densaku). |
| 3 | 3 | * Types & Messages generator written by フランスのトトロ aka (David RENÉ) |
| 4 | 4 | * Date: 2017-04-09 |
| 5 | - * Time: 02:17:12 | |
| 5 | + * Time: 21:26:44 | |
| 6 | 6 | * |
| 7 | 7 | */ |
| 8 | 8 | |
| ... | ... | @@ -11,9 +11,11 @@ transmit system/convert.anubis |
| 11 | 11 | transmit tools/basis.anubis |
| 12 | 12 | |
| 13 | 13 | transmit hayamiki_lib/view/types/hk_form_table_line.anubis |
| 14 | +transmit hayamiki_lib/view/types/hk_form_table_attribute.anubis | |
| 14 | 15 | |
| 15 | 16 | public type HK_Form_Table: |
| 16 | 17 | hk_form_table( |
| 17 | - List(HK_Form_Table_Line) form_lines | |
| 18 | + List(HK_Form_Table_Attribute) table_attr, | |
| 19 | + List(HK_Form_Table_Line) form_lines | |
| 18 | 20 | ) |
| 19 | 21 | . | ... | ... |
| 1 | +/* | |
| 2 | + * Created by 伝作 (Densaku). | |
| 3 | + * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 2017-04-09 | |
| 5 | + * Time: 21:26:44 | |
| 6 | + * | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit system/muscle.anubis | |
| 10 | +transmit system/convert.anubis | |
| 11 | +transmit tools/basis.anubis | |
| 12 | + | |
| 13 | + | |
| 14 | +public type HK_Form_Table_Attribute: | |
| 15 | + hidden( | |
| 16 | + String name, | |
| 17 | + String value | |
| 18 | + ) | |
| 19 | +. | |
| 20 | + | |
| 21 | + HK_Form_Table_Attribute message format | |
| 22 | + ====================================== | |
| 23 | + | |
| 24 | + | |
| 25 | +public define Message | |
| 26 | + to_Message | |
| 27 | + ( | |
| 28 | + HK_Form_Table_Attribute _hk_form_table_attribute | |
| 29 | + )= | |
| 30 | + with _hk_form_table_attribute_message = message((Word32)0), // | |
| 31 | + forget(add_string(_hk_form_table_attribute_message, "__TYPE__", "HK_Form_Table_Attribute")); | |
| 32 | + if _hk_form_table_attribute is | |
| 33 | + { | |
| 34 | + //Alternative hidden | |
| 35 | + hidden(_name, _value) then | |
| 36 | + forget(add_string(_hk_form_table_attribute_message, "__TYPE_ALT__", "hidden")); | |
| 37 | + // [type = String] hidden.name | |
| 38 | + forget(add_string(_hk_form_table_attribute_message, "name", _name)); | |
| 39 | + // [type = String] hidden.value | |
| 40 | + forget(add_string(_hk_form_table_attribute_message, "value", _value)), | |
| 41 | + | |
| 42 | + }; | |
| 43 | + _hk_form_table_attribute_message | |
| 44 | +. | |
| 45 | + | |
| 46 | +public define Maybe(HK_Form_Table_Attribute) | |
| 47 | + from_Message | |
| 48 | + ( | |
| 49 | + Message _hk_form_table_attribute_message | |
| 50 | + )= | |
| 51 | + if find_string(_hk_form_table_attribute_message, "__TYPE__") is {failure then failure, success(__type__) then | |
| 52 | + if find_string(_hk_form_table_attribute_message, "__TYPE_ALT__") is {failure then failure, success(__type_alt__) then | |
| 53 | + if __type__ = "HK_Form_Table_Attribute" then | |
| 54 | + //Alternative hidden | |
| 55 | + if __type_alt__ = "hidden" then //Alternative hidden | |
| 56 | + // [type = String] hidden.name | |
| 57 | + if find_string(_hk_form_table_attribute_message, "name") is {failure then failure, success(_name_) then | |
| 58 | + // [type = String] hidden.value | |
| 59 | + if find_string(_hk_form_table_attribute_message, "value") is {failure then failure, success(_value_) then | |
| 60 | + | |
| 61 | + success(hidden(_name_, _value_)) | |
| 62 | + }} | |
| 63 | + else | |
| 64 | + failure //No valid Alternative found ! | |
| 65 | + else | |
| 66 | + failure //Type not found in message ! | |
| 67 | + }} | |
| 68 | +. | |
| 69 | + | ... | ... |
view/types/hk_form_table_cell.anubis
view/types/hk_form_table_line.anubis