sketchup-api-stubs 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +9 -9
  3. data/lib/sketchup-api-stubs.rb +1 -1
  4. data/lib/sketchup-api-stubs/sketchup.rb +145 -145
  5. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -318
  6. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  7. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  8. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
  10. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  11. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +492 -492
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  13. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  14. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
  16. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  17. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +174 -186
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -514
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +371 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +220 -232
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +204 -216
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +140 -140
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -577
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +281 -281
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -562
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +194 -194
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1119
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -544
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -697
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +409 -409
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -280
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -123
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1601
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +770 -770
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +44 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +57 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -1301
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -229
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -348
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1310 -1310
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  147. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +667 -667
  149. metadata +3 -4
@@ -1,633 +1,633 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The Ruby WebDialog class allows you to create and interact with DHTML dialog
5
- # boxes from Ruby.
6
- #
7
- # If your goal is to simply display a website to your users, consider using
8
- # UI.getURL, which will show them a web page in their default browser rather
9
- # than inside a dialog in SketchUp.
10
- #
11
- # See this blog post for a detailed, step-by-step example:
12
- # http://sketchupapi.blogspot.com/2008/02/sharing-data-between-sketchup-ruby-and.html
13
- #
14
- # Under Windows the IE render mode is different in webdialogs than from what
15
- # you see in the normal browser. It will by default pick an older render mode
16
- # and different versions of SketchUp will use different modes. In order to
17
- # reliably control the render mode of your webdialogs under Windows you need to
18
- # insert a special META compatibility tag:
19
- #
20
- # // To always force the latest version available:
21
- # <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
22
- #
23
- # // To lock to a specific IE version:
24
- # <meta http-equiv="X-UA-Compatible" content="IE=8"/>
25
- #
26
- # Starting with SketchUp 2013, you can embed a special HTML link in your dialog
27
- # that will launch Extension Warehouse and show a specified extension's page.
28
- # This can be useful if your extension has a dependency on another one and you
29
- # would like to direct the user to install that extension.
30
- #
31
- # For example, to launch an extension's page whose URL is:
32
- # http://extensions.sketchup.com/en/content/advanced-camera-tools
33
- # The link would be:
34
- #
35
- # @deprecated Please use {UI::HtmlDialog} that was introduced in
36
- # SketchUp 2017.
37
- #
38
- # @example
39
- # <a href="skp:launchEW@advanced-camera-tools">Get Advanced Camera Tools</a>
40
- #
41
- # @version SketchUp 6.0
42
- class UI::WebDialog
43
-
44
- # Instance Methods
45
-
46
- # The add_action_callback method establishes a Ruby callback method that your
47
- # web dialog can call to perform some function.
48
- #
49
- # Use the skp:callback_method_name to invoke the callback method from your
50
- # webdialog. Your JavaScript in the webdialog will invoke the callback method
51
- # with a string representing arguments to the callback method.
52
- #
53
- # Note that you're sending data down to Ruby as a single string that's
54
- # passed via the window.location bar. In Internet Explorer on PC, there is
55
- # a length limit of 2038 characters for this bar, so if you're
56
- # needing to pass large data down you might consider using get_element_value
57
- # to pull in a longer string from a hidden input field in the HTML.
58
- #
59
- # @example
60
- # # In Ruby code...
61
- # dlg.add_action_callback("ruby_messagebox") {|dialog, params|
62
- # UI.messagebox("You called ruby_messagebox with: " + params.to_s)
63
- # }
64
- #
65
- # # JavaScript inside the page loaded into the WebDialog:
66
- # # window.location = 'skp:ruby_messagebox@Hello World';
67
- #
68
- # @param callback_name
69
- # The name of the callback method to be invoked from the
70
- # webdialog.
71
- #
72
- # @return nil
73
- #
74
- # @version SketchUp 6.0
75
- #
76
- # @yield [dialog, params]
77
- #
78
- # @yieldparam dialog
79
- # The dialog.
80
- #
81
- # @yieldparam params
82
- # Any parameters passed to the dialog from HTML.
83
- # This is passed as a single string.
84
- def add_action_callback(callback_name)
85
- end
86
-
87
- # By default, actions are only allowed on the host where the webdialog is
88
- # displayed. The allow_actions_from_host method is used to selectively allow
89
- # actions to take place on a host remote from the host where the webdialog
90
- # exists. If the webdialog is local, no remote host is allowed unless you use
91
- # this method.
92
- #
93
- # @example
94
- # dialog.allow_actions_from_host("sketchup.com")
95
- #
96
- # @param [String] hostname
97
- # The name (domain) of the host that your webdialog can
98
- # access safely.
99
- #
100
- # @return [Boolean]
101
- #
102
- # @version SketchUp 6.0
103
- def allow_actions_from_host(hostname)
104
- end
105
-
106
- # The bring_to_front method is used to bring the webdialog to the front of all
107
- # the windows on the desktop. See show_modal for how to ensure that your
108
- # WedDialogs are on top.
109
- #
110
- # @example
111
- # dialog.bring_to_front
112
- #
113
- # @return [UI::WebDialog]
114
- #
115
- # @version SketchUp 6.0
116
- def bring_to_front
117
- end
118
-
119
- # The close method is used to close the webdialog.
120
- #
121
- # @example
122
- # dialog.close
123
- #
124
- # @return [nil]
125
- #
126
- # @version SketchUp 6.0
127
- def close
128
- end
129
-
130
- # The execute_script method is used to execute a JavaScript string on the web
131
- # dialog.
132
- #
133
- # @example
134
- # js_command = "document.getElementById('id').innerHTML = '<b>Hi!</b>'"
135
- # dialog.execute_script(js_command)
136
- #
137
- # @param [String] script
138
- # The JavaScript script to execute on the webdialog.
139
- #
140
- # @return [Boolean]
141
- #
142
- # @version SketchUp 6.0
143
- def execute_script(script)
144
- end
145
-
146
- # The get_default_dialog_color method is used to get the default dialog color
147
- # for the web dialog.
148
- #
149
- # @example
150
- # dialog.get_default_dialog_color
151
- # #ece9d8
152
- #
153
- # @return [String] a six digit hexidecimal number representing the color
154
- #
155
- # @version SketchUp 6.0
156
- def get_default_dialog_color
157
- end
158
-
159
- # The get_element_value method is used to get a value, with a given
160
- # element_id, from the web dialog's DOM.
161
- #
162
- # @example
163
- # # In Ruby code:
164
- # dialog.get_element_value("myTextInput")
165
- #
166
- # # In webdialog's HTML:
167
- # <input type="text" id="myTextInput" value="hello">
168
- #
169
- # @param [String] element_id
170
- # The name of the element in your HTML code.
171
- #
172
- # @return [String] a string containing the retrieved value.
173
- #
174
- # @version SketchUp 6.0
175
- def get_element_value(element_id)
176
- end
177
-
178
- # The +new+ method is used to create a new webdialog.
179
- #
180
- # @example
181
- # dlg = UI::WebDialog.new("Show sketchup.com", true,
182
- # "ShowSketchupDotCom", 739, 641, 150, 150, true);
183
- # dlg.set_url "http://www.sketchup.com"
184
- # dlg.show
185
- #
186
- # @note Since SU2017 the position and size of the dialog is DPI aware - it will
187
- # scale to the DPI of the monitor automatically. Specify units as they would
188
- # be on a traditional low-DPI monitor.
189
- #
190
- # @note The browser which is embedded inside the dialog depends on the
191
- # user's OS. On Mac, Safari is embedded, while on the PC whatever version of
192
- # Internet Explorer is installed will be embedded.
193
- #
194
- # @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = 250, left = 0, top = 0, resizable = true)
195
- #
196
- # @param [String] dialog_title The title to be displayed in the webdialog.
197
- # @param [Boolean] scrollable true if you want to allow scrollbars, false
198
- # if you do not want to allow scrollbars.
199
- # @param [String, nil] pref_key The registry entry where the location and
200
- # size of the dialog will be saved.
201
- # If preferences_key is not included, the
202
- # location and size will not be stored.
203
- # @param [Integer] width The width of the webdialog.
204
- # @param [Integer] height The height of the webdialog.
205
- # @param [Integer] left The number of pixels from the left.
206
- # @param [Integer] top The number of pixels from the top.
207
- # @param [Integer] resizable true if you want the webdialog to be resizable,
208
- # false if not.
209
- # @return [UI::WebDialog]
210
- #
211
- # @overload initialize(properties)
212
- #
213
- # @version SketchUp 7.0
214
- # @param [Hash] properties A hash containing the initial properties of
215
- # the newly created dialog.
216
- # @option properties [String] :dialog_title
217
- # @option properties [String] :preferences_key
218
- # @option properties [Boolean] :scrollable
219
- # @option properties [Boolean] :resizable (true)
220
- # @option properties [Integer] :width (250)
221
- # @option properties [Integer] :height (250)
222
- # @option properties [Integer] :left (0)
223
- # @option properties [Integer] :top (0)
224
- # @option properties [Integer] :min_width (0)
225
- # @option properties [Integer] :min_height (0)
226
- # @option properties [Integer] :max_width (-1)
227
- # @option properties [Integer] :max_height (-1)
228
- # @option properties [Integer] :full_security (false)
229
- # @option properties [Integer] :mac_only_use_nswindow (false)
230
- # @return [UI::WebDialog]
231
- #
232
- # @version SketchUp 6.0
233
- def initialize(*args)
234
- end
235
-
236
- # The max_height method is used to get the maximum height that the user is
237
- # allowed to resize the dialog to.
238
- #
239
- # @example
240
- # max = dialog.max_height
241
- #
242
- # @return [Integer] the maximum height in pixels
243
- #
244
- # @version SketchUp 7.0
245
- def max_height
246
- end
247
-
248
- # The max_height= method is used to set the maximum height that the user is
249
- # allowed to resize the dialog to.
250
- #
251
- # @example
252
- # dialog.max_height = 400
253
- #
254
- # @note As of SU2017 this will automatically scale the height by the same
255
- # factor as {UI.scale_factor}.
256
- #
257
- # @param [Integer] height
258
- # The maximum height in pixels
259
- #
260
- # @return [Integer]
261
- #
262
- # @version SketchUp 7.0
263
- def max_height=(height)
264
- end
265
-
266
- # The max_width method is used to get the maximum width that the user is
267
- # allowed to resize the dialog to.
268
- #
269
- # @example
270
- # max = dialog.max_width
271
- #
272
- # @return [Integer] the maximum width in pixels
273
- #
274
- # @version SketchUp 7.0
275
- def max_width
276
- end
277
-
278
- # The max_width= method is used to set the maximum width that the user is
279
- # allowed to resize the dialog to.
280
- #
281
- # @example
282
- # dialog.max_width = 500
283
- #
284
- # @note As of SU2017 this will automatically scale the width by the same factor
285
- # as {UI.scale_factor}.
286
- #
287
- # @param [Integer] width
288
- # The maximum width in pixels
289
- #
290
- # @return [Integer]
291
- #
292
- # @version SketchUp 7.0
293
- def max_width=(width)
294
- end
295
-
296
- # The min_width method is used to get the minimum height that the user is
297
- # allowed to resize the dialog to.
298
- #
299
- # @example
300
- # min = dialog.min_height
301
- #
302
- # @return [Integer] the minimum height in pixels
303
- #
304
- # @version SketchUp 7.0
305
- def min_height
306
- end
307
-
308
- # The min_height= method is used to set the minimum height that the user is
309
- # allowed to resize the dialog to.
310
- #
311
- # @example
312
- # dialog.min_height = 100
313
- #
314
- # @note As of SU2017 this will automatically scale the height by the same
315
- # factor as {UI.scale_factor}.
316
- #
317
- # @param [Integer] height
318
- # The minimum height in pixels
319
- #
320
- # @return [Integer]
321
- #
322
- # @version SketchUp 7.0
323
- def min_height=(height)
324
- end
325
-
326
- # The min_width method is used to get the minimum width that the user is
327
- # allowed to resize the dialog to.
328
- #
329
- # @example
330
- # min = dialog.min_width
331
- #
332
- # @return [Integer] the minimum width in pixels
333
- #
334
- # @version SketchUp 7.0
335
- def min_width
336
- end
337
-
338
- # The min_width= method is used to set the minimum width that the user is
339
- # allowed to resize the dialog to.
340
- #
341
- # @example
342
- # dialog.min_width = 200
343
- #
344
- # @note As of SU2017 this will automatically scale the width by the same factor
345
- # as {UI.scale_factor}.
346
- #
347
- # @param [Integer] width
348
- # The minimum width in pixels
349
- #
350
- # @return [Integer]
351
- #
352
- # @version SketchUp 7.0
353
- def min_width=(width)
354
- end
355
-
356
- # The navigation_buttons_enabled= method is used to set whether the home, next,
357
- # and back buttons are visible at the top of the WebDialog on the mac. This
358
- # method has no use on the PC, as these buttons are never displayed.
359
- #
360
- # @example
361
- # dialog.navigation_buttons_enabled = false
362
- #
363
- # @return [Boolean]
364
- #
365
- # @version SketchUp 7.0
366
- def navigation_buttons_enabled=(nav_buttons)
367
- end
368
-
369
- # The navigation_buttons_enabled? method is used to get whether the home, next,
370
- # and back buttons are visible at the top of the WebDialog on the mac. This
371
- # method has no use on the PC, as these buttons are never displayed.
372
- #
373
- # On the mac, this defaults to true for new WebDialogs.
374
- #
375
- # @example
376
- # nav_buttons = dialog.navigation_buttons_enabled?
377
- #
378
- # @return [Boolean]
379
- #
380
- # @version SketchUp 7.0
381
- def navigation_buttons_enabled?
382
- end
383
-
384
- # The post_url method is used to send the data to a url using the HTTP POST
385
- # method.
386
- #
387
- # @example
388
- # data = dialog.post_url("http://www.mydomain.com/formchecker.cgi",data)
389
- #
390
- # @param [String] url
391
- # The url to send the data.
392
- #
393
- # @param [String] data
394
- # The data to be sent.
395
- #
396
- # @return [nil]
397
- #
398
- # @version SketchUp 6.0
399
- def post_url(url, data)
400
- end
401
-
402
- # The screen_scale_factor method returns the ratio of screen pixels to logical
403
- # window units (called 'points' on Mac) for the screen this WebDialog is
404
- # currently in. On a retina screen Mac, this ratio will be greater than 1.0.
405
- # On Windows this always return 1.0.
406
- #
407
- # @example
408
- # factor = dialog.screen_scale_factor
409
- #
410
- # @return [Float] screen scale factor
411
- #
412
- # @version SketchUp 2014
413
- def screen_scale_factor
414
- end
415
-
416
- # The set_background_color method is used to set the background color for the
417
- # webdialog.
418
- #
419
- # @example
420
- # dlg.set_background_color("f3f0f0")
421
- #
422
- # @param [String] color
423
- # A six digit hexidecimal color.
424
- #
425
- # @return [nil]
426
- #
427
- # @version SketchUp 6.0
428
- def set_background_color(color)
429
- end
430
-
431
- # The #{set_file} method is used to identify a local HTML file to display in
432
- # the webdialog.
433
- #
434
- # @example
435
- # file = File.join(__dir__, 'mypage.html')
436
- # dialog.set_file(file)
437
- #
438
- # @param [String] filename
439
- # The filename for the webdialog file (HTML file).
440
- #
441
- # @param [String] path
442
- # A path that filename is relative to.
443
- #
444
- # @return [nil]
445
- #
446
- # @version SketchUp 6.0
447
- def set_file(filename, path = nil)
448
- end
449
-
450
- # The set_full_security method is used to place the WebDialog into a higher
451
- # security mode where remote URLs and plugins (such as Flash) are not allowed
452
- # inside the browser. This defaults to false when a new WebDialog is created.
453
- #
454
- # @example
455
- # dialog.set_full_security
456
- #
457
- # @return [UI::WebDialog] the updated WebDialog
458
- #
459
- # @version SketchUp 7.0
460
- def set_full_security
461
- end
462
-
463
- # The set_html method is used to load a webdialog with a string of provided
464
- # HTML.
465
- #
466
- # @example
467
- # html= '<b>Hello world!</b>'
468
- # dialog.set_html(html)
469
- #
470
- # @param [String] html_string
471
- # A string of valid html to display in your webdialog.
472
- #
473
- # @return [nil]
474
- #
475
- # @version SketchUp 6.0
476
- def set_html(html_string)
477
- end
478
-
479
- # The set_on_close method is used to establish one or more activities to
480
- # perform when the dialog closes (such as saving values stored in the dialog).
481
- #
482
- # @example
483
- # dialog.set_on_close{ UI.messagebox("Closing the webDialog") }
484
- #
485
- # @return [nil]
486
- #
487
- # @version SketchUp 6.0
488
- #
489
- # @yield Ruby block to perform when the dialog closes.
490
- def set_on_close
491
- end
492
-
493
- # The set_position method is used to set the position of the webdialog
494
- # relative to the screen, in pixels.
495
- #
496
- # @example
497
- # dialog.set_position(100,50)
498
- #
499
- # @note As of SU2017 this will automatically scale the x and y by the same
500
- # factor as {UI.scale_factor}.
501
- #
502
- # @param [Integer] left
503
- # The number of pixels from the left.
504
- #
505
- # @param [Integer] top
506
- # The number of pixels from the top of the screen.
507
- #
508
- # @return [nil]
509
- #
510
- # @version SketchUp 6.0
511
- def set_position(left, top)
512
- end
513
-
514
- # The set_size method is used to set the size of the webdialog, in pixels.
515
- #
516
- # @example
517
- # dialog.set_size(320,240)
518
- #
519
- # @note As of SU2017 this will automatically scale the width and height by the
520
- # same factor as {UI.scale_factor}.
521
- #
522
- # @param [Integer] w
523
- # Width of the webdialog.
524
- #
525
- # @param [Integer] h
526
- # Height of the webdialog.
527
- #
528
- # @return [nil]
529
- #
530
- # @version SketchUp 6.0
531
- def set_size(w, h)
532
- end
533
-
534
- # The set_url method is used to load a webdialog with the content at a
535
- # specific URL. This method allows you to load web sites in a webdialog.
536
- #
537
- # @example
538
- # dialog.set_url "http://www.sketchup.com"
539
- #
540
- # @param [String] url
541
- # The URL for a specific web site.
542
- #
543
- # @return [nil]
544
- #
545
- # @version SketchUp 6.0
546
- def set_url(url)
547
- end
548
-
549
- # The show method is used to display a non-modal dialog box.
550
- #
551
- # @example
552
- # dialog.show {
553
- # dialog.execute_script("alert(10)");
554
- # }
555
- #
556
- # @return [nil]
557
- #
558
- # @version SketchUp 6.0
559
- #
560
- # @yield [dialog] (optional) Ruby code to perform when the dialog is first
561
- # displayed.
562
- def show
563
- end
564
-
565
- # The show_modal method is used to display a modal dialog box. In SketchUp 6
566
- # and 7, this behaves differently on Mac vs. PC. On the PC, it shows a truly
567
- # modal dialog, meaning so long as the WebDialog is visible, no input can be
568
- # performed elsewhere inside SketchUp. On the Mac, "modal" WebDialogs do not
569
- # behave this way, but instead are "always on top" of other windows.
570
- #
571
- # @example
572
- # dialog.show_modal {
573
- # dialog.execute_script("alert(10)");
574
- # }
575
- #
576
- # @return [nil]
577
- #
578
- # @version SketchUp 6.0
579
- #
580
- # @yield [dialog] (optional) Ruby code to perform when the dialog is first
581
- # displayed.
582
- def show_modal
583
- end
584
-
585
- # The visible? method is used to tell if the webdialog is currently shown.
586
- #
587
- # @example
588
- # vis = dialog.visible?
589
- #
590
- # @return [Boolean]
591
- #
592
- # @version SketchUp 6.0
593
- def visible?
594
- end
595
-
596
- # The write_image method is used to grab a portion of the web dialog screen and
597
- # save the image to the given file path.
598
- #
599
- # @example
600
- # dialog.write_image('c:/grab.jpg', 70, 0, 0, 100, 100)
601
- # dialog.write_image('c:/grab.png', 4, 0, 0, 100, 100)
602
- #
603
- # @param [String] image_path
604
- # The destination path of the saved image.
605
- #
606
- # @param [Integer] option
607
- # Specifies what method to use when saving the image. For
608
- # JPG/JPEG images, this specifies the image quality and
609
- # can range from 1 to 100. For PNG images this specifies
610
- # the compression algorithm: <4 (best speed), 4-8
611
- # (default), or >=9 (best compression).
612
- #
613
- # @param [Integer] top_left_x
614
- # The x coordinate of the upper left corner of the
615
- # region to grab.
616
- #
617
- # @param [Integer] top_left_y
618
- # The x coordinate of the upper left corner of the
619
- # region to grab.
620
- #
621
- # @param [Integer] bottom_right_x
622
- # The x coordinate of the lower right corner of the
623
- # region to grab.
624
- #
625
- # @param [Integer] bottom_right_y
626
- # The x coordinate of the lower right corner of the
627
- # region to grab.
628
- #
629
- # @version SketchUp 7.1
630
- def write_image(image_path, option, top_left_x, top_left_y, bottom_right_x, bottom_right_y)
631
- end
632
-
633
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The Ruby WebDialog class allows you to create and interact with DHTML dialog
5
+ # boxes from Ruby.
6
+ #
7
+ # If your goal is to simply display a website to your users, consider using
8
+ # UI.getURL, which will show them a web page in their default browser rather
9
+ # than inside a dialog in SketchUp.
10
+ #
11
+ # See this blog post for a detailed, step-by-step example:
12
+ # http://sketchupapi.blogspot.com/2008/02/sharing-data-between-sketchup-ruby-and.html
13
+ #
14
+ # Under Windows the IE render mode is different in webdialogs than from what
15
+ # you see in the normal browser. It will by default pick an older render mode
16
+ # and different versions of SketchUp will use different modes. In order to
17
+ # reliably control the render mode of your webdialogs under Windows you need to
18
+ # insert a special META compatibility tag:
19
+ #
20
+ # // To always force the latest version available:
21
+ # <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
22
+ #
23
+ # // To lock to a specific IE version:
24
+ # <meta http-equiv="X-UA-Compatible" content="IE=8"/>
25
+ #
26
+ # Starting with SketchUp 2013, you can embed a special HTML link in your dialog
27
+ # that will launch Extension Warehouse and show a specified extension's page.
28
+ # This can be useful if your extension has a dependency on another one and you
29
+ # would like to direct the user to install that extension.
30
+ #
31
+ # For example, to launch an extension's page whose URL is:
32
+ # http://extensions.sketchup.com/en/content/advanced-camera-tools
33
+ # The link would be:
34
+ #
35
+ # @deprecated Please use {UI::HtmlDialog} that was introduced in
36
+ # SketchUp 2017.
37
+ #
38
+ # @example
39
+ # <a href="skp:launchEW@advanced-camera-tools">Get Advanced Camera Tools</a>
40
+ #
41
+ # @version SketchUp 6.0
42
+ class UI::WebDialog
43
+
44
+ # Instance Methods
45
+
46
+ # The add_action_callback method establishes a Ruby callback method that your
47
+ # web dialog can call to perform some function.
48
+ #
49
+ # Use the skp:callback_method_name to invoke the callback method from your
50
+ # webdialog. Your JavaScript in the webdialog will invoke the callback method
51
+ # with a string representing arguments to the callback method.
52
+ #
53
+ # Note that you're sending data down to Ruby as a single string that's
54
+ # passed via the window.location bar. In Internet Explorer on PC, there is
55
+ # a length limit of 2038 characters for this bar, so if you're
56
+ # needing to pass large data down you might consider using get_element_value
57
+ # to pull in a longer string from a hidden input field in the HTML.
58
+ #
59
+ # @example
60
+ # # In Ruby code...
61
+ # dlg.add_action_callback("ruby_messagebox") {|dialog, params|
62
+ # UI.messagebox("You called ruby_messagebox with: " + params.to_s)
63
+ # }
64
+ #
65
+ # # JavaScript inside the page loaded into the WebDialog:
66
+ # # window.location = 'skp:ruby_messagebox@Hello World';
67
+ #
68
+ # @param callback_name
69
+ # The name of the callback method to be invoked from the
70
+ # webdialog.
71
+ #
72
+ # @return nil
73
+ #
74
+ # @version SketchUp 6.0
75
+ #
76
+ # @yield [dialog, params]
77
+ #
78
+ # @yieldparam dialog
79
+ # The dialog.
80
+ #
81
+ # @yieldparam params
82
+ # Any parameters passed to the dialog from HTML.
83
+ # This is passed as a single string.
84
+ def add_action_callback(callback_name)
85
+ end
86
+
87
+ # By default, actions are only allowed on the host where the webdialog is
88
+ # displayed. The allow_actions_from_host method is used to selectively allow
89
+ # actions to take place on a host remote from the host where the webdialog
90
+ # exists. If the webdialog is local, no remote host is allowed unless you use
91
+ # this method.
92
+ #
93
+ # @example
94
+ # dialog.allow_actions_from_host("sketchup.com")
95
+ #
96
+ # @param [String] hostname
97
+ # The name (domain) of the host that your webdialog can
98
+ # access safely.
99
+ #
100
+ # @return [Boolean]
101
+ #
102
+ # @version SketchUp 6.0
103
+ def allow_actions_from_host(hostname)
104
+ end
105
+
106
+ # The bring_to_front method is used to bring the webdialog to the front of all
107
+ # the windows on the desktop. See show_modal for how to ensure that your
108
+ # WedDialogs are on top.
109
+ #
110
+ # @example
111
+ # dialog.bring_to_front
112
+ #
113
+ # @return [UI::WebDialog]
114
+ #
115
+ # @version SketchUp 6.0
116
+ def bring_to_front
117
+ end
118
+
119
+ # The close method is used to close the webdialog.
120
+ #
121
+ # @example
122
+ # dialog.close
123
+ #
124
+ # @return [nil]
125
+ #
126
+ # @version SketchUp 6.0
127
+ def close
128
+ end
129
+
130
+ # The execute_script method is used to execute a JavaScript string on the web
131
+ # dialog.
132
+ #
133
+ # @example
134
+ # js_command = "document.getElementById('id').innerHTML = '<b>Hi!</b>'"
135
+ # dialog.execute_script(js_command)
136
+ #
137
+ # @param [String] script
138
+ # The JavaScript script to execute on the webdialog.
139
+ #
140
+ # @return [Boolean]
141
+ #
142
+ # @version SketchUp 6.0
143
+ def execute_script(script)
144
+ end
145
+
146
+ # The get_default_dialog_color method is used to get the default dialog color
147
+ # for the web dialog.
148
+ #
149
+ # @example
150
+ # dialog.get_default_dialog_color
151
+ # #ece9d8
152
+ #
153
+ # @return [String] a six digit hexidecimal number representing the color
154
+ #
155
+ # @version SketchUp 6.0
156
+ def get_default_dialog_color
157
+ end
158
+
159
+ # The get_element_value method is used to get a value, with a given
160
+ # element_id, from the web dialog's DOM.
161
+ #
162
+ # @example
163
+ # # In Ruby code:
164
+ # dialog.get_element_value("myTextInput")
165
+ #
166
+ # # In webdialog's HTML:
167
+ # <input type="text" id="myTextInput" value="hello">
168
+ #
169
+ # @param [String] element_id
170
+ # The name of the element in your HTML code.
171
+ #
172
+ # @return [String] a string containing the retrieved value.
173
+ #
174
+ # @version SketchUp 6.0
175
+ def get_element_value(element_id)
176
+ end
177
+
178
+ # The +new+ method is used to create a new webdialog.
179
+ #
180
+ # @example
181
+ # dlg = UI::WebDialog.new("Show sketchup.com", true,
182
+ # "ShowSketchupDotCom", 739, 641, 150, 150, true);
183
+ # dlg.set_url "http://www.sketchup.com"
184
+ # dlg.show
185
+ #
186
+ # @note Since SU2017 the position and size of the dialog is DPI aware - it will
187
+ # scale to the DPI of the monitor automatically. Specify units as they would
188
+ # be on a traditional low-DPI monitor.
189
+ #
190
+ # @note The browser which is embedded inside the dialog depends on the
191
+ # user's OS. On Mac, Safari is embedded, while on the PC whatever version of
192
+ # Internet Explorer is installed will be embedded.
193
+ #
194
+ # @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = 250, left = 0, top = 0, resizable = true)
195
+ #
196
+ # @param [String] dialog_title The title to be displayed in the webdialog.
197
+ # @param [Boolean] scrollable true if you want to allow scrollbars, false
198
+ # if you do not want to allow scrollbars.
199
+ # @param [String, nil] pref_key The registry entry where the location and
200
+ # size of the dialog will be saved.
201
+ # If preferences_key is not included, the
202
+ # location and size will not be stored.
203
+ # @param [Integer] width The width of the webdialog.
204
+ # @param [Integer] height The height of the webdialog.
205
+ # @param [Integer] left The number of pixels from the left.
206
+ # @param [Integer] top The number of pixels from the top.
207
+ # @param [Integer] resizable true if you want the webdialog to be resizable,
208
+ # false if not.
209
+ # @return [UI::WebDialog]
210
+ #
211
+ # @overload initialize(properties)
212
+ #
213
+ # @version SketchUp 7.0
214
+ # @param [Hash] properties A hash containing the initial properties of
215
+ # the newly created dialog.
216
+ # @option properties [String] :dialog_title
217
+ # @option properties [String] :preferences_key
218
+ # @option properties [Boolean] :scrollable
219
+ # @option properties [Boolean] :resizable (true)
220
+ # @option properties [Integer] :width (250)
221
+ # @option properties [Integer] :height (250)
222
+ # @option properties [Integer] :left (0)
223
+ # @option properties [Integer] :top (0)
224
+ # @option properties [Integer] :min_width (0)
225
+ # @option properties [Integer] :min_height (0)
226
+ # @option properties [Integer] :max_width (-1)
227
+ # @option properties [Integer] :max_height (-1)
228
+ # @option properties [Integer] :full_security (false)
229
+ # @option properties [Integer] :mac_only_use_nswindow (false)
230
+ # @return [UI::WebDialog]
231
+ #
232
+ # @version SketchUp 6.0
233
+ def initialize(*args)
234
+ end
235
+
236
+ # The max_height method is used to get the maximum height that the user is
237
+ # allowed to resize the dialog to.
238
+ #
239
+ # @example
240
+ # max = dialog.max_height
241
+ #
242
+ # @return [Integer] the maximum height in pixels
243
+ #
244
+ # @version SketchUp 7.0
245
+ def max_height
246
+ end
247
+
248
+ # The max_height= method is used to set the maximum height that the user is
249
+ # allowed to resize the dialog to.
250
+ #
251
+ # @example
252
+ # dialog.max_height = 400
253
+ #
254
+ # @note As of SU2017 this will automatically scale the height by the same
255
+ # factor as {UI.scale_factor}.
256
+ #
257
+ # @param [Integer] height
258
+ # The maximum height in pixels
259
+ #
260
+ # @return [Integer]
261
+ #
262
+ # @version SketchUp 7.0
263
+ def max_height=(height)
264
+ end
265
+
266
+ # The max_width method is used to get the maximum width that the user is
267
+ # allowed to resize the dialog to.
268
+ #
269
+ # @example
270
+ # max = dialog.max_width
271
+ #
272
+ # @return [Integer] the maximum width in pixels
273
+ #
274
+ # @version SketchUp 7.0
275
+ def max_width
276
+ end
277
+
278
+ # The max_width= method is used to set the maximum width that the user is
279
+ # allowed to resize the dialog to.
280
+ #
281
+ # @example
282
+ # dialog.max_width = 500
283
+ #
284
+ # @note As of SU2017 this will automatically scale the width by the same factor
285
+ # as {UI.scale_factor}.
286
+ #
287
+ # @param [Integer] width
288
+ # The maximum width in pixels
289
+ #
290
+ # @return [Integer]
291
+ #
292
+ # @version SketchUp 7.0
293
+ def max_width=(width)
294
+ end
295
+
296
+ # The min_width method is used to get the minimum height that the user is
297
+ # allowed to resize the dialog to.
298
+ #
299
+ # @example
300
+ # min = dialog.min_height
301
+ #
302
+ # @return [Integer] the minimum height in pixels
303
+ #
304
+ # @version SketchUp 7.0
305
+ def min_height
306
+ end
307
+
308
+ # The min_height= method is used to set the minimum height that the user is
309
+ # allowed to resize the dialog to.
310
+ #
311
+ # @example
312
+ # dialog.min_height = 100
313
+ #
314
+ # @note As of SU2017 this will automatically scale the height by the same
315
+ # factor as {UI.scale_factor}.
316
+ #
317
+ # @param [Integer] height
318
+ # The minimum height in pixels
319
+ #
320
+ # @return [Integer]
321
+ #
322
+ # @version SketchUp 7.0
323
+ def min_height=(height)
324
+ end
325
+
326
+ # The min_width method is used to get the minimum width that the user is
327
+ # allowed to resize the dialog to.
328
+ #
329
+ # @example
330
+ # min = dialog.min_width
331
+ #
332
+ # @return [Integer] the minimum width in pixels
333
+ #
334
+ # @version SketchUp 7.0
335
+ def min_width
336
+ end
337
+
338
+ # The min_width= method is used to set the minimum width that the user is
339
+ # allowed to resize the dialog to.
340
+ #
341
+ # @example
342
+ # dialog.min_width = 200
343
+ #
344
+ # @note As of SU2017 this will automatically scale the width by the same factor
345
+ # as {UI.scale_factor}.
346
+ #
347
+ # @param [Integer] width
348
+ # The minimum width in pixels
349
+ #
350
+ # @return [Integer]
351
+ #
352
+ # @version SketchUp 7.0
353
+ def min_width=(width)
354
+ end
355
+
356
+ # The navigation_buttons_enabled= method is used to set whether the home, next,
357
+ # and back buttons are visible at the top of the WebDialog on the mac. This
358
+ # method has no use on the PC, as these buttons are never displayed.
359
+ #
360
+ # @example
361
+ # dialog.navigation_buttons_enabled = false
362
+ #
363
+ # @return [Boolean]
364
+ #
365
+ # @version SketchUp 7.0
366
+ def navigation_buttons_enabled=(nav_buttons)
367
+ end
368
+
369
+ # The navigation_buttons_enabled? method is used to get whether the home, next,
370
+ # and back buttons are visible at the top of the WebDialog on the mac. This
371
+ # method has no use on the PC, as these buttons are never displayed.
372
+ #
373
+ # On the mac, this defaults to true for new WebDialogs.
374
+ #
375
+ # @example
376
+ # nav_buttons = dialog.navigation_buttons_enabled?
377
+ #
378
+ # @return [Boolean]
379
+ #
380
+ # @version SketchUp 7.0
381
+ def navigation_buttons_enabled?
382
+ end
383
+
384
+ # The post_url method is used to send the data to a url using the HTTP POST
385
+ # method.
386
+ #
387
+ # @example
388
+ # data = dialog.post_url("http://www.mydomain.com/formchecker.cgi",data)
389
+ #
390
+ # @param [String] url
391
+ # The url to send the data.
392
+ #
393
+ # @param [String] data
394
+ # The data to be sent.
395
+ #
396
+ # @return [nil]
397
+ #
398
+ # @version SketchUp 6.0
399
+ def post_url(url, data)
400
+ end
401
+
402
+ # The screen_scale_factor method returns the ratio of screen pixels to logical
403
+ # window units (called 'points' on Mac) for the screen this WebDialog is
404
+ # currently in. On a retina screen Mac, this ratio will be greater than 1.0.
405
+ # On Windows this always return 1.0.
406
+ #
407
+ # @example
408
+ # factor = dialog.screen_scale_factor
409
+ #
410
+ # @return [Float] screen scale factor
411
+ #
412
+ # @version SketchUp 2014
413
+ def screen_scale_factor
414
+ end
415
+
416
+ # The set_background_color method is used to set the background color for the
417
+ # webdialog.
418
+ #
419
+ # @example
420
+ # dlg.set_background_color("f3f0f0")
421
+ #
422
+ # @param [String] color
423
+ # A six digit hexidecimal color.
424
+ #
425
+ # @return [nil]
426
+ #
427
+ # @version SketchUp 6.0
428
+ def set_background_color(color)
429
+ end
430
+
431
+ # The #{set_file} method is used to identify a local HTML file to display in
432
+ # the webdialog.
433
+ #
434
+ # @example
435
+ # file = File.join(__dir__, 'mypage.html')
436
+ # dialog.set_file(file)
437
+ #
438
+ # @param [String] filename
439
+ # The filename for the webdialog file (HTML file).
440
+ #
441
+ # @param [String] path
442
+ # A path that filename is relative to.
443
+ #
444
+ # @return [nil]
445
+ #
446
+ # @version SketchUp 6.0
447
+ def set_file(filename, path = nil)
448
+ end
449
+
450
+ # The set_full_security method is used to place the WebDialog into a higher
451
+ # security mode where remote URLs and plugins (such as Flash) are not allowed
452
+ # inside the browser. This defaults to false when a new WebDialog is created.
453
+ #
454
+ # @example
455
+ # dialog.set_full_security
456
+ #
457
+ # @return [UI::WebDialog] the updated WebDialog
458
+ #
459
+ # @version SketchUp 7.0
460
+ def set_full_security
461
+ end
462
+
463
+ # The set_html method is used to load a webdialog with a string of provided
464
+ # HTML.
465
+ #
466
+ # @example
467
+ # html= '<b>Hello world!</b>'
468
+ # dialog.set_html(html)
469
+ #
470
+ # @param [String] html_string
471
+ # A string of valid html to display in your webdialog.
472
+ #
473
+ # @return [nil]
474
+ #
475
+ # @version SketchUp 6.0
476
+ def set_html(html_string)
477
+ end
478
+
479
+ # The set_on_close method is used to establish one or more activities to
480
+ # perform when the dialog closes (such as saving values stored in the dialog).
481
+ #
482
+ # @example
483
+ # dialog.set_on_close{ UI.messagebox("Closing the webDialog") }
484
+ #
485
+ # @return [nil]
486
+ #
487
+ # @version SketchUp 6.0
488
+ #
489
+ # @yield Ruby block to perform when the dialog closes.
490
+ def set_on_close
491
+ end
492
+
493
+ # The set_position method is used to set the position of the webdialog
494
+ # relative to the screen, in pixels.
495
+ #
496
+ # @example
497
+ # dialog.set_position(100,50)
498
+ #
499
+ # @note As of SU2017 this will automatically scale the x and y by the same
500
+ # factor as {UI.scale_factor}.
501
+ #
502
+ # @param [Integer] left
503
+ # The number of pixels from the left.
504
+ #
505
+ # @param [Integer] top
506
+ # The number of pixels from the top of the screen.
507
+ #
508
+ # @return [nil]
509
+ #
510
+ # @version SketchUp 6.0
511
+ def set_position(left, top)
512
+ end
513
+
514
+ # The set_size method is used to set the size of the webdialog, in pixels.
515
+ #
516
+ # @example
517
+ # dialog.set_size(320,240)
518
+ #
519
+ # @note As of SU2017 this will automatically scale the width and height by the
520
+ # same factor as {UI.scale_factor}.
521
+ #
522
+ # @param [Integer] w
523
+ # Width of the webdialog.
524
+ #
525
+ # @param [Integer] h
526
+ # Height of the webdialog.
527
+ #
528
+ # @return [nil]
529
+ #
530
+ # @version SketchUp 6.0
531
+ def set_size(w, h)
532
+ end
533
+
534
+ # The set_url method is used to load a webdialog with the content at a
535
+ # specific URL. This method allows you to load web sites in a webdialog.
536
+ #
537
+ # @example
538
+ # dialog.set_url "http://www.sketchup.com"
539
+ #
540
+ # @param [String] url
541
+ # The URL for a specific web site.
542
+ #
543
+ # @return [nil]
544
+ #
545
+ # @version SketchUp 6.0
546
+ def set_url(url)
547
+ end
548
+
549
+ # The show method is used to display a non-modal dialog box.
550
+ #
551
+ # @example
552
+ # dialog.show {
553
+ # dialog.execute_script("alert(10)");
554
+ # }
555
+ #
556
+ # @return [nil]
557
+ #
558
+ # @version SketchUp 6.0
559
+ #
560
+ # @yield [dialog] (optional) Ruby code to perform when the dialog is first
561
+ # displayed.
562
+ def show
563
+ end
564
+
565
+ # The show_modal method is used to display a modal dialog box. In SketchUp 6
566
+ # and 7, this behaves differently on Mac vs. PC. On the PC, it shows a truly
567
+ # modal dialog, meaning so long as the WebDialog is visible, no input can be
568
+ # performed elsewhere inside SketchUp. On the Mac, "modal" WebDialogs do not
569
+ # behave this way, but instead are "always on top" of other windows.
570
+ #
571
+ # @example
572
+ # dialog.show_modal {
573
+ # dialog.execute_script("alert(10)");
574
+ # }
575
+ #
576
+ # @return [nil]
577
+ #
578
+ # @version SketchUp 6.0
579
+ #
580
+ # @yield [dialog] (optional) Ruby code to perform when the dialog is first
581
+ # displayed.
582
+ def show_modal
583
+ end
584
+
585
+ # The visible? method is used to tell if the webdialog is currently shown.
586
+ #
587
+ # @example
588
+ # vis = dialog.visible?
589
+ #
590
+ # @return [Boolean]
591
+ #
592
+ # @version SketchUp 6.0
593
+ def visible?
594
+ end
595
+
596
+ # The write_image method is used to grab a portion of the web dialog screen and
597
+ # save the image to the given file path.
598
+ #
599
+ # @example
600
+ # dialog.write_image('c:/grab.jpg', 70, 0, 0, 100, 100)
601
+ # dialog.write_image('c:/grab.png', 4, 0, 0, 100, 100)
602
+ #
603
+ # @param [String] image_path
604
+ # The destination path of the saved image.
605
+ #
606
+ # @param [Integer] option
607
+ # Specifies what method to use when saving the image. For
608
+ # JPG/JPEG images, this specifies the image quality and
609
+ # can range from 1 to 100. For PNG images this specifies
610
+ # the compression algorithm: <4 (best speed), 4-8
611
+ # (default), or >=9 (best compression).
612
+ #
613
+ # @param [Integer] top_left_x
614
+ # The x coordinate of the upper left corner of the
615
+ # region to grab.
616
+ #
617
+ # @param [Integer] top_left_y
618
+ # The x coordinate of the upper left corner of the
619
+ # region to grab.
620
+ #
621
+ # @param [Integer] bottom_right_x
622
+ # The x coordinate of the lower right corner of the
623
+ # region to grab.
624
+ #
625
+ # @param [Integer] bottom_right_y
626
+ # The x coordinate of the lower right corner of the
627
+ # region to grab.
628
+ #
629
+ # @version SketchUp 7.1
630
+ def write_image(image_path, option, top_left_x, top_left_y, bottom_right_x, bottom_right_y)
631
+ end
632
+
633
+ end