visualruby 3.0.2 → 3.0.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/.vr_settings.yaml +27 -0
- data/bin/editor/VR_Document.rb +156 -156
- data/bin/editor/VR_TabSearch.rb +37 -37
- data/bin/editor/VR_Tabs.rb +82 -82
- data/bin/editor/VR_TextShell.rb +49 -52
- data/bin/editor/VR_TextViewCommon.rb +31 -31
- data/bin/main/GemTree.rb +14 -14
- data/bin/main/NewProjectGUI.rb +24 -24
- data/bin/main/OpenProject.rb +53 -53
- data/bin/main/ProjectChooserView.rb +31 -31
- data/bin/main/ProjectTree.rb +17 -17
- data/bin/main/RubygemsAPI.rb +73 -63
- data/bin/main/VR_ENV.rb +29 -29
- data/bin/main/VR_ENV_GLOBAL.rb +52 -52
- data/bin/main/VR_File_Tree.rb +88 -88
- data/bin/main/VR_Local_Gem_Tree.rb +53 -53
- data/bin/main/VR_Main.rb +240 -238
- data/bin/main/VR_Remote_Gem_Tree.rb +41 -41
- data/bin/main/glade/Splash.glade +19 -0
- data/bin/tools/VR_Tools.rb +72 -72
- data/examples/active_record/.vr_settings.yaml +50 -0
- data/examples/active_record/active_record.rb +2 -2
- data/examples/active_record/bin/ChoosePerson.rb +10 -10
- data/examples/active_record/bin/Person.rb +6 -6
- data/examples/active_record2/.vr_settings.yaml +23 -0
- data/examples/active_record2/bin/CompanyGUI.rb +42 -42
- data/examples/active_record2/bin/Employee.rb +13 -13
- data/examples/active_record2/bin/Employer.rb +5 -5
- data/examples/active_record2/bin/Paycheck.rb +5 -5
- data/examples/active_record2/main.rb +4 -4
- data/examples/alert_box/bin/AlertBoxDemo.rb +40 -50
- data/examples/alert_box/bin/glade/AlertBoxDemo.glade +14 -45
- data/examples/all_widgets/.vr_settings.yaml +18 -0
- data/examples/all_widgets/bin/AllWidgets.rb +19 -16
- data/examples/calculator/.vr_settings.yaml +18 -0
- data/examples/calculator/bin/Calculator.rb +22 -22
- data/examples/child_window/.vr_settings.yaml +21 -0
- data/examples/child_window/bin/ChildWindowDemo.rb +10 -10
- data/examples/child_window/bin/ModalWindow.rb +4 -4
- data/examples/child_window/bin/ModelessWindow.rb +4 -4
- data/examples/child_window/bin/MyChildClass.rb +10 -10
- data/examples/drag_drop/.vr_settings.yaml +16 -0
- data/examples/drag_drop/bin/DragDropDemo.rb +28 -28
- data/examples/filetreeview/.vr_settings.yaml +20 -0
- data/examples/filetreeview/bin/ProjectTree.rb +13 -23
- data/examples/filetreeview/bin/ProjectTreeGUI.rb +18 -17
- data/examples/listview/.vr_settings.yaml +19 -0
- data/examples/listview/bin/SongListView.rb +72 -72
- data/examples/listview/bin/SongListViewGUI.rb +52 -52
- data/examples/listview_objects/.vr_settings.yaml +19 -0
- data/examples/listview_objects/bin/DataObject.rb +23 -23
- data/examples/listview_objects/bin/ListViewObjects.rb +29 -29
- data/examples/listview_objects/bin/ListViewObjectsGUI.rb +12 -12
- data/examples/settings_file/bin/MainApp.rb +25 -25
- data/examples/settings_file/bin/SavableSettings.rb +25 -26
- data/examples/settings_file/settings.yaml +1 -1
- data/examples/simple_ruby_gui/.vr_settings.yaml +20 -0
- data/examples/simple_ruby_gui/bin/DataObjectGUI.rb +12 -12
- data/examples/treeview/.vr_settings.yaml +17 -0
- data/examples/treeview/bin/MyClass.rb +18 -17
- data/examples/treeview/bin/glade/MyClass.glade +61 -6
- data/skeleton/document/NewWindow.rb +8 -8
- data/skeleton/project/.vr_settings.yaml +15 -0
- data/skeleton/project/bin/MyClass.rb +7 -7
- data/vr +38 -41
- data/vrlib/doc/images/add.png +0 -0
- data/vrlib/doc/images/arrow_up.png +0 -0
- data/vrlib/doc/images/brick.png +0 -0
- data/vrlib/doc/images/brick_link.png +0 -0
- data/vrlib/doc/images/bug.png +0 -0
- data/vrlib/doc/images/bullet_black.png +0 -0
- data/vrlib/doc/images/bullet_toggle_minus.png +0 -0
- data/vrlib/doc/images/bullet_toggle_plus.png +0 -0
- data/vrlib/doc/images/date.png +0 -0
- data/vrlib/doc/images/delete.png +0 -0
- data/vrlib/doc/images/find.png +0 -0
- data/vrlib/doc/images/macFFBgHack.png +0 -0
- data/vrlib/doc/images/package.png +0 -0
- data/vrlib/doc/images/page_green.png +0 -0
- data/vrlib/doc/images/page_white_text.png +0 -0
- data/vrlib/doc/images/page_white_width.png +0 -0
- data/vrlib/doc/images/plugin.png +0 -0
- data/vrlib/doc/images/ruby.png +0 -0
- data/vrlib/doc/images/tag_blue.png +0 -0
- data/vrlib/doc/images/tag_green.png +0 -0
- data/vrlib/doc/images/transparent.png +0 -0
- data/vrlib/doc/images/wrench.png +0 -0
- data/vrlib/doc/images/wrench_orange.png +0 -0
- data/vrlib/doc/images/zoom.png +0 -0
- data/vrlib/lib/Alert.rb +98 -55
- data/vrlib/lib/DragDrop.rb +43 -43
- data/vrlib/lib/GladeGUI.rb +207 -207
- data/vrlib/lib/IconHash.rb +10 -10
- data/vrlib/lib/SavableClass.rb +38 -38
- data/vrlib/lib/SimpleComboBoxEntry.rb +3 -3
- data/vrlib/lib/treeview/FileTreeView.rb +71 -70
- data/vrlib/lib/treeview/IterMethods.rb +35 -35
- data/vrlib/lib/treeview/ListView.rb +25 -25
- data/vrlib/lib/treeview/TreeView.rb +15 -15
- data/vrlib/lib/treeview/ViewCommon.rb +134 -131
- data/vrlib/lib/treeview/columns/CalendarCol.rb +48 -48
- data/vrlib/lib/treeview/columns/CellRendererCombo.rb +26 -26
- data/vrlib/lib/treeview/columns/CellRendererDate.rb +25 -25
- data/vrlib/lib/treeview/columns/CellRendererObject.rb +37 -37
- data/vrlib/lib/treeview/columns/CellRendererPhone.rb +25 -25
- data/vrlib/lib/treeview/columns/CellRendererPixbuf.rb +8 -8
- data/vrlib/lib/treeview/columns/CellRendererProgress.rb +8 -8
- data/vrlib/lib/treeview/columns/CellRendererSpin.rb +17 -17
- data/vrlib/lib/treeview/columns/CellRendererText.rb +18 -18
- data/vrlib/lib/treeview/columns/CellRendererToggle.rb +25 -25
- data/vrlib/lib/treeview/columns/ComboCol.rb +12 -12
- data/vrlib/lib/treeview/columns/CurrencyCol.rb +13 -13
- data/vrlib/lib/treeview/columns/DateCol.rb +10 -10
- data/vrlib/lib/treeview/columns/ImageCol.rb +16 -16
- data/vrlib/lib/treeview/columns/SpinCol.rb +5 -5
- data/vrlib/lib/treeview/columns/TextCol.rb +24 -24
- data/vrlib/lib/treeview/columns/TreeViewColumn.rb +71 -76
- data/vrlib/rdoc_replace.yaml +36 -36
- metadata +43 -6
- data/Splash.rb +0 -40
|
@@ -13,33 +13,33 @@ module VR
|
|
|
13
13
|
|
|
14
14
|
class CellRendererPhone < Gtk::CellRendererText
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
attr_accessor :phone_format, :edited_callback, :model_col, :column, :model_sym
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
def initialize(model_col, column, view, model_sym) # :nodoc:
|
|
19
|
+
super()
|
|
20
|
+
@model_col = model_col
|
|
21
|
+
@column = column
|
|
22
|
+
@view = view
|
|
23
|
+
@model_sym = model_sym
|
|
24
|
+
@view.model.set_sort_func(@model_col) { |m,x,y| x[@model_col] <=> y[@model_col] }
|
|
25
|
+
@phone_format = "%3-%3-%4"
|
|
26
|
+
@validate_block = Proc.new { |text, model_sym, row, view|
|
|
27
|
+
only_numbers = text.gsub(/[^0-9]/, "")
|
|
28
|
+
if (only_numbers.size == 10)
|
|
29
|
+
true
|
|
30
|
+
else
|
|
31
|
+
alert("Unrecognized phone number: " + text)
|
|
32
|
+
false
|
|
33
|
+
end }
|
|
34
|
+
@edited_block = nil
|
|
35
35
|
self.signal_connect('edited') do |ren, path, text|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
next unless iter = @view.model.get_iter(path)
|
|
37
|
+
if @validate_block.call(text, @model_sym, @view.vr_row(iter), @view)
|
|
38
|
+
iter[@model_col] = DateTime.strptime(text, @date_format)
|
|
39
|
+
@edited_callback.call(@model_sym, @view.vr_row(iter)) if @edited_callback
|
|
40
|
+
end
|
|
41
41
|
end
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
44
|
|
|
45
45
|
end
|
|
@@ -2,15 +2,15 @@ module VR
|
|
|
2
2
|
|
|
3
3
|
class CellRendererPixbuf < Gtk::CellRendererPixbuf # :nodoc:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
attr_reader :model_col, :column, :model_sym
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
def initialize(model_col, column, view, model_sym)
|
|
8
|
+
super()
|
|
9
|
+
@column = column
|
|
10
|
+
@model_col = model_col
|
|
11
|
+
@model_sym = model_sym
|
|
12
|
+
@view = view
|
|
13
|
+
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
end
|
|
@@ -2,15 +2,15 @@ module VR
|
|
|
2
2
|
|
|
3
3
|
class CellRendererProgress < Gtk::CellRendererProgress # :nodoc:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
attr_reader :model_col, :column, :model_sym
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
def initialize(model_col, column, view, model_sym)
|
|
8
|
+
super()
|
|
9
|
+
@model_col = model_col
|
|
10
|
+
@model_sym = model_sym
|
|
11
|
+
@column = column
|
|
12
|
+
@view = view
|
|
13
|
+
end
|
|
14
14
|
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -13,24 +13,24 @@ module VR
|
|
|
13
13
|
|
|
14
14
|
class CellRendererSpin < Gtk::CellRendererSpin
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
attr_reader :model_col, :column, :model_sym
|
|
17
|
+
attr_accessor :edited_callback
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
def initialize(model_col, column, view, model_sym) # :nodoc:
|
|
20
|
+
super()
|
|
21
|
+
@model_col = model_col
|
|
22
|
+
@model_sym = model_sym
|
|
23
|
+
@column = column
|
|
24
|
+
@view = view
|
|
25
|
+
self.editable = true
|
|
26
|
+
@view.model.set_sort_func(@model_col) { |m,x,y| x[@model_col].value <=> y[@model_col].value }
|
|
27
|
+
@edited_callback = nil
|
|
28
|
+
self.signal_connect('edited') do |ren, path, text|
|
|
29
|
+
next unless iter = @view.model.get_iter(path)
|
|
30
|
+
iter[@model_col].value = text.to_f if (iter)
|
|
31
|
+
@edited_callback.call(@model_sym, @view.vr_row(iter)) if @edited_callback
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
34
|
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -13,25 +13,25 @@ module VR
|
|
|
13
13
|
|
|
14
14
|
class CellRendererText < Gtk::CellRendererText
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
attr_accessor :validate_block, :edited_callback
|
|
17
|
+
attr_reader :model_col, :column, :model_sym
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
def initialize(model_col, column, view, model_sym) # :nodoc:
|
|
20
|
+
super()
|
|
21
|
+
@column = column
|
|
22
|
+
@model_sym = model_sym
|
|
23
|
+
@model_col = model_col
|
|
24
|
+
@view = view
|
|
25
|
+
@validate_block = Proc.new { |text, model_sym, row, view| true }
|
|
26
|
+
@edited_callback = nil
|
|
27
|
+
self.signal_connect('edited') do |ren, path, text|
|
|
28
|
+
next unless iter = @view.model.get_iter(path)
|
|
29
|
+
if @validate_block.call(text, @model_sym, @view.vr_row(iter), @view)
|
|
30
|
+
iter[@model_col] = (iter[@model_col].is_a? String) ? text : text.to_f
|
|
31
|
+
@edited_callback.call(@model_sym, @view.vr_row(iter)) if @edited_callback
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
35
|
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -13,34 +13,34 @@ module VR
|
|
|
13
13
|
|
|
14
14
|
class CellRendererToggle < Gtk::CellRendererToggle
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
attr_accessor :validate_block, :edited_callback
|
|
17
|
+
attr_reader :model_col, :column, :model_sym
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
def initialize(model_col, column, view, model_sym)
|
|
20
|
+
super()
|
|
21
|
+
@model_col = model_col
|
|
22
|
+
@model_sym = model_sym
|
|
23
|
+
@column = column
|
|
24
|
+
@view = view
|
|
25
|
+
@edited_callback = nil
|
|
26
|
+
@validate_block = Proc.new { |model_sym, row, view | true }
|
|
27
|
+
self.signal_connect('toggled') do |ren, path|
|
|
28
|
+
@view.model.each { |mod, path, iter| iter[@model_col] = false } if self.radio?
|
|
29
|
+
next unless iter = @view.model.get_iter(path)
|
|
30
|
+
if @validate_block.call(@model_sym, @view.vr_row(iter), @view)
|
|
31
|
+
iter[model_col] = !iter[model_col]
|
|
32
|
+
@edited_callback.call(@model_col, iter) if @edited_callback
|
|
33
|
+
end
|
|
34
34
|
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def editable=(is_editable)
|
|
38
|
+
self.sensitive = is_editable
|
|
39
|
+
end
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
def set_editable(is_editable)
|
|
42
|
+
self.sensitive = is_editable
|
|
43
|
+
end
|
|
44
44
|
|
|
45
45
|
end
|
|
46
46
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
module VR
|
|
4
4
|
|
|
5
5
|
# The Combo class is for use with VR::ListView and VR::TreeView. It
|
|
@@ -9,34 +9,34 @@ module VR
|
|
|
9
9
|
# It is one of the data types that you can pass to the constructors for VR::ListView and
|
|
10
10
|
# VR::TreeView. For example, to make the second column render as a combobox:
|
|
11
11
|
#
|
|
12
|
-
#
|
|
12
|
+
# @view = VR::Treeview.new(Gdk::Pixbuf, VR::Combo, String)
|
|
13
13
|
#
|
|
14
14
|
# Then when you add data to the model:
|
|
15
15
|
#
|
|
16
|
-
#
|
|
16
|
+
# @view.add_row(@pixbuf, VR::Combo.new("Mr", "Mr", "Mrs", "Ms"), "Hello World")
|
|
17
17
|
#
|
|
18
18
|
# This would set the combobox for this row so that "Mr" is selected, and "Mr", "Mrs", and "Ms" are the choices.
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class ComboCol # can't subclass String tried twice!!!
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
attr_accessor :selected, :selections
|
|
24
24
|
|
|
25
25
|
# This defines a combobox for a row in VR::ListView or VR::TreeView. You pass three or more strings
|
|
26
26
|
# to the constructor, and the first string is the selected value that appears in the row in the
|
|
27
27
|
# view.
|
|
28
28
|
#
|
|
29
29
|
# - current_selection (type String)
|
|
30
|
-
# - selections (comma separated list of Strings)
|
|
30
|
+
# - selections (comma separated list of Strings)
|
|
31
31
|
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
def initialize(current_selection, *selections)
|
|
33
|
+
@selected = current_selection
|
|
34
|
+
@selections = selections
|
|
35
|
+
end
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
def valid?(str)
|
|
38
|
+
@selections.include?(str)
|
|
39
|
+
end
|
|
40
40
|
|
|
41
41
|
end
|
|
42
42
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
module VR
|
|
3
3
|
|
|
4
4
|
class CurrencyCol
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
attr_accessor :value, :format
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
def initialize(value, format = "$%.2f")
|
|
9
|
+
set_value(value, format)
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
def set_value(value, format = "$%.2f")
|
|
13
|
+
@value = value
|
|
14
|
+
@format = format
|
|
15
|
+
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
def to_s
|
|
18
|
+
format % @value.to_f
|
|
19
|
+
end
|
|
20
20
|
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
module VR
|
|
4
4
|
|
|
5
5
|
class DateCol
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
attr_accessor :date
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
def initialize(date, format = "%Y-%m-%d")
|
|
10
|
+
set_date(date, format)
|
|
11
|
+
end
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
|
|
13
|
+
def set_date(date, format = "%Y-%m-%d")
|
|
14
|
+
@date = date
|
|
15
|
+
# gsub!(self, @date.strftime(format))
|
|
16
|
+
end
|
|
17
17
|
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
module VR
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
class ImageCol #< Gdk::Pixbuf
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
include GladeGUI
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
def initialize(image)
|
|
9
|
+
# super(File.dirname(__FILE__) + "/../../../img/image-x-generic.png")
|
|
10
|
+
@image1 = image
|
|
11
|
+
end
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
def before_show()
|
|
14
|
+
@builder["window1"].resize 500, 360
|
|
15
|
+
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
def to_s
|
|
18
|
+
"<Img>"
|
|
19
|
+
end
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
21
|
+
# def visual_attributes
|
|
22
|
+
# { :pixbuf => self }
|
|
23
|
+
# end
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
end
|
|
26
26
|
|
|
27
27
|
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module VR
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
class SpinCol < Gtk::Adjustment
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
def initialize(val, min, max, step)
|
|
6
|
+
super(val, min, max, step, 0, 0)
|
|
7
|
+
end
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
end
|
|
10
10
|
|
|
11
11
|
end
|
|
@@ -20,46 +20,46 @@ module VR
|
|
|
20
20
|
#
|
|
21
21
|
# See the example project, "listview_objects" for more.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
class TextCol
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
include GladeGUI
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
attr_accessor :text, :length_to_display
|
|
28
28
|
#
|
|
29
29
|
# - text - String value of the field
|
|
30
30
|
# - length_to_display - Integer number of characters to display in the listview. Default: 20
|
|
31
31
|
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
def initialize(text, length_to_display = 20)
|
|
33
|
+
@length_to_display = length_to_display
|
|
34
|
+
@text = text
|
|
35
|
+
end
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
def before_show()
|
|
38
|
+
@builder["window1"].resize 650, 360
|
|
39
|
+
end
|
|
40
40
|
|
|
41
41
|
# The to_s method outputs the string that is shown in the VR::ListView. By default
|
|
42
42
|
# it will display the first 20 characters of the string. If you
|
|
43
43
|
# want to change the number of characters it displays, change the
|
|
44
44
|
# value of the length_to_display variable.
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
def to_s
|
|
47
|
+
(@text.size > @length_to_display ? @text[0, @length_to_display - 4] + "..." : @text).gsub("\n"," ")
|
|
48
|
+
end
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
def buttonSave__clicked(*args) # :nodoc:
|
|
51
|
+
get_glade_variables()
|
|
52
|
+
@builder["window1"].destroy
|
|
53
|
+
end
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
def buttonCancel__clicked(*args) # :nodoc:
|
|
56
|
+
@builder["window1"].destroy
|
|
57
|
+
end
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
def <=>(text_col)
|
|
60
|
+
self.text <=> text_col.text
|
|
61
|
+
end
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
end
|
|
64
64
|
|
|
65
65
|
end
|