visualruby 3.6.3 → 3.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.vr_settings.yaml +22 -10
  3. data/all_requires.rb +35 -0
  4. data/examples/01_phantom/main.rb +6 -0
  5. data/examples/02_hello/.vr_settings.yaml +21 -0
  6. data/examples/{phantom → 02_hello}/main.rb +2 -3
  7. data/examples/02_hello/src/MyClass.rb +11 -0
  8. data/examples/02_hello/src/glade/MyClass.glade +36 -0
  9. data/examples/03_simple_ruby_gui/main.rb +11 -0
  10. data/examples/04_calculator/.vr_settings.yaml +21 -0
  11. data/examples/04_calculator/calculator.rb +7 -0
  12. data/examples/{calculator/bin/Calculator.rb → 04_calculator/src/CalculatorGUI.rb} +3 -3
  13. data/examples/07_event_handlers/.vr_settings.yaml +23 -0
  14. data/examples/07_event_handlers/main.rb +9 -0
  15. data/examples/07_event_handlers/src/MyClass.rb +26 -0
  16. data/examples/07_event_handlers/src/MyTextView.rb +13 -0
  17. data/examples/07_event_handlers/src/glade/MyClass.glade +90 -0
  18. data/examples/active_record/.vr_settings.yaml +2 -3
  19. data/examples/active_record/active_record.rb +1 -1
  20. data/examples/alert_box/.vr_settings.yaml +11 -8
  21. data/examples/alert_box/alertdemo.rb +11 -0
  22. data/examples/alert_box/{bin → src}/AlertBoxDemo.rb +19 -6
  23. data/examples/alert_box/{bin → src}/glade/AlertBoxDemo.glade +37 -4
  24. data/examples/all_widgets/.vr_settings.yaml +8 -7
  25. data/examples/all_widgets/{main.rb → all_widgets.rb} +1 -4
  26. data/examples/all_widgets/{bin → src}/AllWidgets.rb +1 -1
  27. data/examples/child_window/.vr_settings.yaml +10 -9
  28. data/examples/child_window/child_window.rb +11 -0
  29. data/examples/drag_drop/.vr_settings.yaml +6 -5
  30. data/examples/drag_drop/{main.rb → drag_drop.rb} +1 -3
  31. data/examples/filetreeview/.vr_settings.yaml +10 -8
  32. data/examples/filetreeview/filetreeview.rb +10 -0
  33. data/examples/filetreeview/{bin → src}/ProjectTree.rb +1 -12
  34. data/examples/filetreeview/{bin → src}/ProjectTreeGUI.rb +9 -0
  35. data/examples/filetreeview/{bin → src}/glade/ProjectTreeGUI.glade +37 -37
  36. data/examples/golf_handicap/.vr_settings.yaml +5 -6
  37. data/examples/golf_handicap/eric_cunningham.yaml +106 -0
  38. data/examples/golf_handicap/golf_handicap.rb +18 -0
  39. data/examples/golf_handicap/src/Handicap.rb +31 -29
  40. data/examples/golf_handicap/src/LoadGolfer.rb +27 -27
  41. data/examples/golf_handicap/src/Score.rb +10 -9
  42. data/examples/golf_handicap/src/glade/Handicap.glade +46 -42
  43. data/examples/golf_handicap/src/glade/Score.glade +58 -80
  44. data/examples/listview/.vr_settings.yaml +10 -8
  45. data/examples/listview/listview.rb +7 -0
  46. data/examples/listview/{bin → src}/SongListView.rb +2 -1
  47. data/examples/listview/{bin → src}/SongListViewGUI.rb +1 -0
  48. data/lib/Alert.rb +2 -2
  49. data/lib/GladeGUI.rb +10 -11
  50. data/lib/TestWindow.rb +33 -0
  51. data/lib/VR_GtkWindow.rb +7 -0
  52. data/lib/glade/TestWindow.glade +73 -0
  53. data/lib/treeview/TreeView.rb +0 -2
  54. data/lib/vrlib.rb +1 -0
  55. data/skeleton/project/main.rb +1 -4
  56. data/src/editor/VR_Document.rb +1 -4
  57. data/src/editor/VR_TabSearch.rb +1 -1
  58. data/src/main/RubygemsAPI.rb +3 -8
  59. data/src/main/SplashWindow.rb +18 -0
  60. data/src/main/VR_Main.rb +19 -26
  61. data/src/main/VR_Tools.rb +10 -8
  62. data/src/main/glade/VR_Main.glade +173 -178
  63. data/src/version.rb +1 -1
  64. data/test.rb +7 -0
  65. data/vr +40 -70
  66. metadata +59 -41
  67. data/examples/alert_box/main.rb +0 -9
  68. data/examples/calculator/.vr_settings.yaml +0 -19
  69. data/examples/calculator/main.rb +0 -9
  70. data/examples/filetreeview/main.rb +0 -11
  71. data/examples/listview/main.rb +0 -8
  72. data/examples/simple_ruby_gui/main.rb +0 -14
  73. /data/examples/{phantom → 01_phantom}/.vr_settings.yaml +0 -0
  74. /data/examples/{phantom → 01_phantom}/src/MyClass.rb +0 -0
  75. /data/examples/{phantom → 01_phantom}/src/glade/MyClass.glade +0 -0
  76. /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/.vr_settings.yaml +0 -0
  77. /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/bin/DataObjectGUI.rb +0 -0
  78. /data/examples/{simple_ruby_gui → 03_simple_ruby_gui}/bin/glade/DataObjectGUI.glade +0 -0
  79. /data/examples/{calculator/bin/glade/Calculator.glade → 04_calculator/src/glade/CalculatorGUI.glade} +0 -0
  80. /data/examples/all_widgets/{bin → src}/glade/AllWidgets.glade +0 -0
  81. /data/examples/all_widgets/{bin → src}/splash.png +0 -0
  82. /data/examples/child_window/{bin → src}/ChildWindowDemo.rb +0 -0
  83. /data/examples/child_window/{bin → src}/ModalWindow.rb +0 -0
  84. /data/examples/child_window/{bin → src}/ModelessWindow.rb +0 -0
  85. /data/examples/child_window/{bin → src}/MyChildClass.rb +0 -0
  86. /data/examples/child_window/{bin → src}/glade/ChildWindowDemo.glade +0 -0
  87. /data/examples/child_window/{bin → src}/glade/ModalWindow.glade +0 -0
  88. /data/examples/child_window/{bin → src}/glade/ModelessWindow.glade +0 -0
  89. /data/examples/child_window/{bin → src}/glade/MyChildClass.glade +0 -0
  90. /data/examples/drag_drop/{bin → src}/DragDropDemo.rb +0 -0
  91. /data/examples/drag_drop/{bin → src}/glade/DragDropDemo.glade +0 -0
  92. /data/examples/listview/{bin → src}/audio-x-generic.png +0 -0
  93. /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: 57fe878918ab52b3998ff5642cbf83f791d33af25ad33f20ea4b89f622040714
4
- data.tar.gz: 91cd0e95e279e85a2298bf659a26bb32302b7daf1e9592708479d1d807c14277
3
+ metadata.gz: 80554ad68e0334b36d244ce0fad1f1ab19f457e73a7f532784ad313d1c64fcee
4
+ data.tar.gz: 072e6206231fe8f714a17e77264e56501bf464dd219cab39002b139770efa468
5
5
  SHA512:
6
- metadata.gz: e492484dd649da75f806c28f27809ca2a6c67e62a11cb9208b12ce171240f324213820312fe6798c43d30d3dc754d546f6ecba3068e550dd0229b9816cb4fea8
7
- data.tar.gz: 9375bf701e38a40cfd0598e0f296bf584fc29e016ce8928c808c252f889c215d63843eb1d5a2962cb5f6bda4a58c1515fe4db4f3f41de5a6b42355b70ed5738d
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: 800
4
- height: 600
3
+ width: 1362
4
+ height: 702
5
5
  panel_pos: 360
6
- notebook_panel_position: 400
6
+ notebook_panel_position: 366
7
7
  run_command_line: ruby vr
8
8
  open_files:
9
- - "/home/eric/vrp/vr3/vr.gemspec"
10
- - "/home/eric/vrp/vr3/src/version.rb"
11
- - "/home/eric/vrp/vr3/src/main/RubygemsAPI.rb"
12
- - "/home/eric/vrp/vr3/lib/Alert.rb"
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/ViewCommon.rb"
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/lib/GladeGUI.rb"
19
- current_line: 370
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,6 @@
1
+ require "vrlib"
2
+
3
+ require_relative "src/MyClass.rb"
4
+
5
+ MyClass.new.show_glade()
6
+
@@ -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
@@ -1,8 +1,7 @@
1
- require "vrlib"
2
1
 
3
- # from require_all gem:
4
- require_rel 'src/'
2
+ require "vrlib"
5
3
 
4
+ require_relative "src/MyClass"
6
5
 
7
6
  MyClass.new.show_glade()
8
7
 
@@ -0,0 +1,11 @@
1
+
2
+ class MyClass #(change name)
3
+
4
+ include GladeGUI
5
+
6
+ def ui_hello_btn__clicked(*args)
7
+ @builder["ui_hello_btn"].label = "Goodbye World"
8
+ end
9
+
10
+ end
11
+
@@ -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,11 @@
1
+
2
+ require "vrlib"
3
+
4
+ require_relative "src/DataObjectGUI"
5
+
6
+
7
+ form = DataObjectGUI.new("Harry Milktoast", "123 Main, San Clemente, CA 90090",
8
+ "harvey@harveyserver.com", "132-243-4323")
9
+ form.show_glade()
10
+
11
+
@@ -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"
@@ -0,0 +1,7 @@
1
+
2
+ require "vrlib"
3
+
4
+ require_relative "src/CalculatorGUI"
5
+
6
+ CalculatorGUI.new.show_glade()
7
+
@@ -19,14 +19,14 @@
19
19
  #
20
20
 
21
21
 
22
- class Calculator
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 = [ 1, 2, 3, "C" ] +
29
- [ 4, 5, 6, "+" ] +
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,9 @@
1
+
2
+ require "vrlib"
3
+
4
+ require_relative "src/MyTextView"
5
+ require_relative "src/MyClass"
6
+
7
+
8
+ MyClass.new.show_glade()
9
+
@@ -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,13 @@
1
+
2
+
3
+ class MyTextView < Gtk::TextView
4
+
5
+
6
+
7
+
8
+ def self__cut_clipboard(*args)
9
+ alert "Cut"
10
+ oinspect(self)
11
+ end
12
+
13
+ end
@@ -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">&lt;big&gt;Event Handlers&lt;/big&gt;</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/active_record.rb"
16
- current_line: 4
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,4 +1,4 @@
1
-
1
+ #change
2
2
 
3
3
  # ignore -- this is for development, same as require 'vrlib'
4
4
  require File.exists?("./../../lib/vrlib.rb") ? "./../../lib/vrlib.rb" : "vrlib"
@@ -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: 910
4
- height: 600
3
+ width: 1366
4
+ height: 706
5
5
  panel_pos: 360
6
6
  notebook_panel_position: 400
7
- run_command_line: ruby main.rb
7
+ run_command_line: ruby alertdemo.rb
8
8
  open_files:
9
- - "/home/eric/vrp/vr3/examples/alert_box/main.rb"
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/bin"
13
- - "/home/eric/vrp/vr3/examples/alert_box/bin/glade"
14
- current_file: "/home/eric/vrp/vr3/examples/alert_box/main.rb"
15
- current_line: 6
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
@@ -0,0 +1,11 @@
1
+
2
+ require "vrlib"
3
+ require_relative "src/AlertBoxDemo.rb"
4
+
5
+
6
+
7
+ main = Gtk::Application.new()
8
+ main.signal_connect "activate" do |app|
9
+ AlertBoxDemo.new.show_glade()
10
+ end
11
+ main.run
@@ -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:", :input_text => "Ralph",
46
- :button_yes => "Go", :headline => "Enter Name")
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
- :button_yes => "Jump in Pool", :button_no => "Panic!",
60
- :title => "Pants on Fire", :headline => "Warning")
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.38.2 -->
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=4 -->
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">&lt;big&gt;Request Input Example&lt;/big&gt;
129
- This example shows how you can ask the user to enter text into a textbox.</property>
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">&lt;big&gt;Ask Any Question&lt;/big&gt;
143
- Change the text on the buttons to ask anything</property>
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">&lt;big&gt;Select From a List of Choices&lt;/big&gt;
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 main.rb
7
+ run_command_line: ruby all_widgets.rb
8
8
  open_files:
9
- - "/home/eric/vrp/vr3/examples/all_widgets/bin/AllWidgets.rb"
10
- - "/home/eric/vrp/vr3/examples/all_widgets/main.rb"
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/bin"
14
- - "/home/eric/vrp/vr3/examples/all_widgets/bin/glade"
15
- current_file: "/home/eric/vrp/vr3/examples/all_widgets/bin/AllWidgets.rb"
16
- current_line: 38
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
@@ -1,9 +1,6 @@
1
1
 
2
2
  require "vrlib"
3
-
4
- # from require_all gem:
5
- require_rel 'bin/'
6
-
3
+ require_relative "src/AllWidgets"
7
4
 
8
5
  AllWidgets.new.show_glade()
9
6