glimmer-cs-gladiator 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,64 +1,64 @@
1
- # Copyright (c) 2020-2021 Andy Maleh
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining
4
- # a copy of this software and associated documentation files (the
5
- # "Software"), to deal in the Software without restriction, including
6
- # without limitation the rights to use, copy, modify, merge, publish,
7
- # distribute, sublicense, and/or sell copies of the Software, and to
8
- # permit persons to whom the Software is furnished to do so, subject to
9
- # the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be
12
- # included in all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- module Glimmer
23
- class Gladiator
24
- class FileLookupList
25
- include Glimmer::UI::CustomWidget
26
-
27
- options :gladiator, :foreground_color
28
-
29
- body {
30
- list(:border, :h_scroll, :v_scroll) {
31
- selection bind(project_dir, :filtered_path)
32
- # visible bind(project_dir, 'filter') {|f| pd swt_widget&.get_shell&.get_data('proxy'); swt_widget&.get_shell&.get_data('proxy')&.pack_same_size; !!f}
33
- foreground foreground_color
34
- on_mouse_up {
35
- project_dir.selected_child_path = swt_widget.getSelection.first
36
- }
37
- on_key_pressed { |key_event|
38
- if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
39
- project_dir.selected_child_path = swt_widget.getSelection.first
40
- current_text_editor&.text_widget&.setFocus
41
- end
42
- }
43
- drag_source(DND::DROP_COPY) {
44
- transfer :text
45
- on_drag_set_data { |event|
46
- Gladiator.drag = true
47
- list = event.widget.getControl
48
- event.data = list.getSelection.first
49
- }
50
- }
51
- }
52
- }
53
-
54
- def project_dir
55
- gladiator.project_dir
56
- end
57
-
58
- def current_text_editor
59
- gladiator.current_text_editor
60
- end
61
-
62
- end
63
- end
64
- end
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module Glimmer
23
+ class Gladiator
24
+ class FileLookupList
25
+ include Glimmer::UI::CustomWidget
26
+
27
+ options :gladiator, :foreground_color
28
+
29
+ body {
30
+ list(:border, :h_scroll, :v_scroll) {
31
+ selection bind(project_dir, :filtered_path)
32
+ # visible bind(project_dir, 'filter') {|f| pd swt_widget&.get_shell&.get_data('proxy'); swt_widget&.get_shell&.get_data('proxy')&.pack_same_size; !!f}
33
+ foreground foreground_color
34
+ on_mouse_up {
35
+ project_dir.selected_child_path = swt_widget.getSelection.first
36
+ }
37
+ on_key_pressed { |key_event|
38
+ if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
39
+ project_dir.selected_child_path = swt_widget.getSelection.first
40
+ current_text_editor&.text_widget&.setFocus
41
+ end
42
+ }
43
+ drag_source(DND::DROP_COPY) {
44
+ transfer :text
45
+ on_drag_set_data { |event|
46
+ Gladiator.drag = true
47
+ list = event.widget.getControl
48
+ event.data = list.getSelection.first
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ def project_dir
55
+ gladiator.project_dir
56
+ end
57
+
58
+ def current_text_editor
59
+ gladiator.current_text_editor
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -32,7 +32,7 @@ module Glimmer
32
32
  text '&File'
33
33
 
34
34
  menu_item {
35
- text 'New &Scratchpad'
35
+ text 'Open &Scratchpad'
36
36
  accelerator COMMAND_KEY, :shift, :s
37
37
  enabled editing
38
38
  on_widget_selected {
@@ -191,8 +191,8 @@ module Glimmer
191
191
 
192
192
  styled_text(:border, :h_scroll, :v_scroll) {
193
193
  layout_data {
194
- width body_root.bounds.width*0.75
195
- height body_root.bounds.height*0.75
194
+ width gladiator.bounds.width*0.75
195
+ height gladiator.bounds.height*0.75
196
196
  }
197
197
 
198
198
  text message
@@ -196,6 +196,8 @@ module Glimmer
196
196
  if file.selection_count.to_i == 0
197
197
  verify_event.text += file.current_line_indentation
198
198
  end
199
+ # TODO implement this to borrowed line of code from Glimmer Meta-Sample
200
+ # verify_event.text += ' '*2 if line.strip.end_with?('{') || line.strip.match(/do[ ]+([|][^|]+[|])?$/) || line.start_with?('class') || line.start_with?('module') || line.strip.start_with?('def')
199
201
  when "\t"
200
202
  Command.do(file, :indent!)
201
203
  verify_event.doit = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-cs-gladiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-08 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,6 @@ executables:
127
127
  - gladiator-setup
128
128
  extensions: []
129
129
  extra_rdoc_files:
130
- - CHANGELOG.md
131
130
  - LICENSE.txt
132
131
  - README.md
133
132
  files: