vedeu 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/borders.md +1 -5
- data/docs/cursors.md +23 -92
- data/docs/events/application.md +1 -8
- data/docs/events/by_name/cleanup.md +7 -0
- data/docs/events/by_name/clear.md +2 -0
- data/docs/events/by_name/clear_group.md +6 -0
- data/docs/events/by_name/clear_view.md +5 -0
- data/docs/events/by_name/clear_view_content.md +5 -0
- data/docs/events/by_name/command.md +19 -0
- data/docs/events/by_name/cursor_bottom.md +7 -0
- data/docs/events/by_name/cursor_down.md +4 -0
- data/docs/events/by_name/cursor_left.md +6 -0
- data/docs/events/by_name/cursor_origin.md +6 -0
- data/docs/events/by_name/cursor_position.md +10 -0
- data/docs/events/by_name/cursor_reposition.md +4 -0
- data/docs/events/by_name/cursor_right.md +4 -0
- data/docs/events/by_name/cursor_top.md +7 -0
- data/docs/events/by_name/cursor_up.md +6 -0
- data/docs/events/by_name/drb_input.md +7 -0
- data/docs/events/by_name/drb_restart.md +5 -0
- data/docs/events/by_name/drb_retrieve_output.md +2 -0
- data/docs/events/by_name/drb_start.md +5 -0
- data/docs/events/by_name/drb_status.md +5 -0
- data/docs/events/by_name/drb_stop.md +5 -0
- data/docs/events/by_name/drb_store_output.md +2 -0
- data/docs/events/by_name/editor.md +9 -0
- data/docs/events/by_name/editor_delete_character.md +5 -0
- data/docs/events/by_name/editor_delete_line.md +5 -0
- data/docs/events/by_name/editor_down.md +5 -0
- data/docs/events/by_name/editor_execute.md +3 -0
- data/docs/events/by_name/editor_insert_character.md +7 -0
- data/docs/events/by_name/editor_insert_line.md +5 -0
- data/docs/events/by_name/editor_left.md +5 -0
- data/docs/events/by_name/editor_right.md +5 -0
- data/docs/events/by_name/editor_up.md +5 -0
- data/docs/events/by_name/exit.md +6 -0
- data/docs/events/by_name/focus_by_name.md +6 -0
- data/docs/events/by_name/focus_next.md +6 -0
- data/docs/events/by_name/focus_prev.md +6 -0
- data/docs/events/by_name/goto.md +8 -0
- data/docs/events/by_name/hide_cursor.md +10 -0
- data/docs/events/by_name/hide_group.md +5 -0
- data/docs/events/by_name/hide_interface.md +5 -0
- data/docs/events/by_name/initialize.md +6 -0
- data/docs/events/by_name/keypress.md +40 -0
- data/docs/events/by_name/log.md +7 -0
- data/docs/events/by_name/maximise.md +6 -0
- data/docs/events/by_name/menu_bottom.md +4 -0
- data/docs/events/by_name/menu_current.md +4 -0
- data/docs/events/by_name/menu_deselect.md +4 -0
- data/docs/events/by_name/menu_items.md +5 -0
- data/docs/events/by_name/menu_next.md +5 -0
- data/docs/events/by_name/menu_prev.md +5 -0
- data/docs/events/by_name/menu_select.md +4 -0
- data/docs/events/by_name/menu_selected.md +4 -0
- data/docs/events/by_name/menu_top.md +4 -0
- data/docs/events/by_name/menu_view.md +5 -0
- data/docs/events/by_name/mode_switch.md +7 -0
- data/docs/events/by_name/movement_refresh.md +19 -0
- data/docs/events/by_name/refresh.md +9 -0
- data/docs/events/by_name/refresh_border.md +5 -0
- data/docs/events/by_name/refresh_cursor.md +5 -0
- data/docs/events/by_name/refresh_group.md +4 -0
- data/docs/events/by_name/refresh_view.md +4 -0
- data/docs/events/by_name/refresh_view_content.md +4 -0
- data/docs/events/by_name/resize.md +5 -0
- data/docs/events/by_name/show_cursor.md +10 -0
- data/docs/events/by_name/show_group.md +5 -0
- data/docs/events/by_name/show_interface.md +5 -0
- data/docs/events/by_name/toggle_cursor.md +9 -0
- data/docs/events/by_name/toggle_group.md +5 -0
- data/docs/events/by_name/toggle_interface.md +5 -0
- data/docs/events/by_name/unmaximise.md +6 -0
- data/docs/events/document.md +9 -45
- data/docs/events/drb.md +7 -31
- data/docs/events/focus.md +3 -18
- data/docs/events/menu.md +10 -44
- data/docs/events/refresh.md +6 -25
- data/docs/events/system.md +8 -101
- data/docs/events/view.md +4 -36
- data/docs/events/visibility.md +10 -48
- data/lib/vedeu/borders/border.rb +117 -37
- data/lib/vedeu/borders/refresh.rb +29 -113
- data/lib/vedeu/borders/repository.rb +0 -5
- data/lib/vedeu/buffers/buffer.rb +13 -17
- data/lib/vedeu/buffers/refresh.rb +4 -4
- data/lib/vedeu/cursors/refresh.rb +2 -7
- data/lib/vedeu/groups/clear.rb +3 -1
- data/lib/vedeu/groups/refresh.rb +2 -2
- data/lib/vedeu/interfaces/clear.rb +2 -2
- data/lib/vedeu/output/refresh.rb +2 -2
- data/lib/vedeu/repositories/model.rb +2 -6
- data/lib/vedeu/repositories/repository.rb +17 -6
- data/lib/vedeu/runtime/flags.rb +2 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/borders/border_test.rb +128 -12
- data/test/lib/vedeu/cursors/dsl_test.rb +13 -0
- metadata +72 -2
data/docs/events/focus.md
CHANGED
@@ -4,23 +4,8 @@
|
|
4
4
|
|
5
5
|
Note: 'name' is a Symbol unless mentioned otherwise.
|
6
6
|
|
7
|
-
|
8
|
-
When triggered with an interface name will focus that interface and
|
9
|
-
restore the cursor position and visibility.
|
7
|
+
{include:file:docs/events/by_name/focus_by_name.md}
|
10
8
|
|
11
|
-
|
12
|
-
Vedeu.focus_by_name(name)
|
9
|
+
{include:file:docs/events/by_name/focus_next.md}
|
13
10
|
|
14
|
-
|
15
|
-
When triggered will focus the next visible interface and restore the
|
16
|
-
cursor position and visibility.
|
17
|
-
|
18
|
-
Vedeu.trigger(:_focus_next_) # or
|
19
|
-
Vedeu.focus_next
|
20
|
-
|
21
|
-
### `:_focus_prev_`
|
22
|
-
When triggered will focus the previous visible interface and restore
|
23
|
-
the cursor position and visibility.
|
24
|
-
|
25
|
-
Vedeu.trigger(:_focus_prev_) # or
|
26
|
-
Vedeu.focus_previous
|
11
|
+
{include:file:docs/events/by_name/focus_prev.md}
|
data/docs/events/menu.md
CHANGED
@@ -4,56 +4,22 @@
|
|
4
4
|
|
5
5
|
Note: 'name' is a Symbol unless mentioned otherwise.
|
6
6
|
|
7
|
-
|
8
|
-
Makes the last menu item the current menu item.
|
7
|
+
{include:file:docs/events/by_name/menu_bottom.md}
|
9
8
|
|
10
|
-
|
9
|
+
{include:file:docs/events/by_name/menu_current.md}
|
11
10
|
|
12
|
-
|
13
|
-
Returns the current menu item.
|
11
|
+
{include:file:docs/events/by_name/menu_deselect.md}
|
14
12
|
|
15
|
-
|
13
|
+
{include:file:docs/events/by_name/menu_items.md}
|
16
14
|
|
17
|
-
|
18
|
-
Deselects all menu items.
|
15
|
+
{include:file:docs/events/by_name/menu_next.md}
|
19
16
|
|
20
|
-
|
17
|
+
{include:file:docs/events/by_name/menu_prev.md}
|
21
18
|
|
22
|
-
|
23
|
-
Returns all the menu items with respective `current` or `selected`
|
24
|
-
boolean indicators.
|
19
|
+
{include:file:docs/events/by_name/menu_selected.md}
|
25
20
|
|
26
|
-
|
21
|
+
{include:file:docs/events/by_name/menu_select.md}
|
27
22
|
|
28
|
-
|
29
|
-
Makes the next menu item the current menu item, until it reaches the
|
30
|
-
last item.
|
23
|
+
{include:file:docs/events/by_name/menu_top.md}
|
31
24
|
|
32
|
-
|
33
|
-
|
34
|
-
### `:_menu_prev_`
|
35
|
-
Makes the previous menu item the current menu item, until it reaches
|
36
|
-
the first item.
|
37
|
-
|
38
|
-
Vedeu.trigger(:_menu_prev_, name)
|
39
|
-
|
40
|
-
### `:_menu_selected_`
|
41
|
-
Returns the selected menu item.
|
42
|
-
|
43
|
-
Vedeu.trigger(:_menu_selected_, name)
|
44
|
-
|
45
|
-
### `:_menu_select_`
|
46
|
-
Makes the current menu item also the selected menu item.
|
47
|
-
|
48
|
-
Vedeu.trigger(:_menu_select_, name)
|
49
|
-
|
50
|
-
### `:_menu_top_`
|
51
|
-
Makes the first menu item the current menu item.
|
52
|
-
|
53
|
-
Vedeu.trigger(:_menu_top_, name)
|
54
|
-
|
55
|
-
### `:_menu_view_`
|
56
|
-
Returns a subset of the menu items; starting at the current item to
|
57
|
-
the last item.
|
58
|
-
|
59
|
-
Vedeu.trigger(:_menu_view_, name)
|
25
|
+
{include:file:docs/events/by_name/menu_view.md}
|
data/docs/events/refresh.md
CHANGED
@@ -4,33 +4,14 @@
|
|
4
4
|
|
5
5
|
Note: 'name' is a Symbol unless mentioned otherwise.
|
6
6
|
|
7
|
-
|
8
|
-
Refreshes all registered interfaces.
|
7
|
+
{include:file:docs/events/by_name/refresh.md}
|
9
8
|
|
10
|
-
|
11
|
-
interfaces with a lower z-index will be drawn first. This means
|
12
|
-
overlapping interfaces will be drawn as specified. Hidden interfaces
|
13
|
-
will be still refreshed in memory but not shown.
|
9
|
+
{include:file:docs/events/by_name/refresh_border.md}
|
14
10
|
|
15
|
-
|
11
|
+
{include:file:docs/events/by_name/refresh_cursor.md}
|
16
12
|
|
17
|
-
|
18
|
-
Will cause the named cursor to refresh, or the cursor of the interface
|
19
|
-
which is currently in focus.
|
13
|
+
{include:file:docs/events/by_name/refresh_group.md}
|
20
14
|
|
21
|
-
|
15
|
+
{include:file:docs/events/by_name/refresh_view.md}
|
22
16
|
|
23
|
-
|
24
|
-
Will cause all interfaces in the named group to refresh.
|
25
|
-
|
26
|
-
Vedeu.trigger(:_refresh_group_, name)
|
27
|
-
|
28
|
-
### `:_refresh_view_`
|
29
|
-
Will cause the named view to refresh.
|
30
|
-
|
31
|
-
Vedeu.trigger(:_refresh_view_, name)
|
32
|
-
|
33
|
-
### `:_refresh_view_content_`
|
34
|
-
Will cause only the content of the named view to refresh.
|
35
|
-
|
36
|
-
Vedeu.trigger(:_refresh_view_content_, name)
|
17
|
+
{include:file:docs/events/by_name/refresh_view_content.md}
|
data/docs/events/system.md
CHANGED
@@ -2,111 +2,18 @@
|
|
2
2
|
|
3
3
|
## System Events
|
4
4
|
|
5
|
-
|
6
|
-
Vedeu triggers this event when `:_exit_` is triggered. You can hook
|
7
|
-
into this to perform a special action before the application
|
8
|
-
terminates. Saving the user's work, session or preferences might be
|
9
|
-
popular here.
|
5
|
+
{include:file:docs/events/by_name/cleanup.md}
|
10
6
|
|
11
|
-
|
7
|
+
{include:file:docs/events/by_name/command.md}
|
12
8
|
|
13
|
-
|
14
|
-
This event is used by Vedeu internally, though you can bind to it if
|
15
|
-
you wish. It is preferred for you to bind to `:command` though.
|
9
|
+
{include:file:docs/events/by_name/editor.md}
|
16
10
|
|
17
|
-
|
18
|
-
define to 'do things'.
|
11
|
+
{include:file:docs/events/by_name/exit.md}
|
19
12
|
|
20
|
-
|
13
|
+
{include:file:docs/events/by_name/initialize.md}
|
21
14
|
|
22
|
-
|
23
|
-
# ... your code here ...
|
24
|
-
end
|
15
|
+
{include:file:docs/events/by_name/keypress.md}
|
25
16
|
|
26
|
-
|
27
|
-
API methods: (See {Vedeu::Input::Store} for more details).
|
17
|
+
{include:file:docs/events/by_name/log.md}
|
28
18
|
|
29
|
-
|
30
|
-
|
31
|
-
Vedeu.last_command
|
32
|
-
|
33
|
-
### `:_editor_`
|
34
|
-
This event is called by {Vedeu::Input::Capture#read}. When
|
35
|
-
invoked, the key will be passed to the editor for currently
|
36
|
-
focussed view.
|
37
|
-
|
38
|
-
Note: 'key' is a String for alphanumeric keys and special keys are
|
39
|
-
represented by Symbols.
|
40
|
-
|
41
|
-
Vedeu.trigger(:_editor_, key)
|
42
|
-
|
43
|
-
### `:_exit_`
|
44
|
-
When triggered, Vedeu will trigger a `:cleanup` event which you can
|
45
|
-
define (to save files, etc) and attempt to exit.
|
46
|
-
|
47
|
-
Vedeu.trigger(:_exit_)
|
48
|
-
Vedeu.exit
|
49
|
-
|
50
|
-
### `:_initialize_`
|
51
|
-
Vedeu triggers this event when it is ready to enter the main loop.
|
52
|
-
Client applications can listen for this event and perform some
|
53
|
-
action(s), like render the first screen, interface or make a sound.
|
54
|
-
|
55
|
-
Vedeu.trigger(:_initialize_)
|
56
|
-
|
57
|
-
### `:_keypress_`
|
58
|
-
This event is used by Vedeu internally, though you can bind to it if
|
59
|
-
you wish. It is preferred for you to bind to `:key` though.
|
60
|
-
|
61
|
-
When the name is given:
|
62
|
-
|
63
|
-
- The given key is passed to the named keymap. If the keymap is
|
64
|
-
registered, and the key has an associated action assigned, then
|
65
|
-
the action will be called/triggered.
|
66
|
-
- If the keymap is not registered, the key will be passed to the
|
67
|
-
global keymap to be actioned, or ignored if the global keymap does
|
68
|
-
not have an action assigned for the key pressed.
|
69
|
-
|
70
|
-
When the name is not given:
|
71
|
-
|
72
|
-
- The given key is passed to the named keymap associated with the
|
73
|
-
interface/view currently in focus. If the key has an associated
|
74
|
-
action assigned, then the action will be called or triggered,
|
75
|
-
otherwise, the key is (as above) passed to the global keymap to be
|
76
|
-
processed.
|
77
|
-
|
78
|
-
It is also to be noted, that a `:key` event will be triggered
|
79
|
-
irrespective of the conditions above, you can bind to this event
|
80
|
-
separately to 'do things'.
|
81
|
-
|
82
|
-
Vedeu.bind(:key) do
|
83
|
-
# ... your code here ...
|
84
|
-
end
|
85
|
-
|
86
|
-
Alternatively, you can access keypresses entered using the following
|
87
|
-
API methods: (See {Vedeu::Input::Store} for more details).
|
88
|
-
|
89
|
-
Vedeu.all_keypresses
|
90
|
-
|
91
|
-
Vedeu.last_keypress
|
92
|
-
|
93
|
-
A list of supported keypresses can be found here:
|
94
|
-
{Vedeu::Input::Capture}.
|
95
|
-
|
96
|
-
Vedeu.trigger(:_keypress_, key, optional_name)
|
97
|
-
|
98
|
-
### `:_log_`
|
99
|
-
When triggered with a message will cause Vedeu to log the message if
|
100
|
-
logging is enabled in the configuration.
|
101
|
-
|
102
|
-
Note: 'message' is a String.
|
103
|
-
|
104
|
-
Vedeu.trigger(:_log_, message)
|
105
|
-
|
106
|
-
### `:_mode_switch_`
|
107
|
-
When triggered, Vedeu switches between modes of the terminal. The idea
|
108
|
-
here being that the raw mode is for single keypress actions, whilst
|
109
|
-
fake and cooked modes allow the user to enter more elaborate commands-
|
110
|
-
such as commands with arguments.
|
111
|
-
|
112
|
-
Vedeu.trigger(:_mode_switch_, mode)
|
19
|
+
{include:file:docs/events/by_name/mode_switch.md}
|
data/docs/events/view.md
CHANGED
@@ -4,42 +4,10 @@
|
|
4
4
|
|
5
5
|
Note: 'name' is a Symbol unless mentioned otherwise.
|
6
6
|
|
7
|
-
|
8
|
-
Maximising an interface.
|
7
|
+
{include:file:docs/events/by_name/maximise.md}
|
9
8
|
|
10
|
-
|
9
|
+
{include:file:docs/events/by_name/movement_refresh.md}
|
11
10
|
|
12
|
-
|
11
|
+
{include:file:docs/events/by_name/resize.md}
|
13
12
|
|
14
|
-
|
15
|
-
When triggered, triggers additional events which aid the updating of
|
16
|
-
the output. Used when moving an interface/view.
|
17
|
-
|
18
|
-
Vedeu.trigger(:_movement_refresh_, name)
|
19
|
-
|
20
|
-
At this time, triggering this event will:
|
21
|
-
|
22
|
-
- Clear the entire terminal (assuming at least one renderer is the
|
23
|
-
default (Vedeu::Renderer::Terminal)). This action is performed when
|
24
|
-
moving an interface/view so that there are no 'artefacts' left
|
25
|
-
behind.
|
26
|
-
- Refresh the entire terminal (as above). This means all visible
|
27
|
-
interfaces are re-rendered. This action is performed to ensure other
|
28
|
-
views currently visible are rendered in their current position.
|
29
|
-
- Clears the named view. This action removes the named view from the
|
30
|
-
terminal (or output).
|
31
|
-
- Refreshes the named view. This action adds the named view to the
|
32
|
-
terminal (or output); in the new position.
|
33
|
-
|
34
|
-
### `:_resize_`
|
35
|
-
When triggered will cause Vedeu to trigger the `:_clear_` and
|
36
|
-
`:_refresh_` events. Please see those events for their behaviour.
|
37
|
-
|
38
|
-
Vedeu.trigger(:_resize_)
|
39
|
-
|
40
|
-
### `:_unmaximise_`
|
41
|
-
Unmaximising an interface.
|
42
|
-
|
43
|
-
Vedeu.trigger(:_unmaximise_, name)
|
44
|
-
|
45
|
-
See {Vedeu::Geometries::Geometry#unmaximise}
|
13
|
+
{include:file:docs/events/by_name/unmaximise.md}
|
data/docs/events/visibility.md
CHANGED
@@ -4,60 +4,22 @@
|
|
4
4
|
|
5
5
|
Note: 'name' is a Symbol unless mentioned otherwise.
|
6
6
|
|
7
|
-
|
8
|
-
See {Vedeu::Buffers::Terminal#clear}
|
7
|
+
{include:file:docs/events/by_name/clear.md}
|
9
8
|
|
10
|
-
|
11
|
-
Clears the spaces occupied by the interfaces belonging to the named
|
12
|
-
group.
|
9
|
+
{include:file:docs/events/by_name/clear_group.md}
|
13
10
|
|
14
|
-
|
15
|
-
Vedeu.clear_by_group(name)
|
11
|
+
{include:file:docs/events/by_name/clear_view.md}
|
16
12
|
|
17
|
-
|
18
|
-
Clears the named view/interface area.
|
13
|
+
{include:file:docs/events/by_name/clear_view_content.md}
|
19
14
|
|
20
|
-
|
21
|
-
Vedeu.clear_by_name(name)
|
15
|
+
{include:file:docs/events/by_name/hide_group.md}
|
22
16
|
|
23
|
-
|
24
|
-
Clears only the content of the named view/interface area.
|
17
|
+
{include:file:docs/events/by_name/hide_interface.md}
|
25
18
|
|
26
|
-
|
27
|
-
Vedeu.clear_content_by_name(name)
|
19
|
+
{include:file:docs/events/by_name/show_group.md}
|
28
20
|
|
29
|
-
|
30
|
-
Hiding a group of interfaces.
|
21
|
+
{include:file:docs/events/by_name/show_interface.md}
|
31
22
|
|
32
|
-
|
33
|
-
Vedeu.hide_group(name)
|
23
|
+
{include:file:docs/events/by_name/toggle_group.md}
|
34
24
|
|
35
|
-
|
36
|
-
Hide an interface by name.
|
37
|
-
|
38
|
-
Vedeu.trigger(:_hide_interface_, name)
|
39
|
-
Vedeu.hide_interface(name)
|
40
|
-
|
41
|
-
### `:_show_group_`
|
42
|
-
Showing a group of interfaces.
|
43
|
-
|
44
|
-
Vedeu.trigger(:_show_group_, name)
|
45
|
-
Vedeu.show_group(name)
|
46
|
-
|
47
|
-
### `:_show_interface_`
|
48
|
-
Show an interface by name.
|
49
|
-
|
50
|
-
Vedeu.trigger(:_show_interface_, name)
|
51
|
-
Vedeu.show_interface(name)
|
52
|
-
|
53
|
-
### `:_toggle_group_`
|
54
|
-
Toggling a group of interfaces.
|
55
|
-
|
56
|
-
Vedeu.trigger(:_toggle_group_, name)
|
57
|
-
Vedeu.toggle_group(name)
|
58
|
-
|
59
|
-
### `:_toggle_interface_`
|
60
|
-
Toggling an interface.
|
61
|
-
|
62
|
-
Vedeu.trigger(:_toggle_interface_, name)
|
63
|
-
Vedeu.toggle_interface(name)
|
25
|
+
{include:file:docs/events/by_name/toggle_interface.md}
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -21,20 +21,20 @@ module Vedeu
|
|
21
21
|
include Vedeu::Repositories::Model
|
22
22
|
include Vedeu::Presentation
|
23
23
|
|
24
|
-
# @!attribute [
|
24
|
+
# @!attribute [w] bottom_left
|
25
25
|
# @return [String] The character to be used for the bottom left
|
26
26
|
# border if enabled.
|
27
|
-
|
27
|
+
attr_writer :bottom_left
|
28
28
|
|
29
|
-
# @!attribute [
|
29
|
+
# @!attribute [w] bottom_right
|
30
30
|
# @return [String] The character to be used for the bottom right
|
31
31
|
# border if enabled.
|
32
|
-
|
32
|
+
attr_writer :bottom_right
|
33
33
|
|
34
|
-
# @!attribute [
|
34
|
+
# @!attribute [w] bottom_horizontal
|
35
35
|
# @return [String] The character to be used for the bottom
|
36
36
|
# horizontal border if enabled.
|
37
|
-
|
37
|
+
attr_writer :bottom_horizontal
|
38
38
|
|
39
39
|
# @!attribute [rw] caption
|
40
40
|
# @return [String] An optional caption for when the bottom
|
@@ -75,35 +75,35 @@ module Vedeu
|
|
75
75
|
# to be shown.
|
76
76
|
attr_accessor :title
|
77
77
|
|
78
|
-
# @!attribute [
|
78
|
+
# @!attribute [w] top_left
|
79
79
|
# @return [String] The character to be used for the top left
|
80
80
|
# border if enabled.
|
81
|
-
|
81
|
+
attr_writer :top_left
|
82
82
|
|
83
|
-
# @!attribute [
|
83
|
+
# @!attribute [w] top_right
|
84
84
|
# @return [String] The character to be used for the top right
|
85
85
|
# border if enabled.
|
86
|
-
|
86
|
+
attr_writer :top_right
|
87
87
|
|
88
|
-
# @!attribute [
|
88
|
+
# @!attribute [w] top_horizontal
|
89
89
|
# @return [String] The character to be used for the top
|
90
90
|
# horizontal border if enabled.
|
91
|
-
|
91
|
+
attr_writer :top_horizontal
|
92
92
|
|
93
93
|
# @!attribute [rw] vertical
|
94
94
|
# @return [String] The character to be used for the vertical
|
95
95
|
# side border.
|
96
96
|
attr_accessor :vertical
|
97
97
|
|
98
|
-
# @!attribute [
|
98
|
+
# @!attribute [w] left_vertical
|
99
99
|
# @return [String] The character to be used for the left
|
100
100
|
# vertical side border.
|
101
|
-
|
101
|
+
attr_writer :left_vertical
|
102
102
|
|
103
|
-
# @!attribute [
|
103
|
+
# @!attribute [w] right_vertical
|
104
104
|
# @return [String] The character to be used for the right
|
105
105
|
# vertical side border.
|
106
|
-
|
106
|
+
attr_writer :right_vertical
|
107
107
|
|
108
108
|
# @!attribute [r] name
|
109
109
|
# @return [String|Symbol] Associates the border with the
|
@@ -115,7 +115,7 @@ module Vedeu
|
|
115
115
|
# view associated with this border.
|
116
116
|
attr_reader :parent
|
117
117
|
|
118
|
-
# @!attribute [
|
118
|
+
# @!attribute [rw] enabled
|
119
119
|
# @return [Boolean] Determines whether this border should be
|
120
120
|
# rendered.
|
121
121
|
attr_accessor :enabled
|
@@ -126,17 +126,21 @@ module Vedeu
|
|
126
126
|
# @param attributes [Hash<Symbol => Boolean|Hash|NilClass|
|
127
127
|
# String|Symbol|Vedeu::Borders::Repository|
|
128
128
|
# Vedeu::Presentation::Style>]
|
129
|
-
# @option attributes bottom_left [String]
|
130
|
-
# character.
|
131
|
-
# @option attributes bottom_right [String]
|
132
|
-
# border character.
|
129
|
+
# @option attributes bottom_left [String]
|
130
|
+
# The bottom left border character.
|
131
|
+
# @option attributes bottom_right [String]
|
132
|
+
# The bottom right border character.
|
133
133
|
# @option attributes colour [Hash]
|
134
134
|
# @option attributes enabled [Boolean] Indicate whether the
|
135
135
|
# border is to be shown for this interface.
|
136
|
-
# @option attributes horizontal [String]
|
137
|
-
# character.
|
136
|
+
# @option attributes horizontal [String]
|
137
|
+
# The horizontal border character.
|
138
|
+
# @option attributes left_vertical [String]
|
139
|
+
# The left vertical border character.
|
138
140
|
# @option attributes name [String|Symbol] The name of the
|
139
141
|
# interface to which this border relates.
|
142
|
+
# @option attributes right_vertical [String]
|
143
|
+
# The right vertical border character.
|
140
144
|
# @option attributes style [Vedeu::Presentation::Style]
|
141
145
|
# @option attributes show_bottom [Boolean] Indicate whether the
|
142
146
|
# bottom border is to be shown.
|
@@ -150,12 +154,14 @@ module Vedeu
|
|
150
154
|
# the top border is to be shown.
|
151
155
|
# @option attributes caption [String] An optional caption for
|
152
156
|
# when the bottom border is to be shown.
|
153
|
-
# @option attributes
|
154
|
-
# character.
|
155
|
-
# @option attributes
|
156
|
-
# character.
|
157
|
-
# @option attributes
|
158
|
-
# character.
|
157
|
+
# @option attributes top_horizontal [String]
|
158
|
+
# The top horizontal border character.
|
159
|
+
# @option attributes top_left [String]
|
160
|
+
# The top left border character.
|
161
|
+
# @option attributes top_right [String]
|
162
|
+
# The top right border character.
|
163
|
+
# @option attributes vertical [String]
|
164
|
+
# The vertical border character.
|
159
165
|
# @return [Vedeu::Borders::Border]
|
160
166
|
def initialize(attributes = {})
|
161
167
|
defaults.merge!(attributes).each do |key, value|
|
@@ -167,28 +173,28 @@ module Vedeu
|
|
167
173
|
# Vedeu::Borders::Repository|Vedeu::Presentation::Style>]
|
168
174
|
def attributes
|
169
175
|
{
|
170
|
-
bottom_horizontal:
|
171
|
-
bottom_left:
|
172
|
-
bottom_right:
|
176
|
+
bottom_horizontal: bottom_horizontal,
|
177
|
+
bottom_left: bottom_left,
|
178
|
+
bottom_right: bottom_right,
|
173
179
|
caption: @caption,
|
174
180
|
client: @client,
|
175
181
|
colour: @colour,
|
176
182
|
enabled: @enabled,
|
177
183
|
horizontal: @horizontal,
|
178
|
-
left_vertical:
|
184
|
+
left_vertical: left_vertical,
|
179
185
|
name: @name,
|
180
186
|
parent: @parent,
|
181
187
|
repository: @repository,
|
182
|
-
right_vertical:
|
188
|
+
right_vertical: right_vertical,
|
183
189
|
show_bottom: @show_bottom,
|
184
190
|
show_left: @show_left,
|
185
191
|
show_right: @show_right,
|
186
192
|
show_top: @show_top,
|
187
193
|
style: @style,
|
188
194
|
title: @title,
|
189
|
-
top_horizontal:
|
190
|
-
top_left:
|
191
|
-
top_right:
|
195
|
+
top_horizontal: top_horizontal,
|
196
|
+
top_left: top_left,
|
197
|
+
top_right: top_right,
|
192
198
|
vertical: @vertical,
|
193
199
|
}
|
194
200
|
end
|
@@ -205,8 +211,82 @@ module Vedeu
|
|
205
211
|
Vedeu::Borders::DSL.new(self, client)
|
206
212
|
end
|
207
213
|
|
214
|
+
# Return the client application configured left vertical cell
|
215
|
+
# character, or the default if not set.
|
216
|
+
#
|
217
|
+
# @return [Vedeu::Cells::LeftVertical]
|
218
|
+
def left_vertical
|
219
|
+
@left_vertical ||= Vedeu::Cells::LeftVertical.new(cell_attributes)
|
220
|
+
end
|
221
|
+
|
222
|
+
# Return the client application configured right vertical cell
|
223
|
+
# character, or the default if not set.
|
224
|
+
#
|
225
|
+
# @return [Vedeu::Cells::RightVertical]
|
226
|
+
def right_vertical
|
227
|
+
@right_vertical ||= Vedeu::Cells::RightVertical.new(cell_attributes)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Return the client application configured top horizontal cell
|
231
|
+
# character, or the default if not set.
|
232
|
+
#
|
233
|
+
# @return [Vedeu::Cells::TopHorizontal]
|
234
|
+
def top_horizontal
|
235
|
+
@top_horizontal ||= Vedeu::Cells::TopHorizontal.new(cell_attributes)
|
236
|
+
end
|
237
|
+
|
238
|
+
# Return the client application configured top left cell
|
239
|
+
# character, or the default if not set.
|
240
|
+
#
|
241
|
+
# @return [Vedeu::Cells::TopLeft]
|
242
|
+
def top_left
|
243
|
+
@top_left ||= Vedeu::Cells::TopLeft.new(cell_attributes)
|
244
|
+
end
|
245
|
+
|
246
|
+
# Return the client application configured top right cell
|
247
|
+
# character, or the default if not set.
|
248
|
+
#
|
249
|
+
# @return [Vedeu::Cells::TopRight]
|
250
|
+
def top_right
|
251
|
+
@top_right ||= Vedeu::Cells::TopRight.new(cell_attributes)
|
252
|
+
end
|
253
|
+
|
254
|
+
# Return the client application configured bottom horizontal
|
255
|
+
# cell character, or the default if not set.
|
256
|
+
#
|
257
|
+
# @return [Vedeu::Cells::BottomHorizontal]
|
258
|
+
def bottom_horizontal
|
259
|
+
@bottom_horizontal ||= Vedeu::Cells::BottomHorizontal
|
260
|
+
.new(cell_attributes)
|
261
|
+
end
|
262
|
+
|
263
|
+
# Return the client application configured bottom left cell
|
264
|
+
# character, or the default if not set.
|
265
|
+
#
|
266
|
+
# @return [Vedeu::Cells::BottomLeft]
|
267
|
+
def bottom_left
|
268
|
+
@bottom_left ||= Vedeu::Cells::BottomLeft.new(cell_attributes)
|
269
|
+
end
|
270
|
+
|
271
|
+
# Return the client application configured bottom right cell
|
272
|
+
# character, or the default if not set.
|
273
|
+
#
|
274
|
+
# @return [Vedeu::Cells::BottomRight]
|
275
|
+
def bottom_right
|
276
|
+
@bottom_right ||= Vedeu::Cells::BottomRight.new(cell_attributes)
|
277
|
+
end
|
278
|
+
|
208
279
|
private
|
209
280
|
|
281
|
+
# @return [Hash<Symbol => void>]
|
282
|
+
def cell_attributes
|
283
|
+
{
|
284
|
+
colour: @colour,
|
285
|
+
name: @name,
|
286
|
+
style: @style,
|
287
|
+
}
|
288
|
+
end
|
289
|
+
|
210
290
|
# The default values for a new instance of this class.
|
211
291
|
#
|
212
292
|
# @return [Hash<Symbol => Boolean|Hash|NilClass|String|Symbol|
|