visualruby 3.0.13 → 3.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46e25870adcbfcac92e861c3a44e7fb4f0f4d9c8
4
- data.tar.gz: 042fb3b507391b4a93ec6c9ffe3d6e5d947de7cb
3
+ metadata.gz: 548fa010bc3b7ce7b356805a4b3d2d8a43dfe2fc
4
+ data.tar.gz: b9a0df4868b9c4a09a8ee7e916be8dc18ef6b396
5
5
  SHA512:
6
- metadata.gz: 88abd7c46b358b2432058b6aebec7471817d5e0e7ee84e9d0f4a3b4238c64927eb6a4e131360966b85677033fc99ff6d9322b584c7fc1e35bb2db477b7f56340
7
- data.tar.gz: f079967a87e8de4ea1f4c294bdb40deda0899a983685ff52e9d0d04f688efae5fa6407f7246e880390107ab32761469b18a825d4359badc93b10468e7ab1ab4e
6
+ metadata.gz: 6ca8a27231a06ea45a1ccfa7130fd55524d70f26025fccf765fb208ad1751ef0e9c7a3e876b16bd269bbc31d80ad057ff0b67e38e0982553c94db1f1aeb5585a
7
+ data.tar.gz: e6edfd3ab82abeeebb2736b7269bafa454f6042f01877e25a8c4268dfdea5a767b500dfb22bc54acc4173eae917e12220ac1a60473e26bb7c7f441d3edb76c5a
data/.vr_settings.yaml CHANGED
@@ -6,11 +6,22 @@ panel_pos: 360
6
6
  notebook_panel_position: 400
7
7
  run_command_line: ruby vr
8
8
  open_files:
9
- - "/home/eric/vrp/vr3/Untitled"
9
+ - "/home/eric/vrp/vr3/lib/GladeGUI.rb"
10
+ - "/home/eric/vrp/vr3/lib/treeview/IterMethods.rb"
11
+ - "/home/eric/vrp/vr3/src/main/VR_Main.rb"
12
+ - "/home/eric/vrp/vr3/src/main/VR_File_Tree.rb"
13
+ - "/home/eric/vrp/vr3/lib/oinspect/ObjectInspectorGUI.rb"
14
+ - "/home/eric/vrp/vr3/lib/Alert.rb"
10
15
  open_folders:
11
16
  - "/home/eric/vrp/vr3"
12
- current_file: "/home/eric/vrp/vr3/Untitled"
13
- current_line: 1
17
+ - "/home/eric/vrp/vr3/examples"
18
+ - "/home/eric/vrp/vr3/lib"
19
+ - "/home/eric/vrp/vr3/lib/oinspect"
20
+ - "/home/eric/vrp/vr3/src"
21
+ - "/home/eric/vrp/vr3/src/main"
22
+ - "/home/eric/vrp/vr3/src/main/glade"
23
+ current_file: "/home/eric/vrp/vr3/src/main/VR_Main.rb"
24
+ current_line: 162
14
25
  rdoc_command_line: yardoc lib - site/*.*
15
26
  builder: !ruby/object:Gtk::Builder {}
16
27
  top_level_window: false
@@ -14,5 +14,7 @@ open_folders:
14
14
  - "/home/eric/vrp/vr3/examples/alert_box/bin/glade"
15
15
  current_file: "/home/eric/vrp/vr3/examples/alert_box/main.rb"
16
16
  current_line: 9
17
- rdoc_command_line: rdoc -x README
17
+ rdoc_command_line: rdoc
18
+ builder: !ruby/object:Gtk::Builder {}
19
+ top_level_window: false
18
20
  settings_file_version: 1
data/lib/Alert.rb CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  module VR
3
+ # Class that the #alert method uses.
3
4
 
4
5
  # @see #alert
5
6
  class Alert
@@ -8,6 +9,9 @@ module VR
8
9
 
9
10
  include GladeGUI
10
11
 
12
+ # Just passes on values from #alert method.
13
+ # @see #alert
14
+
11
15
  def initialize(message, answer, flags = {})
12
16
  @flags = flags
13
17
  @answer = answer
@@ -48,7 +52,7 @@ module VR
48
52
  end
49
53
 
50
54
  # Helper to VR::Alert so :answer can be passed by reference.
51
- class DialogAnswer # :nodoc:
55
+ class DialogAnswer
52
56
  attr_accessor :answer
53
57
  end
54
58
 
data/lib/DragDrop.rb CHANGED
@@ -1,5 +1,4 @@
1
- #nodoc
2
-
1
+ # The main namespace for visualruby.
3
2
  module VR
4
3
 
5
4
  module Draggable
data/lib/GladeGUI.rb CHANGED
@@ -4,43 +4,41 @@
4
4
  # It will load a .glade
5
5
  # file into memory, enabling your ruby programs to have a GUI interface.
6
6
  #
7
- # GladeGUI works by adding an instance variable, @builder to your class. The @builder
7
+ # GladeGUI works by adding an instance variable named "builder" to your class. The "builder"
8
8
  # variable is an instance of {Gtk::Builder}[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ABuilder]
9
9
  # It holds references to all your windows and widgets.
10
10
  #
11
- # =Include the GladeGUI interface
11
+ # = Include the GladeGUI interface
12
12
  #
13
- # To use the GladeGUI interface, include this line after your
14
- # “class” declaration:
15
- # @example
16
- # class MyClass
17
- # include GladeGUI
18
- # ...
19
- # end
20
- #
21
- # GladeGUI will load a corresponding
22
- # glade file for this class. It knows which glade file to load by using a naming
23
- # convention:
13
+ # To use the GladeGUI interface, include this line in your code:
14
+ #
15
+ #
16
+ # class MyClass
17
+ # include GladeGUI
18
+ # end
19
+ #
20
+ # GladeGUI will load a corresponding
21
+ # glade file for this class. It knows which glade file to load by using a naming
22
+ # convention:
24
23
  #
25
- # /home/me/visualruby/projectname/bin/MyClass.rb
24
+ # /folder/MyClass.rb
26
25
  #
27
- # Will load this glade file:
26
+ # Will load this glade file:
28
27
  #
29
- # /home/me/visualrubyprojectname/bin/glade/MyClass.glade
28
+ # /folder/glade/MyClass.glade
30
29
  #
31
- # Note: it will use this format: /my/path/glade/<class_name>.glade.
32
- # In the example, the class and the file have the same name,
33
- # MyClass. You should always name your class, script, and glade file
34
- # the same name (case sensitive).
30
+ # The class, the class file name and the glade file name must match.
31
+ # You should always name your class, script, and glade file
32
+ # the same name (case sensitive).
35
33
  #
36
- # ==@builder holds all your widgets
34
+ # == <tt>builder</tt> variable holds all your widgets
37
35
  #
38
- # So when you "load" your class's glade file where is it loaded?
36
+ # So when you "load" your class's glade file where is it loaded?
39
37
  #
40
- # GladeGUI adds an instance variable, @builder to your class.
41
- # It loads all the windows and widgets from your glade file into @builder.
42
- # So, you use @builder to manipulate everything in you class's GUI.
43
- # @builder is set when you call the show_glade() method, as this code shows:
38
+ # GladeGUI adds an instance variable, builder to your class.
39
+ # It loads all the windows and widgets from your glade file into @builder.
40
+ # So, you use <tt>@builder</tt> to manipulate everything in you class's GUI.
41
+ # <tt>@builder</tt> is set when you call the show_glade() method, as this code shows:
44
42
  #
45
43
  # class MyClass
46
44
  #
@@ -56,34 +54,34 @@
56
54
  #
57
55
  # end
58
56
  #
59
- # After show_glade() is called, you can access any of your form's windows or widgets
60
- # using the @builder variable:
61
- #
62
- # @builder["window1"].title = "This is the title that appears at the top."
63
- #
64
- #
65
- # Here's another example: Suppose you have a glade form with a Gtk::Entry box on it named "email."
66
- # You could set the text that appears in the Gtk::Entry by setting the Gtk::Entry#text property:
57
+ # After show_glade() is called, you can access any of your form's windows or widgets
58
+ # using the @builder variable:
59
+ # ```ruby
60
+ # @builder["window1"].title = "This is the title that appears at the top."
61
+ # ```
67
62
  #
63
+ # Here's another example: Suppose you have a glade form with a Gtk::Entry box on it named "email."
64
+ # You could set the text that appears in the Gtk::Entry by setting the Gtk::Entry#text property:
65
+ # ```ruby
68
66
  # @builder["email"].text = "harvey@harveyserver.com"
69
- #
70
- # Now the email adddess is set with a new value:
67
+ # ```
68
+ # Now the email adddess is set with a new value:
71
69
  #
72
- # http://visualruby.net/img/gladegui_simple.jpg
70
+ # http://visualruby.net/img/gladegui_simple.jpg
73
71
  #
74
- # ==Auto fill your glade form
75
- # You can streamline the process of setting-up your forms by
76
- # auto-filling the widgets from instance variables with the same name.
72
+ # == Auto fill your glade form
73
+ # You can streamline the process of setting-up your forms by
74
+ # auto-filling the widgets from instance variables with the same name.
77
75
  #
78
- # When assigning names to widgets in glade, give them names that
79
- # correspond to your instance variables. For example, if you want
80
- # to edit an email address on the glade form, create an instance
81
- # variable named @email in your class. Then, in glade, you
82
- # add a Gtk::Entry widget to your form and set its name to
83
- # “email”. The advantage of this is that GladeGUI will populate
84
- # the “email” widget in glade using the @email variable. so
85
- # you don’t need to include the above line of code. (see
86
- # set_glade_variables() method.)
76
+ # When assigning names to widgets in glade, give them names that
77
+ # correspond to your instance variables. For example, if you want
78
+ # to edit an email address on the glade form, create an instance
79
+ # variable named @email in your class. Then, in glade, you
80
+ # add a Gtk::Entry widget to your form and set its name to
81
+ # “email”. The advantage of this is that GladeGUI will populate
82
+ # the “email” widget in glade using the @email variable. so
83
+ # you don’t need to include the above line of code. (see
84
+ # set_glade_variables() method.)
87
85
  module GladeGUI
88
86
 
89
87
  # @attribute A Builder object that holds references to everything from the galde form.
@@ -140,7 +138,7 @@ end
140
138
  @builder.connect_signals{ |handle| method(handle) }
141
139
  end
142
140
 
143
- private def class_name(obj) # :nodoc:
141
+ private def class_name(obj)
144
142
  /.*\b(\w+)$/.match(obj.class.name)[1]
145
143
  end
146
144
 
@@ -286,7 +284,7 @@ end
286
284
  end
287
285
 
288
286
 
289
- def fill_control(glade_name, val) # :nodoc:
287
+ def fill_control(glade_name, val)
290
288
  control = @builder[glade_name]
291
289
  control_name = glade_name.split(".")[1]
292
290
  control ||= @builder[control_name] if control_name
@@ -349,7 +347,7 @@ end
349
347
  end
350
348
 
351
349
 
352
- def get_glade_active_record(obj) # :nodoc:
350
+ def get_glade_active_record(obj)
353
351
  return if not defined? @attributes
354
352
  obj.attributes.each_pair do |key, val|
355
353
  control = @builder[class_name(obj) + "." + key]
@@ -414,8 +412,8 @@ end
414
412
  @builder[:window1].destroy
415
413
  end
416
414
 
417
- def self__key_press_event(view, evt)
418
- return unless evt.keyval == 65535 # Gdk::Keyval::GDK_F3
415
+ def window1__key_press_event(view, evt)
416
+ return unless evt.keyval == Gdk::Keyval::KEY_F8
419
417
  oinspect
420
418
  end
421
419
 
@@ -1,5 +1,7 @@
1
- module VR::ObjectInspector
2
1
 
2
+ # ObjectInspector isn't meant to be called directly, #oinspect for API.
3
+ module VR::ObjectInspector
4
+ # ObjectInspector isn't meant to be called directly, see #oinspect for API.
3
5
  class ObjectInspectorGUI
4
6
 
5
7
  include GladeGUI
@@ -34,6 +36,8 @@ end
34
36
  # the execution, and display an object in a window like this:
35
37
  # alert anyobject
36
38
  #
39
+ # Also, at any window, if you press the F8 key, the object inspector will run. Try it.
40
+
37
41
  # http://visualruby.net/img/object_inspector.jpg
38
42
  #
39
43
  def oinspect(obj=self)
@@ -1,5 +1,5 @@
1
1
  module VR::ObjectInspector
2
-
2
+ # Listview that holds variables in the ObjectInspectorGUI
3
3
  class VariablesListView < VR::ListView
4
4
 
5
5
  def initialize(obj)
@@ -130,8 +130,15 @@ module VR
130
130
  selection.selected ? selection.selected[id(:path)] : nil
131
131
  end
132
132
 
133
- class IconHash < Hash # :nodoc:
134
-
133
+ # Creates a Hash of icons for VR::FileTreeView. The folder should contain
134
+ # .png files that correspond to file extensions. For example, rb.png
135
+ # would be an icon that displays next to files with an .rb extension.
136
+ # A file named "unknown.png" should be in the folder for file types that
137
+ # aren't found.
138
+ class IconHash < Hash
139
+
140
+ # Sets the path to find the icons
141
+ # @param [String] path Path to folder where icons are.
135
142
  def initialize(path)
136
143
  Dir.glob(path + "/*.png").each do |f|
137
144
  ext = File.basename(f, ".png")
@@ -58,6 +58,7 @@ class VR_File_Tree < VR::FileTreeView
58
58
  VR_Tools.replace_html_in_docs()
59
59
  if File.exists?("yard_hack/index.html.replace")
60
60
  FileUtils.copy("yard_hack/index.html.replace", "#{fn}/doc/index.html")
61
+ FileUtils.copy("yard_hack/index.html.replace", "#{fn}/doc/frames.html")
61
62
  FileUtils.copy("yard_hack/common.css", "#{fn}/doc/css/common.css")
62
63
  end
63
64
  FileUtils.cd(old_dir)
data/src/main/VR_Main.rb CHANGED
@@ -152,16 +152,18 @@ class VR_Main
152
152
  VR_Tools.replace_html_in_docs()
153
153
  if File.exists?("yard_hack/index.html.replace")
154
154
  FileUtils.copy("yard_hack/index.html.replace", "doc/index.html")
155
+ FileUtils.copy("yard_hack/index.html.replace", "doc/frames.html")
155
156
  FileUtils.copy("yard_hack/common.css", "doc/css/common.css")
156
157
  end
157
- # VR_Tools.popen("#{$VR_ENV_GLOBAL.browser} #{fn}/doc/index.html")
158
+
159
+ end
160
+
161
+ def toolViewRDoc__clicked(*a)
162
+ VR_Tools.popen("#{$VR_ENV_GLOBAL.browser} #{Dir.pwd}/doc/index.html")
158
163
  end
159
164
 
160
165
  def toolSave__clicked(*a) # saves open tab
161
- @tabs.docs[@tabs.page].try_to_save(false) # false = don't ask
162
- # command = $VR_ENV.rdoc_command_line.split(" ")[0]
163
- # file = @tabs.docs[@tabs.page].full_path_file
164
- # run_command("#{command} #{file}")
166
+ @tabs.docs[@tabs.page].try_to_save(false) # false = don't ask
165
167
  end
166
168
 
167
169
  def menuNewWindow__activate(*a)
@@ -275,7 +277,7 @@ class VR_Main
275
277
  def buttonFind_clicked
276
278
  str = @builder["entryFind"].text
277
279
  str = str.length < 2 ? @tabs.docs[@tabs.page].selected_text() : str
278
- return if str.length < 2
280
+ return if str.nil? or str.length < 2
279
281
  text = (@builder["radioOnDisk"].active?) ? @tabs.find_in_all(str) : @tabs.find_in_tabs(str)
280
282
  @shell.hilight_links(text, false)
281
283
  end
@@ -342,6 +342,20 @@
342
342
  <property name="homogeneous">True</property>
343
343
  </packing>
344
344
  </child>
345
+ <child>
346
+ <object class="GtkToolButton" id="toolViewRDoc">
347
+ <property name="visible">True</property>
348
+ <property name="can_focus">False</property>
349
+ <property name="tooltip_text" translatable="yes">Open Documentation in browser.</property>
350
+ <property name="label" translatable="yes">View Docs</property>
351
+ <property name="use_underline">True</property>
352
+ <property name="stock_id">gtk-info</property>
353
+ </object>
354
+ <packing>
355
+ <property name="expand">False</property>
356
+ <property name="homogeneous">True</property>
357
+ </packing>
358
+ </child>
345
359
  </object>
346
360
  <packing>
347
361
  <property name="expand">False</property>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visualruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.13
4
+ version: 3.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Cunningham
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir:
10
10
  - "."
11
11
  cert_chain: []
12
- date: 2016-06-19 00:00:00.000000000 Z
12
+ date: 2016-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gtk3