visualruby 3.6.3 → 3.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.vr_settings.yaml +22 -10
- data/all_requires.rb +35 -0
- data/examples/01_phantom/main.rb +6 -0
- data/examples/02_hello/.vr_settings.yaml +21 -0
- data/examples/{phantom → 02_hello}/main.rb +2 -3
- data/examples/02_hello/src/MyClass.rb +11 -0
- data/examples/02_hello/src/glade/MyClass.glade +36 -0
- data/examples/03_simple_ruby_gui/main.rb +11 -0
- data/examples/04_calculator/.vr_settings.yaml +21 -0
- data/examples/04_calculator/calculator.rb +7 -0
- data/examples/{calculator/bin/Calculator.rb → 04_calculator/src/CalculatorGUI.rb} +3 -3
- data/examples/07_event_handlers/.vr_settings.yaml +23 -0
- data/examples/07_event_handlers/main.rb +9 -0
- data/examples/07_event_handlers/src/MyClass.rb +26 -0
- data/examples/07_event_handlers/src/MyTextView.rb +13 -0
- data/examples/07_event_handlers/src/glade/MyClass.glade +90 -0
- data/examples/active_record/.vr_settings.yaml +2 -3
- data/examples/active_record/active_record.rb +1 -1
- data/examples/alert_box/.vr_settings.yaml +11 -8
- data/examples/alert_box/alertdemo.rb +11 -0
- data/examples/alert_box/{bin → src}/AlertBoxDemo.rb +19 -6
- data/examples/alert_box/{bin → src}/glade/AlertBoxDemo.glade +37 -4
- data/examples/all_widgets/.vr_settings.yaml +8 -7
- data/examples/all_widgets/{main.rb → all_widgets.rb} +1 -4
- data/examples/all_widgets/{bin → src}/AllWidgets.rb +1 -1
- data/examples/child_window/.vr_settings.yaml +10 -9
- data/examples/child_window/child_window.rb +11 -0
- data/examples/drag_drop/.vr_settings.yaml +6 -5
- data/examples/drag_drop/{main.rb → drag_drop.rb} +1 -3
- data/examples/filetreeview/.vr_settings.yaml +10 -8
- data/examples/filetreeview/filetreeview.rb +10 -0
- data/examples/filetreeview/{bin → src}/ProjectTree.rb +1 -12
- data/examples/filetreeview/{bin → src}/ProjectTreeGUI.rb +9 -0
- data/examples/filetreeview/{bin → src}/glade/ProjectTreeGUI.glade +37 -37
- data/examples/golf_handicap/.vr_settings.yaml +5 -6
- data/examples/golf_handicap/eric_cunningham.yaml +106 -0
- data/examples/golf_handicap/golf_handicap.rb +18 -0
- data/examples/golf_handicap/src/Handicap.rb +31 -29
- data/examples/golf_handicap/src/LoadGolfer.rb +27 -27
- data/examples/golf_handicap/src/Score.rb +10 -9
- data/examples/golf_handicap/src/glade/Handicap.glade +46 -42
- data/examples/golf_handicap/src/glade/Score.glade +58 -80
- data/examples/listview/.vr_settings.yaml +10 -8
- data/examples/listview/listview.rb +7 -0
- data/examples/listview/{bin → src}/SongListView.rb +2 -1
- data/examples/listview/{bin → src}/SongListViewGUI.rb +1 -0
- data/lib/Alert.rb +2 -2
- data/lib/GladeGUI.rb +10 -11
- data/lib/TestWindow.rb +33 -0
- data/lib/VR_GtkWindow.rb +7 -0
- data/lib/glade/TestWindow.glade +73 -0
- data/lib/treeview/TreeView.rb +0 -2
- data/lib/vrlib.rb +1 -0
- data/skeleton/project/main.rb +1 -4
- data/src/editor/VR_Document.rb +1 -4
- data/src/editor/VR_TabSearch.rb +1 -1
- data/src/main/RubygemsAPI.rb +3 -8
- data/src/main/SplashWindow.rb +18 -0
- data/src/main/VR_Main.rb +19 -26
- data/src/main/VR_Tools.rb +10 -8
- data/src/main/glade/VR_Main.glade +173 -178
- data/src/version.rb +1 -1
- data/test.rb +7 -0
- data/vr +40 -70
- metadata +59 -41
- data/examples/alert_box/main.rb +0 -9
- data/examples/calculator/.vr_settings.yaml +0 -19
- data/examples/calculator/main.rb +0 -9
- data/examples/filetreeview/main.rb +0 -11
- data/examples/listview/main.rb +0 -8
- data/examples/simple_ruby_gui/main.rb +0 -14
- /data/examples/{phantom → 01_phantom}/.vr_settings.yaml +0 -0
- /data/examples/{phantom → 01_phantom}/src/MyClass.rb +0 -0
- /data/examples/{phantom → 01_phantom}/src/glade/MyClass.glade +0 -0
- /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/.vr_settings.yaml +0 -0
- /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/bin/DataObjectGUI.rb +0 -0
- /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/bin/glade/DataObjectGUI.glade +0 -0
- /data/examples/{calculator/bin/glade/Calculator.glade → 04_calculator/src/glade/CalculatorGUI.glade} +0 -0
- /data/examples/all_widgets/{bin → src}/glade/AllWidgets.glade +0 -0
- /data/examples/all_widgets/{bin → src}/splash.png +0 -0
- /data/examples/child_window/{bin → src}/ChildWindowDemo.rb +0 -0
- /data/examples/child_window/{bin → src}/ModalWindow.rb +0 -0
- /data/examples/child_window/{bin → src}/ModelessWindow.rb +0 -0
- /data/examples/child_window/{bin → src}/MyChildClass.rb +0 -0
- /data/examples/child_window/{bin → src}/glade/ChildWindowDemo.glade +0 -0
- /data/examples/child_window/{bin → src}/glade/ModalWindow.glade +0 -0
- /data/examples/child_window/{bin → src}/glade/ModelessWindow.glade +0 -0
- /data/examples/child_window/{bin → src}/glade/MyChildClass.glade +0 -0
- /data/examples/drag_drop/{bin → src}/DragDropDemo.rb +0 -0
- /data/examples/drag_drop/{bin → src}/glade/DragDropDemo.glade +0 -0
- /data/examples/listview/{bin → src}/audio-x-generic.png +0 -0
- /data/examples/listview/{bin → src}/glade/SongListViewGUI.glade +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80554ad68e0334b36d244ce0fad1f1ab19f457e73a7f532784ad313d1c64fcee
|
4
|
+
data.tar.gz: 072e6206231fe8f714a17e77264e56501bf464dd219cab39002b139770efa468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ed37a16886053908d7676aefcaea56abda8d21e8737f7b2a902b75e12a88f050941b2a71801e8c54954f55cf7c20edd4da3d21ba5a7dac69e4bb3d0bd3db5d
|
7
|
+
data.tar.gz: ed254b3b1a6f07ee852d45b48039f017df2d7a4141ca2546ba8e8690d14a419c76e3da93a8aa85fbbaee9364fff206523c0c5bc85cc5fe07a34bc41767356b28
|
data/.vr_settings.yaml
CHANGED
@@ -1,22 +1,34 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
2
|
vr_yaml_file: "/home/eric/vrp/vr3/.vr_settings.yaml"
|
3
|
-
width:
|
4
|
-
height:
|
3
|
+
width: 1362
|
4
|
+
height: 702
|
5
5
|
panel_pos: 360
|
6
|
-
notebook_panel_position:
|
6
|
+
notebook_panel_position: 366
|
7
7
|
run_command_line: ruby vr
|
8
8
|
open_files:
|
9
|
-
- "/home/eric/vrp/vr3/
|
10
|
-
- "/home/eric/vrp/vr3/src/
|
11
|
-
- "/home/eric/vrp/vr3/src/
|
12
|
-
- "/home/eric/vrp/vr3/
|
9
|
+
- "/home/eric/vrp/vr3/src/main/OpenProject.rb"
|
10
|
+
- "/home/eric/vrp/vr3/src/main/ProjectTree.rb"
|
11
|
+
- "/home/eric/vrp/vr3/examples/listview/src/SongListViewGUI.rb"
|
12
|
+
- "/home/eric/vrp/vr3/examples/filetreeview/src/ProjectTree.rb"
|
13
|
+
- "/home/eric/vrp/vr3/examples/listview_objects/bin/ListViewObjectsGUI.rb"
|
13
14
|
- "/home/eric/vrp/vr3/lib/GladeGUI.rb"
|
14
|
-
- "/home/eric/vrp/vr3/lib/treeview/
|
15
|
+
- "/home/eric/vrp/vr3/lib/treeview/TreeView.rb"
|
16
|
+
- "/home/eric/vrp/vr3/lib/treeview/ListView.rb"
|
17
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/src/MyTextView.rb"
|
18
|
+
- "/home/eric/vrp/vr3/lib/treeview/FileTreeView.rb"
|
19
|
+
- "/home/eric/vrp/vr3/src/main/VR_File_Tree.rb"
|
20
|
+
- "/home/eric/vrp/vr3/src/version.rb"
|
21
|
+
- "/home/eric/vrp/vr3/vr"
|
22
|
+
- "/home/eric/vrp/vr3/src/main/VR_Main.rb"
|
15
23
|
open_folders:
|
16
24
|
- "/home/eric/vrp/vr3"
|
25
|
+
- "/home/eric/vrp/vr3/examples"
|
26
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers"
|
27
|
+
- "/home/eric/vrp/vr3/lib"
|
28
|
+
- "/home/eric/vrp/vr3/lib/treeview"
|
17
29
|
- "/home/eric/vrp/vr3/src"
|
18
|
-
current_file: "/home/eric/vrp/vr3/
|
19
|
-
current_line:
|
30
|
+
current_file: "/home/eric/vrp/vr3/src/main/VR_Main.rb"
|
31
|
+
current_line: 60
|
20
32
|
rdoc_command_line: rdoc -x README
|
21
33
|
builder: !ruby/object:Gtk::Builder {}
|
22
34
|
top_level_window: false
|
data/all_requires.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "yaml" #needed
|
3
|
+
require "net/http" #needed
|
4
|
+
require "net/https" #needed
|
5
|
+
require "fileutils" #needed
|
6
|
+
require "rubygems/installer"
|
7
|
+
require "rubygems/uninstaller"
|
8
|
+
require "rubygems/package"
|
9
|
+
require "rubygems/specification"
|
10
|
+
|
11
|
+
require_relative 'lib/vrlib'
|
12
|
+
|
13
|
+
require_relative "src/version"
|
14
|
+
|
15
|
+
require_relative 'src/editor/VR_TextViewCommon'
|
16
|
+
require_relative "src/editor/VR_TextShell"
|
17
|
+
require_relative "src/editor/VR_TabSearch"
|
18
|
+
require_relative "src/editor/VR_Tabs"
|
19
|
+
require_relative "src/editor/VR_Document"
|
20
|
+
|
21
|
+
|
22
|
+
require_relative "src/main/GemTree"
|
23
|
+
require_relative "src/main/NewProjectGUI"
|
24
|
+
require_relative "src/main/OpenProject"
|
25
|
+
require_relative "src/main/ProjectTree"
|
26
|
+
require_relative "src/main/RubygemsAPI"
|
27
|
+
require_relative "src/main/VR_ENV_GLOBAL"
|
28
|
+
require_relative "src/main/VR_ENV"
|
29
|
+
require_relative "src/main/VR_File_Tree"
|
30
|
+
require_relative "src/main/VR_Local_Gem_Tree"
|
31
|
+
require_relative "src/main/VR_Main"
|
32
|
+
require_relative "src/main/VR_Remote_Gem_Tree"
|
33
|
+
require_relative "src/main/VR_Tools"
|
34
|
+
|
35
|
+
require_relative "lib/TestWindow"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
--- !ruby/object:VR_ENV
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/02_hello/.vr_settings.yaml"
|
3
|
+
width: 1366
|
4
|
+
height: 706
|
5
|
+
panel_pos: 360
|
6
|
+
notebook_panel_position: 400
|
7
|
+
run_command_line: ruby main.rb
|
8
|
+
open_files:
|
9
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/Untitled"
|
10
|
+
open_folders:
|
11
|
+
- "/home/eric/vrp/vr3/examples/02_hello"
|
12
|
+
current_file: "/home/eric/vrp/vr3/examples/07_event_handlers/Untitled"
|
13
|
+
current_line: 1
|
14
|
+
rdoc_command_line: rdoc -x README
|
15
|
+
builder: !ruby/object:Gtk::Builder {}
|
16
|
+
top_level_window: false
|
17
|
+
browser: firefox
|
18
|
+
backup_path: "/home/eric"
|
19
|
+
tab_spaces: 2
|
20
|
+
glade_path: glade-3
|
21
|
+
font_name: Monospace 10
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- Generated with glade 3.40.0 -->
|
3
|
+
<interface>
|
4
|
+
<requires lib="gtk+" version="3.0"/>
|
5
|
+
<object class="GtkWindow" id="window1">
|
6
|
+
<property name="can-focus">False</property>
|
7
|
+
<property name="window-position">center</property>
|
8
|
+
<child>
|
9
|
+
<object class="GtkButtonBox" id="buttonbox1">
|
10
|
+
<property name="visible">True</property>
|
11
|
+
<property name="can-focus">False</property>
|
12
|
+
<property name="halign">center</property>
|
13
|
+
<property name="valign">center</property>
|
14
|
+
<property name="margin-left">50</property>
|
15
|
+
<property name="margin-right">50</property>
|
16
|
+
<property name="margin-top">50</property>
|
17
|
+
<property name="margin-bottom">50</property>
|
18
|
+
<property name="orientation">vertical</property>
|
19
|
+
<property name="layout-style">start</property>
|
20
|
+
<child>
|
21
|
+
<object class="GtkButton" id="ui_hello_btn">
|
22
|
+
<property name="label" translatable="yes">Hello World</property>
|
23
|
+
<property name="visible">True</property>
|
24
|
+
<property name="can-focus">True</property>
|
25
|
+
<property name="receives-default">True</property>
|
26
|
+
</object>
|
27
|
+
<packing>
|
28
|
+
<property name="expand">True</property>
|
29
|
+
<property name="fill">True</property>
|
30
|
+
<property name="position">0</property>
|
31
|
+
</packing>
|
32
|
+
</child>
|
33
|
+
</object>
|
34
|
+
</child>
|
35
|
+
</object>
|
36
|
+
</interface>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
--- !ruby/object:VR_ENV
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/calculator/.vr_settings.yaml"
|
3
|
+
width: 1028
|
4
|
+
height: 691
|
5
|
+
panel_pos: 365
|
6
|
+
notebook_panel_position: 400
|
7
|
+
run_command_line: ruby calculator.rb
|
8
|
+
open_files:
|
9
|
+
- "/home/eric/vrp/vr3/examples/calculator/calculator.rb"
|
10
|
+
- "/home/eric/vrp/vr3/examples/calculator/src/CalculatorGUI.rb"
|
11
|
+
open_folders:
|
12
|
+
- "/home/eric/vrp/vr3/examples/calculator"
|
13
|
+
- "/home/eric/vrp/vr3/examples/calculator/src"
|
14
|
+
- "/home/eric/vrp/vr3/examples/calculator/src/glade"
|
15
|
+
current_file: "/home/eric/vrp/vr3/examples/calculator/src/CalculatorGUI.rb"
|
16
|
+
current_line: 24
|
17
|
+
rdoc_command_line: rdoc -x README
|
18
|
+
builder: !ruby/object:Gtk::Builder {}
|
19
|
+
settings_file_version: 1
|
20
|
+
top_level_window: false
|
21
|
+
filename: ".vr_settings.yaml"
|
@@ -19,14 +19,14 @@
|
|
19
19
|
#
|
20
20
|
|
21
21
|
|
22
|
-
class
|
22
|
+
class CalculatorGUI
|
23
23
|
|
24
24
|
include GladeGUI
|
25
25
|
|
26
26
|
def before_show()
|
27
27
|
@window1 = "Calculator" #sets window1's title to "Calculator"
|
28
|
-
@button =
|
29
|
-
[
|
28
|
+
@button = [ 1, 2, 3, "C" ] +
|
29
|
+
[ 4, 5, 6, "+" ] +
|
30
30
|
[ 7, 8, 9, "-" ] +
|
31
31
|
[ 0, ".","/","=" ]
|
32
32
|
@clear_display = false
|
@@ -0,0 +1,23 @@
|
|
1
|
+
--- !ruby/object:VR_ENV
|
2
|
+
vr_yaml_file: "/home/eric/vrp/vr3/examples/07_event_handlers/.vr_settings.yaml"
|
3
|
+
width: 1041
|
4
|
+
height: 600
|
5
|
+
panel_pos: 360
|
6
|
+
notebook_panel_position: 400
|
7
|
+
run_command_line: ruby main.rb
|
8
|
+
open_files:
|
9
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/main.rb"
|
10
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/src/MyClass.rb"
|
11
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/src/MyTextView.rb"
|
12
|
+
open_folders:
|
13
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers"
|
14
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/src"
|
15
|
+
- "/home/eric/vrp/vr3/examples/07_event_handlers/src/glade"
|
16
|
+
current_file: "/home/eric/vrp/vr3/examples/07_event_handlers/src/MyTextView.rb"
|
17
|
+
current_line: 10
|
18
|
+
rdoc_command_line: rdoc -x README
|
19
|
+
browser: firefox
|
20
|
+
backup_path: "/home/eric"
|
21
|
+
tab_spaces: 2
|
22
|
+
glade_path: glade-3
|
23
|
+
font_name: Monospace 10
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class MyClass < MyTextView #(change name)
|
3
|
+
|
4
|
+
include GladeGUI
|
5
|
+
|
6
|
+
def before_show()
|
7
|
+
@another_var = @builder["ui_use_variable_but"]
|
8
|
+
@builder["scrolledwindow1"].add(self)
|
9
|
+
self.visible = true
|
10
|
+
end
|
11
|
+
|
12
|
+
def ui_normal_but__clicked(*args)
|
13
|
+
alert("The ui_normal_but__clicked method called")
|
14
|
+
end
|
15
|
+
|
16
|
+
def my_var__clicked(*args)
|
17
|
+
alert("The my_var__clicked method called!")
|
18
|
+
end
|
19
|
+
|
20
|
+
def another_var__clicked(*args)
|
21
|
+
alert("The another_var__clicked method called!")
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- Generated with glade 3.40.0 -->
|
3
|
+
<interface>
|
4
|
+
<requires lib="gtk+" version="3.0"/>
|
5
|
+
<object class="GtkWindow" id="window1">
|
6
|
+
<property name="width-request">300</property>
|
7
|
+
<property name="height-request">300</property>
|
8
|
+
<property name="can-focus">False</property>
|
9
|
+
<property name="window-position">center</property>
|
10
|
+
<child>
|
11
|
+
<object class="GtkBox" id="box1">
|
12
|
+
<property name="visible">True</property>
|
13
|
+
<property name="can-focus">False</property>
|
14
|
+
<property name="orientation">vertical</property>
|
15
|
+
<child>
|
16
|
+
<object class="GtkLabel" id="label">
|
17
|
+
<property name="visible">True</property>
|
18
|
+
<property name="can-focus">False</property>
|
19
|
+
<property name="ypad">16</property>
|
20
|
+
<property name="label" translatable="yes"><big>Event Handlers</big></property>
|
21
|
+
<property name="use-markup">True</property>
|
22
|
+
</object>
|
23
|
+
<packing>
|
24
|
+
<property name="expand">False</property>
|
25
|
+
<property name="fill">True</property>
|
26
|
+
<property name="position">0</property>
|
27
|
+
</packing>
|
28
|
+
</child>
|
29
|
+
<child>
|
30
|
+
<object class="GtkButtonBox" id="buttonbox1">
|
31
|
+
<property name="visible">True</property>
|
32
|
+
<property name="can-focus">False</property>
|
33
|
+
<property name="orientation">vertical</property>
|
34
|
+
<property name="spacing">16</property>
|
35
|
+
<property name="homogeneous">True</property>
|
36
|
+
<property name="layout-style">start</property>
|
37
|
+
<child>
|
38
|
+
<object class="GtkButton" id="ui_normal_but">
|
39
|
+
<property name="label" translatable="yes">glade ID: ui_normal_but</property>
|
40
|
+
<property name="visible">True</property>
|
41
|
+
<property name="can-focus">True</property>
|
42
|
+
<property name="receives-default">True</property>
|
43
|
+
</object>
|
44
|
+
<packing>
|
45
|
+
<property name="expand">True</property>
|
46
|
+
<property name="fill">True</property>
|
47
|
+
<property name="position">0</property>
|
48
|
+
</packing>
|
49
|
+
</child>
|
50
|
+
<child>
|
51
|
+
<object class="GtkButton" id="ui_use_variable_but">
|
52
|
+
<property name="label" translatable="yes">glade ID: ui_use_variable_but</property>
|
53
|
+
<property name="visible">True</property>
|
54
|
+
<property name="can-focus">True</property>
|
55
|
+
<property name="receives-default">True</property>
|
56
|
+
</object>
|
57
|
+
<packing>
|
58
|
+
<property name="expand">True</property>
|
59
|
+
<property name="fill">True</property>
|
60
|
+
<property name="position">1</property>
|
61
|
+
</packing>
|
62
|
+
</child>
|
63
|
+
</object>
|
64
|
+
<packing>
|
65
|
+
<property name="expand">False</property>
|
66
|
+
<property name="fill">True</property>
|
67
|
+
<property name="position">1</property>
|
68
|
+
</packing>
|
69
|
+
</child>
|
70
|
+
<child>
|
71
|
+
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
72
|
+
<property name="visible">True</property>
|
73
|
+
<property name="can-focus">True</property>
|
74
|
+
<property name="hexpand">True</property>
|
75
|
+
<property name="vexpand">True</property>
|
76
|
+
<property name="shadow-type">in</property>
|
77
|
+
<child>
|
78
|
+
<placeholder/>
|
79
|
+
</child>
|
80
|
+
</object>
|
81
|
+
<packing>
|
82
|
+
<property name="expand">False</property>
|
83
|
+
<property name="fill">True</property>
|
84
|
+
<property name="position">2</property>
|
85
|
+
</packing>
|
86
|
+
</child>
|
87
|
+
</object>
|
88
|
+
</child>
|
89
|
+
</object>
|
90
|
+
</interface>
|
@@ -6,14 +6,13 @@ panel_pos: 360
|
|
6
6
|
notebook_panel_position: 400
|
7
7
|
run_command_line: ruby active_record.rb
|
8
8
|
open_files:
|
9
|
-
- "/home/eric/vrp/vr3/examples/active_record/active_record.rb"
|
10
9
|
- "/home/eric/vrp/vr3/examples/active_record/bin/Person.rb"
|
11
10
|
open_folders:
|
12
11
|
- "/home/eric/vrp/vr3/examples/active_record"
|
13
12
|
- "/home/eric/vrp/vr3/examples/active_record/bin"
|
14
13
|
- "/home/eric/vrp/vr3/examples/active_record/bin/glade"
|
15
|
-
current_file: "/home/eric/vrp/vr3/examples/active_record/
|
16
|
-
current_line:
|
14
|
+
current_file: "/home/eric/vrp/vr3/examples/active_record/bin/Person.rb"
|
15
|
+
current_line: 22
|
17
16
|
rdoc_command_line: rdoc -x README
|
18
17
|
builder: !ruby/object:Gtk::Builder {}
|
19
18
|
top_level_window: false
|
@@ -1,16 +1,19 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
2
|
vr_yaml_file: "/home/eric/vrp/vr3/examples/alert_box/.vr_settings.yaml"
|
3
|
-
width:
|
4
|
-
height:
|
3
|
+
width: 1366
|
4
|
+
height: 706
|
5
5
|
panel_pos: 360
|
6
6
|
notebook_panel_position: 400
|
7
|
-
run_command_line: ruby
|
7
|
+
run_command_line: ruby alertdemo.rb
|
8
8
|
open_files:
|
9
|
-
- "/home/eric/vrp/vr3/examples/alert_box/
|
9
|
+
- "/home/eric/vrp/vr3/examples/alert_box/alertdemo.rb"
|
10
|
+
- "/home/eric/vrp/vr3/examples/alert_box/src/AlertBoxDemo.rb"
|
10
11
|
open_folders:
|
11
12
|
- "/home/eric/vrp/vr3/examples/alert_box"
|
12
|
-
- "/home/eric/vrp/vr3/examples/alert_box/
|
13
|
-
- "/home/eric/vrp/vr3/examples/alert_box/
|
14
|
-
current_file: "/home/eric/vrp/vr3/examples/alert_box/
|
15
|
-
current_line:
|
13
|
+
- "/home/eric/vrp/vr3/examples/alert_box/src"
|
14
|
+
- "/home/eric/vrp/vr3/examples/alert_box/src/glade"
|
15
|
+
current_file: "/home/eric/vrp/vr3/examples/alert_box/src/AlertBoxDemo.rb"
|
16
|
+
current_line: 84
|
16
17
|
rdoc_command_line: rdoc -x README
|
18
|
+
builder: !ruby/object:Gtk::Builder {}
|
19
|
+
top_level_window: false
|
@@ -42,22 +42,20 @@ class AlertBoxDemo
|
|
42
42
|
|
43
43
|
# input boxes will return the string entered, false, or nil for "X" button:
|
44
44
|
def buttonInput__clicked(*a)
|
45
|
-
if answer = alert("Enter your full name:", :
|
46
|
-
:
|
45
|
+
if answer = alert("Enter your full name:", input_text: "Ralph",
|
46
|
+
button_yes: "Go", headline: "Enter Name")
|
47
47
|
alert "You entered:\n\n<b>" + answer + "</b>"
|
48
48
|
elsif answer == false
|
49
49
|
alert "You pressed the <b>Cancel</b> button"
|
50
50
|
elsif answer.nil?
|
51
51
|
alert "You pressed the <b>'X'</b> button"
|
52
|
-
else
|
53
|
-
# will never get here
|
54
52
|
end
|
55
53
|
end
|
56
54
|
|
57
55
|
def buttonQuestion__clicked(*a)
|
58
56
|
if answer = alert("Your pants are on <b><u>fire</u></b>. What do you want to do?", :width => 500, :button_cancel => "Quit",
|
59
|
-
:
|
60
|
-
:
|
57
|
+
button_yes: "Jump in Pool", button_no: "Panic!",
|
58
|
+
title: "Pants on Fire", headline: "Warning")
|
61
59
|
alert "Get going!\n(alert() returned true)"
|
62
60
|
elsif answer == false # Panic
|
63
61
|
alert "Start Panicing!\n(alert() returned false)"
|
@@ -66,5 +64,20 @@ class AlertBoxDemo
|
|
66
64
|
end
|
67
65
|
end
|
68
66
|
|
67
|
+
def buttonChoices__clicked(*a)
|
68
|
+
names = ["Fred Flinstone", "Barney Rubble", "Pebbles"]
|
69
|
+
user_id = [ 912343, 893833, 874633 ]
|
70
|
+
|
71
|
+
answer = alert("Choose Person:", choices: names, button_no: "New Person")
|
72
|
+
|
73
|
+
if answer.is_a?(String)
|
74
|
+
alert ("You chose: #{answer}\nUser_id: #{user_id[names.index(answer)].to_s}")
|
75
|
+
elsif answer == false #no_button pressed = new name
|
76
|
+
new_name = alert("Enter New Person:", input_text: "")
|
77
|
+
elsif answer.nil?
|
78
|
+
alert "You pressed the 'X' button"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
69
82
|
end
|
70
83
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Generated with glade 3.
|
2
|
+
<!-- Generated with glade 3.40.0 -->
|
3
3
|
<interface>
|
4
4
|
<requires lib="gtk+" version="3.0"/>
|
5
5
|
<object class="GtkWindow" id="window1">
|
@@ -30,7 +30,7 @@
|
|
30
30
|
</packing>
|
31
31
|
</child>
|
32
32
|
<child>
|
33
|
-
<!-- n-columns=3 n-rows=
|
33
|
+
<!-- n-columns=3 n-rows=5 -->
|
34
34
|
<object class="GtkGrid" id="grid1">
|
35
35
|
<property name="visible">True</property>
|
36
36
|
<property name="can-focus">False</property>
|
@@ -126,7 +126,8 @@ This just shows a message on the screen. Its very useful for alerts and debuggi
|
|
126
126
|
<property name="can-focus">False</property>
|
127
127
|
<property name="halign">start</property>
|
128
128
|
<property name="label" translatable="yes"><big>Request Input Example</big>
|
129
|
-
This example shows how you can ask the user to enter text into a textbox
|
129
|
+
This example shows how you can ask the user to enter text into a textbox.
|
130
|
+
alert() will return nil or string.</property>
|
130
131
|
<property name="use-markup">True</property>
|
131
132
|
</object>
|
132
133
|
<packing>
|
@@ -140,7 +141,8 @@ This example shows how you can ask the user to enter text into a textbox.</prope
|
|
140
141
|
<property name="can-focus">False</property>
|
141
142
|
<property name="halign">start</property>
|
142
143
|
<property name="label" translatable="yes"><big>Ask Any Question</big>
|
143
|
-
Change the text on the buttons to ask anything
|
144
|
+
Change the text on the buttons to ask anything.
|
145
|
+
alert() will return nil, true or false.</property>
|
144
146
|
<property name="use-markup">True</property>
|
145
147
|
</object>
|
146
148
|
<packing>
|
@@ -148,6 +150,37 @@ Change the text on the buttons to ask anything</property>
|
|
148
150
|
<property name="top-attach">3</property>
|
149
151
|
</packing>
|
150
152
|
</child>
|
153
|
+
<child>
|
154
|
+
<object class="GtkLabel">
|
155
|
+
<property name="visible">True</property>
|
156
|
+
<property name="can-focus">False</property>
|
157
|
+
<property name="halign">start</property>
|
158
|
+
<property name="label" translatable="yes"><big>Select From a List of Choices</big>
|
159
|
+
Give it an array of choices, and you can select one.
|
160
|
+
alert() will return a chosen string, or nil.</property>
|
161
|
+
<property name="use-markup">True</property>
|
162
|
+
</object>
|
163
|
+
<packing>
|
164
|
+
<property name="left-attach">0</property>
|
165
|
+
<property name="top-attach">4</property>
|
166
|
+
</packing>
|
167
|
+
</child>
|
168
|
+
<child>
|
169
|
+
<object class="GtkButton" id="buttonChoices">
|
170
|
+
<property name="label" translatable="yes">Try</property>
|
171
|
+
<property name="visible">True</property>
|
172
|
+
<property name="can-focus">True</property>
|
173
|
+
<property name="receives-default">True</property>
|
174
|
+
<property name="valign">start</property>
|
175
|
+
</object>
|
176
|
+
<packing>
|
177
|
+
<property name="left-attach">1</property>
|
178
|
+
<property name="top-attach">4</property>
|
179
|
+
</packing>
|
180
|
+
</child>
|
181
|
+
<child>
|
182
|
+
<placeholder/>
|
183
|
+
</child>
|
151
184
|
<child>
|
152
185
|
<placeholder/>
|
153
186
|
</child>
|
@@ -4,16 +4,17 @@ width: 1125
|
|
4
4
|
height: 688
|
5
5
|
panel_pos: 327
|
6
6
|
notebook_panel_position: 400
|
7
|
-
run_command_line: ruby
|
7
|
+
run_command_line: ruby all_widgets.rb
|
8
8
|
open_files:
|
9
|
-
- "/home/eric/vrp/vr3/examples/all_widgets/
|
10
|
-
- "/home/eric/vrp/vr3/examples/all_widgets/
|
9
|
+
- "/home/eric/vrp/vr3/examples/all_widgets/all_widgets.rb"
|
10
|
+
- "/home/eric/vrp/vr3/examples/all_widgets/src/AllWidgets.rb"
|
11
11
|
open_folders:
|
12
12
|
- "/home/eric/vrp/vr3/examples/all_widgets"
|
13
|
-
- "/home/eric/vrp/vr3/examples/all_widgets/
|
14
|
-
- "/home/eric/vrp/vr3/examples/all_widgets/
|
15
|
-
current_file: "/home/eric/vrp/vr3/examples/all_widgets/
|
16
|
-
current_line:
|
13
|
+
- "/home/eric/vrp/vr3/examples/all_widgets/src"
|
14
|
+
- "/home/eric/vrp/vr3/examples/all_widgets/src/glade"
|
15
|
+
current_file: "/home/eric/vrp/vr3/examples/all_widgets/src/AllWidgets.rb"
|
16
|
+
current_line: 32
|
17
17
|
rdoc_command_line: rdoc -x README
|
18
18
|
builder: !ruby/object:Gtk::Builder {}
|
19
19
|
settings_file_version: 1
|
20
|
+
top_level_window: false
|