glimmer-dsl-swt 4.17.6.0 → 4.17.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -2
- data/README.md +211 -82
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +14 -3
- data/lib/glimmer/data_binding/tree_items_binding.rb +20 -2
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -0
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -0
- data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -0
- data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -0
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -0
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +3 -3
- data/lib/glimmer/dsl/swt/shell_expression.rb +3 -3
- data/lib/glimmer/dsl/swt/widget_expression.rb +8 -8
- data/lib/glimmer/swt/custom/checkbox_group.rb +181 -0
- data/lib/glimmer/swt/custom/code_text.rb +43 -33
- data/lib/glimmer/swt/custom/radio_group.rb +94 -19
- data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
- data/lib/glimmer/swt/expand_item_proxy.rb +0 -1
- data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
- data/lib/glimmer/swt/menu_proxy.rb +3 -3
- data/lib/glimmer/swt/shell_proxy.rb +5 -5
- data/lib/glimmer/swt/tab_item_proxy.rb +3 -3
- data/lib/glimmer/swt/table_proxy.rb +25 -25
- data/lib/glimmer/swt/widget_listener_proxy.rb +4 -4
- data/lib/glimmer/swt/widget_proxy.rb +27 -27
- data/lib/glimmer/ui/custom_shell.rb +3 -3
- data/samples/elaborate/contact_manager.rb +3 -3
- data/samples/elaborate/meta_sample.rb +24 -19
- data/samples/hello/hello_browser.rb +3 -3
- data/samples/hello/hello_checkbox.rb +18 -18
- data/samples/hello/hello_checkbox_group.rb +68 -0
- data/samples/hello/hello_combo.rb +12 -12
- data/samples/hello/hello_directory_dialog.rb +60 -0
- data/samples/hello/hello_expand_bar.rb +3 -1
- data/samples/hello/hello_file_dialog.rb +60 -0
- data/samples/hello/hello_group.rb +104 -0
- data/samples/hello/hello_list_multi_selection.rb +23 -23
- data/samples/hello/hello_list_single_selection.rb +18 -17
- data/samples/hello/hello_menu_bar.rb +3 -3
- data/samples/hello/hello_pop_up_context_menu.rb +3 -3
- data/samples/hello/hello_radio.rb +20 -20
- data/samples/hello/hello_radio_group.rb +25 -25
- data/samples/hello/hello_table.rb +130 -0
- data/samples/hello/hello_world.rb +3 -3
- metadata +13 -2
@@ -8,20 +8,20 @@ module Glimmer
|
|
8
8
|
include Glimmer::UI::CustomWidget
|
9
9
|
|
10
10
|
SYNTAX_COLOR_MAP = {
|
11
|
-
Builtin: [215,58,73],
|
12
|
-
Class: [3,47,98],
|
13
|
-
Constant: [0,92,197],
|
11
|
+
Builtin: [215,58,73],
|
12
|
+
Class: [3,47,98],
|
13
|
+
Constant: [0,92,197],
|
14
14
|
Double: [0,92,197],
|
15
15
|
Escape: [:red],
|
16
|
-
Function: [:blue],
|
17
|
-
Instance: [227,98,9],
|
18
|
-
Integer: [:blue],
|
16
|
+
Function: [:blue],
|
17
|
+
Instance: [227,98,9],
|
18
|
+
Integer: [:blue],
|
19
19
|
Interpol: [:blue],
|
20
|
-
Keyword: [:blue],
|
20
|
+
Keyword: [:blue],
|
21
21
|
Name: [111,66,193], #purple
|
22
|
-
Operator: [:red],
|
22
|
+
Operator: [:red],
|
23
23
|
Pseudo: [:dark_red],
|
24
|
-
Punctuation: [:blue],
|
24
|
+
Punctuation: [:blue],
|
25
25
|
Single: [106,115,125], # Also, Comments
|
26
26
|
Symbol: [:dark_green],
|
27
27
|
Text: [75, 75, 75],
|
@@ -38,29 +38,25 @@ module Glimmer
|
|
38
38
|
swt_widget&.text
|
39
39
|
end
|
40
40
|
|
41
|
-
def syntax_highlighting
|
41
|
+
def syntax_highlighting(text)
|
42
42
|
return [] if text.to_s.strip.empty?
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
code_size += hash[:token_text].size
|
43
|
+
@syntax_highlighting ||= {}
|
44
|
+
unless @syntax_highlighting.keys.include?(text)
|
45
|
+
lex = lexer.lex(text).to_a
|
46
|
+
text_size = 0
|
47
|
+
@syntax_highlighting[text] = lex.map do |pair|
|
48
|
+
{token_type: pair.first, token_text: pair.last}
|
49
|
+
end.each do |hash|
|
50
|
+
hash[:token_index] = text_size
|
51
|
+
text_size += hash[:token_text].size
|
52
|
+
end
|
54
53
|
end
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
line_index += line.size + 1
|
62
|
-
end
|
63
|
-
end
|
54
|
+
@syntax_highlighting[text]
|
55
|
+
end
|
56
|
+
|
57
|
+
def lexer
|
58
|
+
# TODO Try to use Rouge::Lexer.find_fancy('guess', code) in the future to guess the language or otherwise detect it from file extension
|
59
|
+
@lexer ||= Rouge::Lexer.find_fancy('ruby')
|
64
60
|
end
|
65
61
|
|
66
62
|
before_body {
|
@@ -75,18 +71,32 @@ module Glimmer
|
|
75
71
|
top_margin 5
|
76
72
|
right_margin 5
|
77
73
|
bottom_margin 5
|
74
|
+
|
75
|
+
on_modify_text { |event|
|
76
|
+
# clear unnecessary syntax highlighting cache on text updates, and do it async to avoid affecting performance
|
77
|
+
new_text = event.data
|
78
|
+
async_exec {
|
79
|
+
unless @syntax_highlighting.nil?
|
80
|
+
lines = new_text.to_s.split("\n")
|
81
|
+
line_diff = @syntax_highlighting.keys - lines
|
82
|
+
line_diff.each do |line|
|
83
|
+
@syntax_highlighting.delete(line)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
}
|
87
|
+
}
|
78
88
|
|
79
89
|
on_line_get_style { |line_style_event|
|
80
90
|
styles = []
|
81
|
-
syntax_highlighting
|
91
|
+
syntax_highlighting(line_style_event.lineText).to_a.each do |token_hash|
|
82
92
|
start_index = token_hash[:token_index]
|
83
93
|
size = token_hash[:token_text].size
|
84
94
|
token_color = SYNTAX_COLOR_MAP[token_hash[:token_type].name] || [:black]
|
85
95
|
token_color = color(*token_color).swt_color
|
86
|
-
styles << StyleRange.new(start_index, size, token_color, nil)
|
96
|
+
styles << StyleRange.new(line_style_event.lineOffset + start_index, size, token_color, nil)
|
87
97
|
end
|
88
98
|
line_style_event.styles = styles.to_java(StyleRange) unless styles.empty?
|
89
|
-
}
|
99
|
+
}
|
90
100
|
}
|
91
101
|
}
|
92
102
|
end
|
@@ -1,14 +1,33 @@
|
|
1
|
+
# Copyright (c) 2007-2020 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
|
+
|
1
22
|
require 'glimmer/ui/custom_widget'
|
2
23
|
|
3
24
|
module Glimmer
|
4
25
|
module SWT
|
5
26
|
module Custom
|
6
|
-
#
|
27
|
+
# A custom widget rendering a group of radios generated via data-binding
|
7
28
|
class RadioGroup
|
8
29
|
include Glimmer::UI::CustomWidget
|
9
30
|
|
10
|
-
# TODO support setting font, background, foreground, cursor
|
11
|
-
|
12
31
|
body {
|
13
32
|
composite # just an empty composite to hold radios upon data-binding `selection`
|
14
33
|
}
|
@@ -20,18 +39,20 @@ module Glimmer
|
|
20
39
|
end
|
21
40
|
|
22
41
|
def items
|
23
|
-
@items
|
42
|
+
@items || []
|
24
43
|
end
|
25
44
|
|
26
45
|
def selection=(text)
|
27
|
-
radios.
|
28
|
-
radio
|
46
|
+
radios.count.times do |index|
|
47
|
+
radio = radios[index]
|
48
|
+
item = items[index]
|
49
|
+
radio.selection = item == text
|
29
50
|
end
|
30
51
|
end
|
31
52
|
|
32
53
|
def selection
|
33
|
-
|
34
|
-
|
54
|
+
selection_value = labels[selection_index]&.text unless selection_index == -1
|
55
|
+
selection_value.to_s
|
35
56
|
end
|
36
57
|
|
37
58
|
def selection_index=(index)
|
@@ -47,6 +68,10 @@ module Glimmer
|
|
47
68
|
@radios ||= []
|
48
69
|
end
|
49
70
|
|
71
|
+
def labels
|
72
|
+
@labels ||= []
|
73
|
+
end
|
74
|
+
|
50
75
|
def can_handle_observation_request?(observation_request)
|
51
76
|
radios.first&.can_handle_observation_request?(observation_request) || super(observation_request)
|
52
77
|
end
|
@@ -58,15 +83,31 @@ module Glimmer
|
|
58
83
|
end
|
59
84
|
|
60
85
|
def delegate_observation_request_to_radios(observation_request, &block)
|
61
|
-
if observation_request != 'on_widget_disposed'
|
62
|
-
radios.
|
63
|
-
|
64
|
-
|
86
|
+
if observation_request != 'on_widget_disposed'
|
87
|
+
radios.count.times do |index|
|
88
|
+
radio = radios[index]
|
89
|
+
label = labels[index]
|
90
|
+
if observation_request == 'on_widget_selected'
|
91
|
+
radio_block = lambda do |event|
|
92
|
+
if event.widget.selection || selection_index == -1
|
93
|
+
event.widget = self.swt_widget
|
94
|
+
block.call(event)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
label_block = lambda do |event|
|
98
|
+
self.selection_index = index
|
99
|
+
block.call(event)
|
100
|
+
end
|
101
|
+
radio.handle_observation_request(observation_request, &radio_block) if radio.can_handle_observation_request?(observation_request)
|
102
|
+
label.handle_observation_request('on_mouse_up', &label_block)
|
103
|
+
else
|
104
|
+
listener_block = lambda do |event|
|
65
105
|
event.widget = self.swt_widget
|
66
106
|
block.call(event)
|
67
107
|
end
|
108
|
+
radio.handle_observation_request(observation_request, &listener_block) if radio.can_handle_observation_request?(observation_request)
|
109
|
+
label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
|
68
110
|
end
|
69
|
-
radio.handle_observation_request(observation_request, &block)
|
70
111
|
end
|
71
112
|
end
|
72
113
|
end
|
@@ -75,23 +116,57 @@ module Glimmer
|
|
75
116
|
@observation_requests ||= Set.new
|
76
117
|
end
|
77
118
|
|
119
|
+
def has_attribute?(attribute_name, *args)
|
120
|
+
(@composites.to_a + @radios.to_a + @labels.to_a).map do |widget_proxy|
|
121
|
+
return true if widget_proxy.has_attribute?(attribute_name, *args)
|
122
|
+
end
|
123
|
+
super
|
124
|
+
end
|
125
|
+
|
126
|
+
def set_attribute(attribute_name, *args)
|
127
|
+
excluded_attributes = ['selection']
|
128
|
+
unless excluded_attributes.include?(attribute_name.to_s)
|
129
|
+
(@composites.to_a + @radios.to_a + @labels.to_a).each do |widget_proxy|
|
130
|
+
widget_proxy.set_attribute(attribute_name, *args) if widget_proxy.has_attribute?(attribute_name, *args)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
super
|
134
|
+
end
|
135
|
+
|
78
136
|
private
|
79
137
|
|
80
138
|
def build_radios
|
81
|
-
# TODO consider doing a diff instead of disposing and rebuilding everything in the future
|
82
|
-
# TODO add labels since they are better customizable with fonts while maintaining alignment with radio buttons
|
83
139
|
current_selection = selection
|
84
|
-
|
140
|
+
@composites.to_a.each(&:dispose)
|
85
141
|
@radios = []
|
142
|
+
@labels = []
|
143
|
+
@composites = []
|
86
144
|
items.each do |item|
|
87
145
|
body_root.content {
|
88
|
-
|
89
|
-
|
146
|
+
@composites << composite {
|
147
|
+
grid_layout(2, false) {
|
148
|
+
margin_width 0
|
149
|
+
margin_height 0
|
150
|
+
horizontal_spacing 0
|
151
|
+
vertical_spacing 0
|
152
|
+
}
|
153
|
+
radios << radio { |radio_proxy|
|
154
|
+
on_widget_selected {
|
155
|
+
self.selection = items[radios.index(radio_proxy)]
|
156
|
+
}
|
157
|
+
}
|
158
|
+
labels << label { |label_proxy|
|
159
|
+
layout_data :fill, :center, true, false
|
160
|
+
text item
|
161
|
+
on_mouse_up {
|
162
|
+
self.selection = label_proxy.text
|
163
|
+
}
|
164
|
+
}
|
90
165
|
}
|
91
166
|
}
|
92
167
|
end
|
93
168
|
observation_requests.to_a.each do |observation_request, block|
|
94
|
-
delegate_observation_request_to_radios(observation_request, &block)
|
169
|
+
delegate_observation_request_to_radios(observation_request, &block)
|
95
170
|
end
|
96
171
|
self.selection = current_selection
|
97
172
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# Copyright (c) 2007-2020 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
|
+
require 'glimmer/swt/swt_proxy'
|
23
|
+
require 'glimmer/swt/widget_proxy'
|
24
|
+
require 'glimmer/swt/display_proxy'
|
25
|
+
|
26
|
+
module Glimmer
|
27
|
+
module SWT
|
28
|
+
# Proxy for org.eclipse.swt.widgets.DirectoryDialog
|
29
|
+
#
|
30
|
+
# Automatically uses the current shell if one is open.
|
31
|
+
# Otherwise, it instantiates a new shell parent
|
32
|
+
#
|
33
|
+
# Optionally takes a shell as an argument
|
34
|
+
#
|
35
|
+
# Follows the Proxy Design Pattern
|
36
|
+
class DirectoryDialogProxy < WidgetProxy
|
37
|
+
# TODO write rspec tests
|
38
|
+
include_package 'org.eclipse.swt.widgets'
|
39
|
+
|
40
|
+
def initialize(*args, swt_widget: nil)
|
41
|
+
if swt_widget
|
42
|
+
@swt_widget = swt_widget
|
43
|
+
else
|
44
|
+
style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
|
45
|
+
if style_args.any?
|
46
|
+
style_arg_start_index = args.index(style_args.first)
|
47
|
+
style_arg_last_index = args.index(style_args.last)
|
48
|
+
args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
|
49
|
+
end
|
50
|
+
if !args.first.is_a?(Shell)
|
51
|
+
current_shell = DisplayProxy.instance.swt_display.shells.first
|
52
|
+
args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
|
53
|
+
end
|
54
|
+
if args.first.is_a?(ShellProxy)
|
55
|
+
args[0] = args[0].swt_widget
|
56
|
+
end
|
57
|
+
parent = args[0]
|
58
|
+
@parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
|
59
|
+
@swt_widget = DirectoryDialog.new(*args)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -61,7 +61,6 @@ module Glimmer
|
|
61
61
|
|
62
62
|
def post_add_content
|
63
63
|
@swt_expand_item.setHeight(swt_widget.computeSize(SWTProxy[:default], SWTProxy[:default]).y) unless @swt_expand_item.getHeight > 0
|
64
|
-
WidgetProxy.new('composite', self, []) # adding filler since it seems like the last child gets a bad style, so this gets it instead
|
65
64
|
end
|
66
65
|
|
67
66
|
def has_attribute?(attribute_name, *args)
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright (c) 2007-2020 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
|
+
require 'glimmer/swt/swt_proxy'
|
23
|
+
require 'glimmer/swt/widget_proxy'
|
24
|
+
require 'glimmer/swt/display_proxy'
|
25
|
+
|
26
|
+
module Glimmer
|
27
|
+
module SWT
|
28
|
+
# Proxy for org.eclipse.swt.widgets.FileDialog
|
29
|
+
#
|
30
|
+
# Automatically uses the current shell if one is open.
|
31
|
+
# Otherwise, it instantiates a new shell parent
|
32
|
+
#
|
33
|
+
# Optionally takes a shell as an argument
|
34
|
+
#
|
35
|
+
# Follows the Proxy Design Pattern
|
36
|
+
class FileDialogProxy < WidgetProxy
|
37
|
+
# TODO write rspec tests
|
38
|
+
# TODO consider refactoring and sharing code with DirectoryDialogProxy (and do the same with their expressions)
|
39
|
+
include_package 'org.eclipse.swt.widgets'
|
40
|
+
|
41
|
+
def initialize(*args, swt_widget: nil)
|
42
|
+
if swt_widget
|
43
|
+
@swt_widget = swt_widget
|
44
|
+
else
|
45
|
+
style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
|
46
|
+
if style_args.any?
|
47
|
+
style_arg_start_index = args.index(style_args.first)
|
48
|
+
style_arg_last_index = args.index(style_args.last)
|
49
|
+
args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
|
50
|
+
end
|
51
|
+
if !args.first.is_a?(Shell)
|
52
|
+
current_shell = DisplayProxy.instance.swt_display.shells.first
|
53
|
+
args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
|
54
|
+
end
|
55
|
+
if args.first.is_a?(ShellProxy)
|
56
|
+
args[0] = args[0].swt_widget
|
57
|
+
end
|
58
|
+
parent = args[0]
|
59
|
+
@parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
|
60
|
+
@swt_widget = FileDialog.new(*args)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2020 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2020 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -65,7 +65,7 @@ module Glimmer
|
|
65
65
|
@swt_widget.setMinimumSize(WIDTH_MIN, HEIGHT_MIN)
|
66
66
|
# TODO make this an option not the default
|
67
67
|
on_swt_show do
|
68
|
-
Thread.new do
|
68
|
+
Thread.new do
|
69
69
|
sleep(0.25)
|
70
70
|
async_exec do
|
71
71
|
@swt_widget.setActive unless @swt_widget.isDisposed
|
@@ -130,7 +130,7 @@ module Glimmer
|
|
130
130
|
@swt_widget.pack
|
131
131
|
@swt_widget.removeControlListener(listener.swt_listener)
|
132
132
|
@swt_widget.setMinimumSize(minimum_size)
|
133
|
-
elsif OS.linux?
|
133
|
+
elsif OS.linux?
|
134
134
|
@swt_widget.layout(true, true)
|
135
135
|
@swt_widget.setBounds(bounds)
|
136
136
|
end
|