visualruby 3.2.3 → 3.4.7
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 +5 -5
- data/.vr_settings.yaml +13 -8
- data/examples/active_record/.vr_settings.yaml +1 -1
- data/examples/alert_box/.vr_settings.yaml +4 -2
- data/examples/alert_box/bin/glade/AlertBoxDemo.glade +91 -94
- data/examples/alert_box/main.rb +2 -3
- data/examples/all_widgets/.vr_settings.yaml +1 -1
- data/examples/all_widgets/bin/AllWidgets.rb +1 -1
- data/examples/all_widgets/bin/glade/AllWidgets.glade +33 -33
- data/examples/all_widgets/main.rb +1 -4
- data/examples/calculator/.vr_settings.yaml +3 -2
- data/examples/calculator/bin/glade/Calculator.glade +79 -110
- data/examples/calculator/main.rb +1 -5
- data/examples/child_window/.vr_settings.yaml +5 -5
- data/examples/child_window/bin/glade/ChildWindowDemo.glade +16 -16
- data/examples/child_window/bin/glade/ModalWindow.glade +14 -14
- data/examples/child_window/main.rb +1 -5
- data/examples/drag_drop/.vr_settings.yaml +6 -4
- data/examples/drag_drop/main.rb +1 -4
- data/examples/filetreeview/.vr_settings.yaml +3 -2
- data/examples/filetreeview/main.rb +1 -3
- data/examples/golf_handicap/.vr_settings.yaml +2 -2
- data/examples/golf_handicap/src/LoadGolfer.rb +3 -3
- data/examples/listview/.vr_settings.yaml +2 -2
- data/examples/listview/main.rb +1 -3
- data/examples/listview_objects/.vr_settings.yaml +6 -5
- data/examples/listview_objects/main.rb +1 -5
- data/examples/phantom/.vr_settings.yaml +2 -2
- data/examples/phantom/main.rb +0 -2
- data/examples/phantom/src/glade/MyClass.glade +19 -19
- data/examples/settings_file/.vr_settings.yaml +2 -2
- data/examples/settings_file/main.rb +2 -3
- data/examples/settings_file/settings.yaml +3 -5
- data/examples/simple_ruby_gui/.vr_settings.yaml +6 -7
- data/examples/simple_ruby_gui/main.rb +4 -6
- data/lib/ActLikeAHash.rb +4 -4
- data/lib/SavableHash.rb +25 -0
- data/lib/treeview/IterMethods.rb +3 -3
- data/lib/treeview/ViewCommon.rb +2 -2
- data/lib/treeview/columns/TreeViewColumn.rb +1 -1
- data/lib/vrlib.rb +1 -0
- data/skeleton/document/New.glade +2 -2
- data/src/main/VR_File_Tree.rb +12 -10
- data/src/version.rb +1 -1
- data/vr +6 -4
- metadata +13 -13
@@ -1,27 +1,27 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Generated with glade 3.
|
2
|
+
<!-- Generated with glade 3.38.2 -->
|
3
3
|
<interface>
|
4
4
|
<requires lib="gtk+" version="3.0"/>
|
5
5
|
<object class="GtkWindow" id="window1">
|
6
|
-
<property name="
|
6
|
+
<property name="can-focus">False</property>
|
7
7
|
<property name="title" translatable="yes">Modal Window</property>
|
8
8
|
<property name="modal">True</property>
|
9
|
-
<property name="
|
9
|
+
<property name="window-position">center</property>
|
10
10
|
<child>
|
11
11
|
<object class="GtkBox" id="box1">
|
12
12
|
<property name="visible">True</property>
|
13
|
-
<property name="
|
14
|
-
<property name="
|
15
|
-
<property name="
|
16
|
-
<property name="
|
17
|
-
<property name="
|
13
|
+
<property name="can-focus">False</property>
|
14
|
+
<property name="margin-left">20</property>
|
15
|
+
<property name="margin-right">20</property>
|
16
|
+
<property name="margin-top">20</property>
|
17
|
+
<property name="margin-bottom">20</property>
|
18
18
|
<property name="orientation">vertical</property>
|
19
19
|
<property name="spacing">20</property>
|
20
20
|
<child>
|
21
21
|
<object class="GtkLabel" id="label1">
|
22
22
|
<property name="visible">True</property>
|
23
|
-
<property name="
|
24
|
-
<property name="label" translatable="yes">This modal window freezes the parent, and
|
23
|
+
<property name="can-focus">False</property>
|
24
|
+
<property name="label" translatable="yes">This modal window freezes the parent, and it's always on top.</property>
|
25
25
|
</object>
|
26
26
|
<packing>
|
27
27
|
<property name="expand">False</property>
|
@@ -32,15 +32,15 @@
|
|
32
32
|
<child>
|
33
33
|
<object class="GtkButtonBox" id="buttonbox1">
|
34
34
|
<property name="visible">True</property>
|
35
|
-
<property name="
|
35
|
+
<property name="can-focus">False</property>
|
36
36
|
<property name="orientation">vertical</property>
|
37
|
-
<property name="
|
37
|
+
<property name="layout-style">start</property>
|
38
38
|
<child>
|
39
39
|
<object class="GtkButton" id="buttonOk">
|
40
40
|
<property name="label" translatable="yes">Ok</property>
|
41
41
|
<property name="visible">True</property>
|
42
|
-
<property name="
|
43
|
-
<property name="
|
42
|
+
<property name="can-focus">True</property>
|
43
|
+
<property name="receives-default">True</property>
|
44
44
|
</object>
|
45
45
|
<packing>
|
46
46
|
<property name="expand">False</property>
|
@@ -1,16 +1,18 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/drag_drop/.vr_settings.yaml"
|
2
3
|
width: 1307
|
3
4
|
height: 698
|
4
5
|
panel_pos: 423
|
6
|
+
notebook_panel_position: 400
|
5
7
|
run_command_line: ruby main.rb
|
6
8
|
open_files:
|
7
9
|
- "/home/eric/vrp/vr3/examples/drag_drop/bin/DragDropDemo.rb"
|
10
|
+
- "/home/eric/vrp/vr3/examples/drag_drop/main.rb"
|
8
11
|
open_folders:
|
9
12
|
- "/home/eric/vrp/vr3/examples/drag_drop"
|
10
13
|
- "/home/eric/vrp/vr3/examples/drag_drop/bin"
|
11
|
-
|
14
|
+
- "/home/eric/vrp/vr3/examples/drag_drop/bin/glade"
|
15
|
+
current_file: "/home/eric/vrp/vr3/examples/drag_drop/main.rb"
|
16
|
+
current_line: 9
|
12
17
|
rdoc_command_line: rdoc -x README
|
13
|
-
vr_yaml_file: ".vr_settings.yaml"
|
14
|
-
notebook_panel_position: 400
|
15
|
-
current_line: 12
|
16
18
|
settings_file_version: 1
|
data/examples/drag_drop/main.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
1
|
|
3
|
-
|
4
|
-
require File.exists?("./../../lib/vrlib.rb") ? "./../../lib/vrlib.rb" : "vrlib"
|
2
|
+
require "vrlib"
|
5
3
|
|
6
4
|
# from require_all gem:
|
7
5
|
require_rel 'bin/'
|
8
6
|
|
9
|
-
|
10
7
|
DragDropDemo.new.show_glade()
|
11
8
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
|
-
vr_yaml_file: "
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/filetreeview/.vr_settings.yaml"
|
3
3
|
width: 1337
|
4
4
|
height: 691
|
5
5
|
panel_pos: 490
|
@@ -12,8 +12,9 @@ open_files:
|
|
12
12
|
open_folders:
|
13
13
|
- "/home/eric/vrp/vr3/examples/filetreeview"
|
14
14
|
- "/home/eric/vrp/vr3/examples/filetreeview/bin"
|
15
|
+
- "/home/eric/vrp/vr3/examples/filetreeview/bin/glade"
|
15
16
|
- "/home/eric/vrp/vr3/examples/filetreeview/img"
|
16
|
-
current_file: "/home/eric/vrp/vr3/examples/filetreeview/
|
17
|
+
current_file: "/home/eric/vrp/vr3/examples/filetreeview/main.rb"
|
17
18
|
current_line: 12
|
18
19
|
rdoc_command_line: rdoc -x README
|
19
20
|
settings_file_version: 1
|
@@ -15,8 +15,8 @@ open_folders:
|
|
15
15
|
- "/home/eric/vrp/vr3/examples/golf_handicap"
|
16
16
|
- "/home/eric/vrp/vr3/examples/golf_handicap/src"
|
17
17
|
- "/home/eric/vrp/vr3/examples/golf_handicap/src/glade"
|
18
|
-
current_file: "/home/eric/vrp/vr3/examples/golf_handicap/
|
19
|
-
current_line:
|
18
|
+
current_file: "/home/eric/vrp/vr3/examples/golf_handicap/golf_handicap"
|
19
|
+
current_line: 20
|
20
20
|
rdoc_command_line: rdoc -x README
|
21
21
|
builder: !ruby/object:Gtk::Builder {}
|
22
22
|
top_level_window: false
|
@@ -15,11 +15,11 @@ elsif answer == false
|
|
15
15
|
input_text: "",
|
16
16
|
button_yes: "Add Golfer"
|
17
17
|
)
|
18
|
-
exit unless golfer_name.is_a?(String)
|
19
|
-
exit unless golfer_name.length > 2
|
18
|
+
exit! unless golfer_name.is_a?(String)
|
19
|
+
exit! unless golfer_name.length > 2
|
20
20
|
load_file = golfer_name.downcase.tr("^a-z\s", '').gsub(" ", "_") + ".yaml"
|
21
21
|
else
|
22
|
-
exit
|
22
|
+
exit!
|
23
23
|
end
|
24
24
|
|
25
25
|
VR::load_yaml(Handicap, load_file).show_glade
|
@@ -12,7 +12,7 @@ open_files:
|
|
12
12
|
open_folders:
|
13
13
|
- "/home/eric/vrp/vr3/examples/listview"
|
14
14
|
- "/home/eric/vrp/vr3/examples/listview/bin"
|
15
|
-
current_file: "/home/eric/vrp/vr3/examples/listview/bin/
|
16
|
-
current_line:
|
15
|
+
current_file: "/home/eric/vrp/vr3/examples/listview/bin/SongListViewGUI.rb"
|
16
|
+
current_line: 42
|
17
17
|
rdoc_command_line: rdoc -x README
|
18
18
|
filename: ".vr_settings.yaml"
|
data/examples/listview/main.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
|
-
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/listview_objects/.vr_settings.yaml"
|
3
|
+
width: 1301
|
3
4
|
height: 665
|
4
5
|
panel_pos: 256
|
6
|
+
notebook_panel_position: 400
|
5
7
|
run_command_line: ruby main.rb
|
6
8
|
open_files:
|
7
9
|
- "/home/eric/vrp/vr3/examples/listview_objects/bin/ListViewObjectsGUI.rb"
|
8
10
|
- "/home/eric/vrp/vr3/examples/listview_objects/bin/ListViewObjects.rb"
|
9
11
|
- "/home/eric/vrp/vr3/examples/listview_objects/bin/DataObject.rb"
|
12
|
+
- "/home/eric/vrp/vr3/examples/listview_objects/main.rb"
|
10
13
|
open_folders:
|
11
14
|
- "/home/eric/vrp/vr3/examples/listview_objects"
|
12
15
|
- "/home/eric/vrp/vr3/examples/listview_objects/bin"
|
13
16
|
- "/home/eric/vrp/vr3/examples/listview_objects/bin/glade"
|
14
|
-
current_file: "/home/eric/vrp/vr3/examples/listview_objects/bin/
|
17
|
+
current_file: "/home/eric/vrp/vr3/examples/listview_objects/bin/ListViewObjects.rb"
|
18
|
+
current_line: 38
|
15
19
|
rdoc_command_line: rdoc -x README
|
16
|
-
vr_yaml_file: ".vr_settings.yaml"
|
17
|
-
notebook_panel_position: 400
|
18
|
-
current_line: 3
|
19
20
|
settings_file_version: 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
2
|
vr_yaml_file: "/home/eric/vrp/vr3/examples/phantom/.vr_settings.yaml"
|
3
|
-
width:
|
3
|
+
width: 953
|
4
4
|
height: 600
|
5
5
|
panel_pos: 360
|
6
6
|
notebook_panel_position: 400
|
@@ -13,5 +13,5 @@ open_folders:
|
|
13
13
|
- "/home/eric/vrp/vr3/examples/phantom/src"
|
14
14
|
- "/home/eric/vrp/vr3/examples/phantom/src/glade"
|
15
15
|
current_file: "/home/eric/vrp/vr3/examples/phantom/main.rb"
|
16
|
-
current_line:
|
16
|
+
current_line: 1
|
17
17
|
rdoc_command_line: rdoc -x README
|
data/examples/phantom/main.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Generated with glade 3.
|
2
|
+
<!-- Generated with glade 3.38.2 -->
|
3
3
|
<interface>
|
4
4
|
<requires lib="gtk+" version="3.0"/>
|
5
5
|
<object class="GtkWindow" id="window1">
|
6
|
-
<property name="
|
7
|
-
<property name="
|
8
|
-
<property name="
|
6
|
+
<property name="width-request">400</property>
|
7
|
+
<property name="can-focus">False</property>
|
8
|
+
<property name="window-position">center</property>
|
9
9
|
<child>
|
10
10
|
<object class="GtkBox" id="box1">
|
11
11
|
<property name="visible">True</property>
|
12
|
-
<property name="
|
13
|
-
<property name="
|
14
|
-
<property name="
|
15
|
-
<property name="
|
16
|
-
<property name="
|
12
|
+
<property name="can-focus">False</property>
|
13
|
+
<property name="margin-left">20</property>
|
14
|
+
<property name="margin-right">20</property>
|
15
|
+
<property name="margin-top">20</property>
|
16
|
+
<property name="margin-bottom">20</property>
|
17
17
|
<property name="orientation">vertical</property>
|
18
18
|
<property name="spacing">12</property>
|
19
19
|
<child>
|
20
20
|
<object class="GtkLabel" id="label1">
|
21
21
|
<property name="visible">True</property>
|
22
|
-
<property name="
|
22
|
+
<property name="can-focus">False</property>
|
23
23
|
<property name="label" translatable="yes"><big>Phantom Code</big></property>
|
24
|
-
<property name="
|
24
|
+
<property name="use-markup">True</property>
|
25
25
|
</object>
|
26
26
|
<packing>
|
27
27
|
<property name="expand">False</property>
|
@@ -32,10 +32,10 @@
|
|
32
32
|
<child>
|
33
33
|
<object class="GtkLabel" id="label2">
|
34
34
|
<property name="visible">True</property>
|
35
|
-
<property name="
|
35
|
+
<property name="can-focus">False</property>
|
36
36
|
<property name="label" translatable="yes">This is a program with almost no source code. Its just a an empty class that includes the GladeGUI module. Here's a list of tasks its doing:
|
37
37
|
|
38
|
-
1) Loading
|
38
|
+
1) Loading MyClass.glade into the @builder variable
|
39
39
|
2) Attaching the "clicked" signal to buttonCancel
|
40
40
|
3) Making it so the program terminates if you press "X"
|
41
41
|
4) Setting parent of this window if given.
|
@@ -50,8 +50,8 @@ MyClass.new.show_glade
|
|
50
50
|
|
51
51
|
</property>
|
52
52
|
<property name="wrap">True</property>
|
53
|
-
<property name="
|
54
|
-
<property name="
|
53
|
+
<property name="width-chars">60</property>
|
54
|
+
<property name="max-width-chars">33</property>
|
55
55
|
</object>
|
56
56
|
<packing>
|
57
57
|
<property name="expand">False</property>
|
@@ -62,16 +62,16 @@ MyClass.new.show_glade
|
|
62
62
|
<child>
|
63
63
|
<object class="GtkButtonBox" id="buttonbox1">
|
64
64
|
<property name="visible">True</property>
|
65
|
-
<property name="
|
65
|
+
<property name="can-focus">False</property>
|
66
66
|
<property name="halign">center</property>
|
67
67
|
<property name="valign">center</property>
|
68
|
-
<property name="
|
68
|
+
<property name="layout-style">start</property>
|
69
69
|
<child>
|
70
70
|
<object class="GtkButton" id="buttonCancel">
|
71
71
|
<property name="label" translatable="yes">Cancel</property>
|
72
72
|
<property name="visible">True</property>
|
73
|
-
<property name="
|
74
|
-
<property name="
|
73
|
+
<property name="can-focus">True</property>
|
74
|
+
<property name="receives-default">True</property>
|
75
75
|
</object>
|
76
76
|
<packing>
|
77
77
|
<property name="expand">True</property>
|
@@ -13,6 +13,6 @@ open_folders:
|
|
13
13
|
- "/home/eric/vrp/vr3/examples/settings_file"
|
14
14
|
- "/home/eric/vrp/vr3/examples/settings_file/bin"
|
15
15
|
- "/home/eric/vrp/vr3/examples/settings_file/bin/glade"
|
16
|
-
current_file: "/home/eric/vrp/vr3/examples/settings_file/bin/
|
17
|
-
current_line:
|
16
|
+
current_file: "/home/eric/vrp/vr3/examples/settings_file/bin/SavableSettings.rb"
|
17
|
+
current_line: 39
|
18
18
|
rdoc_command_line: rdoc -x README
|
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:SavableSettings
|
2
|
-
height:
|
3
|
-
width:
|
2
|
+
height: 414
|
3
|
+
width: 350
|
4
4
|
title: Savable Settings Demo
|
5
5
|
text: |-
|
6
6
|
Try running this program multiple times.
|
7
7
|
|
8
8
|
It will create a file named settings.yaml that stores the height, width, title, and text from this window, so the window will be restored to the same state as when you exited.
|
9
9
|
|
10
|
-
If you want to reset the file to the defaults, just delete the settings.
|
10
|
+
If you want to reset the file to the defaults, just delete the settings.yaml file.
|
11
11
|
|
12
12
|
You may need to click the 'Refresh' to see the settings.yaml file.
|
13
13
|
vr_yaml_file: "/home/eric/vrp/vr3/examples/settings_file/settings.yaml"
|
14
|
-
builder: !ruby/object:Gtk::Builder {}
|
15
|
-
top_level_window: false
|
@@ -1,7 +1,9 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
|
-
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/simple_ruby_gui/.vr_settings.yaml"
|
3
|
+
width: 1301
|
3
4
|
height: 692
|
4
5
|
panel_pos: 490
|
6
|
+
notebook_panel_position: 400
|
5
7
|
run_command_line: ruby main.rb
|
6
8
|
open_files:
|
7
9
|
- "/home/eric/vrp/vr3/examples/simple_ruby_gui/bin/DataObjectGUI.rb"
|
@@ -9,12 +11,9 @@ open_files:
|
|
9
11
|
open_folders:
|
10
12
|
- "/home/eric/vrp/vr3/examples/simple_ruby_gui"
|
11
13
|
- "/home/eric/vrp/vr3/examples/simple_ruby_gui/bin"
|
12
|
-
|
13
|
-
|
14
|
+
current_file: "/home/eric/vrp/vr3/examples/simple_ruby_gui/bin/DataObjectGUI.rb"
|
15
|
+
current_line: 22
|
14
16
|
rdoc_command_line: rdoc -x README
|
15
|
-
vr_yaml_file: ".vr_settings.yaml"
|
16
|
-
notebook_panel_position: 400
|
17
|
-
current_line: 13
|
18
|
-
settings_file_version: 1
|
19
17
|
builder: !ruby/object:Gtk::Builder {}
|
18
|
+
settings_file_version: 1
|
20
19
|
filename: ".vr_settings.yaml"
|
@@ -1,16 +1,14 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
-
#Updated for Gtk3!
|
4
3
|
|
5
|
-
|
6
|
-
require File.exists?("./../../lib/vrlib.rb") ? "./../../lib/vrlib.rb" : "vrlib"
|
4
|
+
require "vrlib"
|
7
5
|
|
8
6
|
# from require_all gem:
|
9
|
-
require_rel 'bin
|
7
|
+
require_rel 'bin'
|
10
8
|
|
11
9
|
|
12
|
-
|
10
|
+
form = DataObjectGUI.new("Harvey Milktoast", "123 Main, Hemet, CA 90090",
|
13
11
|
"harvey@harveyserver.com", "132-243-4323")
|
14
|
-
|
12
|
+
form.show_glade()
|
15
13
|
|
16
14
|
|
data/lib/ActLikeAHash.rb
CHANGED
data/lib/SavableHash.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
module VR
|
3
|
+
|
4
|
+
class SavableHash < Hash
|
5
|
+
|
6
|
+
def init(arg) #either file path or defaults hash
|
7
|
+
# if File(arg[:file]).exists
|
8
|
+
# return YAML.load(File.open(arg[:file]).read)
|
9
|
+
# else
|
10
|
+
arg
|
11
|
+
# end
|
12
|
+
end
|
13
|
+
|
14
|
+
def save()
|
15
|
+
file = self[:file]
|
16
|
+
alert file
|
17
|
+
File.open(file, "w") {|f| f.puts(self.to_yaml)}
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|