we have built a (rough)
layer on top of EV to make it much easier to program visual applications.
This makes it possible to write code like the following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make (a_code_select_action_agent: like code_select_action_agent;
a_path_select_action_agent: detachable like path_select_action_agent)
do
create gui_controls.make (0)
code_select_action_agent := a_code_select_action_agent
path_select_action_agent := a_path_select_action_agent
-- create widgets
create ev_root_container
ev_root_container.set_data (Current)
-- ============ DEFINITION HBOX, with GRID & control panel =============
create ev_definition_hbox
ev_definition_hbox.set_padding (Default_padding_width)
ev_definition_hbox.set_border_width (Default_border_width)
ev_root_container.extend (ev_definition_hbox)
-- EV_GRID
create gui_definition_grid.make (True, False, True, True)
gui_definition_grid.set_tree_expand_collapse_icons
(get_icon_pixmap ("tool/tree_expand"), get_icon_pixmap
("tool/tree_collapse"))
ev_definition_hbox.extend (gui_definition_grid.ev_grid)
-- ========== view controls control panel ===========
create gui_definition_control_panel.make
ev_definition_hbox.extend (gui_definition_control_panel.ev_root_container)
ev_definition_hbox.disable_item_expand (gui_definition_control_panel.ev_root_container)
-- tree collapse/expand control
create gui_definition_treeview_control.make (create {EVX_TREE_CONTROL_GRID}.make (gui_definition_grid),
agent (a_row: EV_GRID_ROW): BOOLEAN do Result := not attached {BMM_MODEL_ELEMENT} a_row.data end)
gui_definition_control_panel.add_frame (gui_definition_treeview_control.ev_root_container, False)
-- ========= view detail level options =========
-- 'Detail level' frame
create view_detail_frame_ctl.make (get_text ("view_detail_controls_text"), 85, 100, False)
gui_definition_control_panel.add_frame_control (view_detail_frame_ctl, False)
-- view detail radio buttons
create view_detail_radio_ctl.make (get_text
("domain_detail_button_text"), get_text
("technical_detail_button_text"),
get_text ("domain_detail_button_tooltip"), get_text ("technical_detail_button_tooltip"),
agent :BOOLEAN do Result := not show_technical_view end,
agent update_show_technical_view, 0, 0)
view_detail_frame_ctl.extend (view_detail_radio_ctl.ev_root_container, False)
gui_controls.extend (view_detail_radio_ctl)
-- include codes checkbox
create add_codes_checkbox_ctl.make_active (get_text ("domain_view_add_codes_text"), Void,
agent :BOOLEAN do Result := show_codes end, agent update_show_codes)
view_detail_frame_ctl.extend (add_codes_checkbox_ctl.ev_data_control, False)
gui_controls.extend (add_codes_checkbox_ctl)
-- ========= RM view options =========
-- 'RM visibility' frame
create rm_property_visibility_frame_ctl.make (get_text ("rm_visibility_controls_text"), 85, 0, False)
gui_definition_control_panel.add_frame_control (rm_property_visibility_frame_ctl, False)
-- add RM data properties check button
create rm_attrs_visible_checkbox_ctl.make_active (get_text ("show_rm_properties_button_text"),
get_text ("show_rm_properties_tooltip"),
agent :BOOLEAN do Result := show_rm_data_properties end, agent update_show_rm_data_properties)
gui_controls.extend (rm_attrs_visible_checkbox_ctl)
rm_property_visibility_frame_ctl.extend (rm_attrs_visible_checkbox_ctl.ev_data_control, False)
-- add RM runtime properties option check button
create rm_runtime_attrs_visible_checkbox_ctl.make_active (get_text ("show_rm_runtime_properties_button_text"),
get_text ("show_rm_runtime_properties_tooltip"),
agent :BOOLEAN do Result := show_rm_runtime_properties end, agent update_show_rm_runtime_properties)
gui_controls.extend (rm_runtime_attrs_visible_checkbox_ctl)
rm_property_visibility_frame_ctl.extend (rm_runtime_attrs_visible_checkbox_ctl.ev_data_control, False)
-- add RM infrastructure properties option check button
create rm_if_attrs_visible_checkbox_ctl.make_active (get_text ("show_rm_if_properties_button_text"),
get_text ("show_rm_if_properties_tooltip"),
agent :BOOLEAN do Result :=
show_rm_infrastructure_properties end, agent
update_show_rm_infrastructure_properties)
gui_controls.extend (rm_if_attrs_visible_checkbox_ctl)
rm_property_visibility_frame_ctl.extend (rm_if_attrs_visible_checkbox_ctl.ev_data_control, False)
-- 'RM rendering' frame
create rm_rendering_frame_ctl.make (get_text ("rm_rendering_controls_text"), 85, 0, False)
gui_definition_control_panel.add_frame_control (rm_rendering_frame_ctl, False)
-- use RM inheritance rendering check button
create view_rm_display_inheritance_checkbox_ctl.make_active (get_text ("show_rm_inh_button_text"),
get_text ("show_rm_inh_button_tooltip"),
agent :BOOLEAN do Result := show_rm_inheritance end, agent update_show_rm_inheritance)
gui_controls.extend (view_rm_display_inheritance_checkbox_ctl)
rm_rendering_frame_ctl.extend (view_rm_display_inheritance_checkbox_ctl.ev_data_control, False)
-- ============ RULES HBOX, with GRID & control panel =============
create ev_rules_hbox
ev_rules_hbox.set_padding (Default_padding_width)
ev_rules_hbox.set_border_width (Default_border_width)
ev_root_container.extend (ev_rules_hbox)
-- EV_GRID
create gui_rules_grid.make (True, False, True, False)
gui_rules_grid.set_tree_expand_collapse_icons
(get_icon_pixmap ("tool/tree_expand"), get_icon_pixmap
("tool/tree_collapse"))
ev_rules_hbox.extend (gui_rules_grid.ev_grid)
-- ========== view controls control panel ===========
create gui_rules_control_panel.make
ev_rules_hbox.extend (gui_rules_control_panel.ev_root_container)
ev_rules_hbox.disable_item_expand (gui_rules_control_panel.ev_root_container)
-- tree collapse/expand control
create gui_rules_treeview_control.make (create {EVX_TREE_CONTROL_GRID}.make (gui_rules_grid),
agent (a_row: EV_GRID_ROW): BOOLEAN do Result := not attached {BMM_MODEL_ELEMENT} a_row.data end)
gui_rules_control_panel.add_frame (gui_rules_treeview_control.ev_root_container, False)
-- ==================== setup ============================
-- initial state
if not show_technical_view then
rm_attrs_visible_checkbox_ctl.disable_editable
end
end
~~~~~~~~~~~~~~~~~~~
this is about one quarter of the code needed using raw EV calls (for obvious reasons). The library is in an alpha state, and very rough - I have not even separated it into a demonstration application.
What I wonder is: is there any interest to do this, or are there already other efforts to do such things? From my point of view EV2 has massive functionality and great design, but low usability - so we need a layer (multiple layers probably) on top to make it easy to write visual logic. This includes update / display logic for data input, undo/redo chain and so on.
Is there any interest in us making this work more accessible and public? I don't want to waste time on that if noone is interested.
Alternatively, are there other such efforts hiding somewhere?
- thomas