SU/Rudy/test

Ruby code posted by john@drivenupthewall
created at 15 Feb 18:59, updated at 15 Feb 19:03

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
#  _PDF_Viewer.rb

#  seems to only work with adobe pdf format, but that's what safari saves pdfs to, so if it won't open, re-save from safari
#  seems to open most image files at full size so you may want smaller copies, export to mail and post to self is cheap and easy,
#  batch conversion, or graphics convertor.

#  helpmenue.rb Created by Dan Rathbun on 14/02/2010.
#  2010 @SCF. No? rights reserved.

#  modified for modal Mac usage by john@drivenupthewall.co.uk
#  show_modal works differently on PC's
#  user selected pdf + image veiwer 
#  for PLAT=Mac & OS=OSX

module SU_User
   module Menus

require "sketchup.rb"
# Check to see if the plugin is already loaded 
if not file_loaded? "_PDF_Viewer.rb" 

# where to look for it
   helpmenu=UI.menu('Help')
   helpmenu.add_separator
# it's name in the Help menu
   helpmenu.add_item('PDF_Viewer') {

#contents of dialog

      pdf = UI.openpanel;
    get_dialog = UI::WebDialog.new; 

      get_dialog.show_modal;
      get_dialog.set_url(pdf)
   }
   
   
  end
    end


file_loaded "_PDF_Viewer"
end
1.08 KB in 2 ms with coderay