sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,623 @@
|
|
1
|
+
# Copyright:: Copyright 2017 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 params
|
79
|
+
# Any parameters passed to the dialog from HTML.
|
80
|
+
# This is passed as a single string.
|
81
|
+
#
|
82
|
+
# @yieldparam dialog
|
83
|
+
# The dialog.
|
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 hostname
|
97
|
+
# The name (domain) of the host that your webdialog can
|
98
|
+
# access safely.
|
99
|
+
#
|
100
|
+
# @return nil
|
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 nil
|
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 script
|
138
|
+
# The JavaScript script to execute on the webdialog.
|
139
|
+
#
|
140
|
+
# @return nil
|
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 color - a six digit hexidecimal number representing the
|
154
|
+
# color
|
155
|
+
#
|
156
|
+
# @version SketchUp 6.0
|
157
|
+
def get_default_dialog_color
|
158
|
+
end
|
159
|
+
|
160
|
+
# The get_element_value method is used to get a value, with a given
|
161
|
+
# element_id, from the web dialog's DOM.
|
162
|
+
#
|
163
|
+
# @example
|
164
|
+
# # In Ruby code:
|
165
|
+
# dialog.get_element_value("myTextInput")
|
166
|
+
#
|
167
|
+
# # In webdialog's HTML:
|
168
|
+
# <input type="text" id="myTextInput" value="hello">
|
169
|
+
#
|
170
|
+
# @param element_id
|
171
|
+
# The name of the element in your HTML code.
|
172
|
+
#
|
173
|
+
# @return String containing the retrieved value.
|
174
|
+
#
|
175
|
+
# @version SketchUp 6.0
|
176
|
+
def get_element_value(element_id)
|
177
|
+
end
|
178
|
+
|
179
|
+
# The +new+ method is used to create a new webdialog.
|
180
|
+
#
|
181
|
+
# Since SU2017 the position and size of the dialog is DPI aware - it will scale
|
182
|
+
# to the DPI of the monitor automatically. Specify units as they would be on a
|
183
|
+
# traditional low-DPI monitor.
|
184
|
+
#
|
185
|
+
# Note that the browser which is embedded inside the dialog depends on the
|
186
|
+
# user's OS. On Mac, Safari is embedded, while on the PC whatever version of
|
187
|
+
# Internet Explorer is installed will be embedded.
|
188
|
+
#
|
189
|
+
# @example
|
190
|
+
# dlg = UI::WebDialog.new("Show sketchup.com", true,
|
191
|
+
# "ShowSketchupDotCom", 739, 641, 150, 150, true);
|
192
|
+
# dlg.set_url "http://www.sketchup.com"
|
193
|
+
# dlg.show
|
194
|
+
#
|
195
|
+
# @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = 250, left = 0, top = 0, resizable = true)
|
196
|
+
#
|
197
|
+
# @param [String] dialog_title The title to be displayed in the webdialog.
|
198
|
+
# @param [Boolean] scrollable true if you want to allow scrollbars, false
|
199
|
+
# if you do not want to allow scrollbars.
|
200
|
+
# @param [String, nil] pref_key The registry entry where the location and
|
201
|
+
# size of the dialog will be saved.
|
202
|
+
# If preferences_key is not included, the
|
203
|
+
# location and size will not be stored.
|
204
|
+
# @param [Integer] width The width of the webdialog.
|
205
|
+
# @param [Integer] height The height of the webdialog.
|
206
|
+
# @param [Integer] left The number of pixels from the left.
|
207
|
+
# @param [Integer] top The number of pixels from the top.
|
208
|
+
# @param [Integer] resizable true if you want the webdialog to be resizable,
|
209
|
+
# false if not.
|
210
|
+
# @return [UI::WebDialog]
|
211
|
+
#
|
212
|
+
# @overload initialize(properties)
|
213
|
+
#
|
214
|
+
# @version SketchUp 7.0
|
215
|
+
# @param [Hash] properties A hash containing the initial properties of
|
216
|
+
# the newly created dialog.
|
217
|
+
# @option properties [String] :dialog_title
|
218
|
+
# @option properties [String] :preferences_key
|
219
|
+
# @option properties [Boolean] :scrollable
|
220
|
+
# @option properties [Boolean] :resizable (true)
|
221
|
+
# @option properties [Integer] :width (250)
|
222
|
+
# @option properties [Integer] :height (250)
|
223
|
+
# @option properties [Integer] :left (0)
|
224
|
+
# @option properties [Integer] :top (0)
|
225
|
+
# @option properties [Integer] :min_width (0)
|
226
|
+
# @option properties [Integer] :min_height (0)
|
227
|
+
# @option properties [Integer] :max_width (-1)
|
228
|
+
# @option properties [Integer] :max_height (-1)
|
229
|
+
# @option properties [Integer] :full_security (false)
|
230
|
+
# @option properties [Integer] :mac_only_use_nswindow (false)
|
231
|
+
# @return [UI::WebDialog]
|
232
|
+
#
|
233
|
+
# @version SketchUp 6.0
|
234
|
+
def initialize(*args)
|
235
|
+
end
|
236
|
+
|
237
|
+
# The max_height method is used to get the maximum height that the user is
|
238
|
+
# allowed to resize the dialog to.
|
239
|
+
#
|
240
|
+
# @example
|
241
|
+
# max = dialog.max_height
|
242
|
+
#
|
243
|
+
# @return height - the maximum height in pixels
|
244
|
+
#
|
245
|
+
# @version SketchUp 7.0
|
246
|
+
def max_height
|
247
|
+
end
|
248
|
+
|
249
|
+
# The max_height= method is used to set the maximum height that the user is
|
250
|
+
# allowed to resize the dialog to.
|
251
|
+
#
|
252
|
+
# @example
|
253
|
+
# dialog.max_height = 400
|
254
|
+
#
|
255
|
+
# @param height
|
256
|
+
# The maximum height in pixels
|
257
|
+
#
|
258
|
+
# @return nil
|
259
|
+
#
|
260
|
+
# @version SketchUp 7.0
|
261
|
+
def max_height=(height)
|
262
|
+
end
|
263
|
+
|
264
|
+
# The max_width method is used to get the maximum width that the user is
|
265
|
+
# allowed to resize the dialog to.
|
266
|
+
#
|
267
|
+
# @example
|
268
|
+
# max = dialog.max_width
|
269
|
+
#
|
270
|
+
# @return width - the maximum width in pixels
|
271
|
+
#
|
272
|
+
# @version SketchUp 7.0
|
273
|
+
def max_width
|
274
|
+
end
|
275
|
+
|
276
|
+
# The max_width= method is used to set the maximum width that the user is
|
277
|
+
# allowed to resize the dialog to.
|
278
|
+
#
|
279
|
+
# @example
|
280
|
+
# dialog.max_width = 500
|
281
|
+
#
|
282
|
+
# @param width
|
283
|
+
# The maximum width in pixels
|
284
|
+
#
|
285
|
+
# @return nil
|
286
|
+
#
|
287
|
+
# @version SketchUp 7.0
|
288
|
+
def max_width=(width)
|
289
|
+
end
|
290
|
+
|
291
|
+
# The min_width method is used to get the minimum height that the user is
|
292
|
+
# allowed to resize the dialog to.
|
293
|
+
#
|
294
|
+
# @example
|
295
|
+
# min = dialog.min_height
|
296
|
+
#
|
297
|
+
# @return height - the minimum height in pixels
|
298
|
+
#
|
299
|
+
# @version SketchUp 7.0
|
300
|
+
def min_height
|
301
|
+
end
|
302
|
+
|
303
|
+
# The min_height= method is used to set the minimum height that the user is
|
304
|
+
# allowed to resize the dialog to.
|
305
|
+
#
|
306
|
+
# @example
|
307
|
+
# dialog.min_height = 100
|
308
|
+
#
|
309
|
+
# @param height
|
310
|
+
# The minimum height in pixels
|
311
|
+
#
|
312
|
+
# @return nil
|
313
|
+
#
|
314
|
+
# @version SketchUp 7.0
|
315
|
+
def min_height=(height)
|
316
|
+
end
|
317
|
+
|
318
|
+
# The min_width method is used to get the minimum width that the user is
|
319
|
+
# allowed to resize the dialog to.
|
320
|
+
#
|
321
|
+
# @example
|
322
|
+
# min = dialog.min_width
|
323
|
+
#
|
324
|
+
# @return width - the minimum width in pixels
|
325
|
+
#
|
326
|
+
# @version SketchUp 7.0
|
327
|
+
def min_width
|
328
|
+
end
|
329
|
+
|
330
|
+
# The min_width= method is used to set the minimum width that the user is
|
331
|
+
# allowed to resize the dialog to.
|
332
|
+
#
|
333
|
+
# @example
|
334
|
+
# dialog.min_width = 200
|
335
|
+
#
|
336
|
+
# @param width
|
337
|
+
# The minimum width in pixels
|
338
|
+
#
|
339
|
+
# @return nil
|
340
|
+
#
|
341
|
+
# @version SketchUp 7.0
|
342
|
+
def min_width=(width)
|
343
|
+
end
|
344
|
+
|
345
|
+
# The navigation_buttons_enabled= method is used to set whether the home, next,
|
346
|
+
# and back buttons are visible at the top of the WebDialog on the mac. This
|
347
|
+
# method has no use on the PC, as these buttons are never displayed.
|
348
|
+
#
|
349
|
+
# @example
|
350
|
+
# dialog.navigation_buttons_enabled = false
|
351
|
+
#
|
352
|
+
# @param nav_buttons
|
353
|
+
# true to hide the buttons, false to show them
|
354
|
+
#
|
355
|
+
# @return dialog - the updated WebDialog
|
356
|
+
#
|
357
|
+
# @version SketchUp 7.0
|
358
|
+
def navigation_buttons_enabled=(nav_buttons)
|
359
|
+
end
|
360
|
+
|
361
|
+
# The navigation_buttons_enabled? method is used to get whether the home, next,
|
362
|
+
# and back buttons are visible at the top of the WebDialog on the mac. This
|
363
|
+
# method has no use on the PC, as these buttons are never displayed.
|
364
|
+
#
|
365
|
+
# On the mac, this defaults to true for new WebDialogs.
|
366
|
+
#
|
367
|
+
# @example
|
368
|
+
# nav_buttons = dialog.navigation_buttons_enabled?
|
369
|
+
#
|
370
|
+
# @return nav_buttons - true if the buttons are visible.
|
371
|
+
#
|
372
|
+
# @return [Boolean]
|
373
|
+
#
|
374
|
+
# @version SketchUp 7.0
|
375
|
+
def navigation_buttons_enabled?
|
376
|
+
end
|
377
|
+
|
378
|
+
# The post_url method is used to send the data to a url using the HTTP POST
|
379
|
+
# method.
|
380
|
+
#
|
381
|
+
# @example
|
382
|
+
# data = dialog.post_url("http://www.mydomain.com/formchecker.cgi",data)
|
383
|
+
#
|
384
|
+
# @param url
|
385
|
+
# The url to send the data.
|
386
|
+
#
|
387
|
+
# @param data
|
388
|
+
# The data to be sent.
|
389
|
+
#
|
390
|
+
# @return nil
|
391
|
+
#
|
392
|
+
# @version SketchUp 6.0
|
393
|
+
def post_url(url, data)
|
394
|
+
end
|
395
|
+
|
396
|
+
# The screen_scale_factor method returns the ratio of screen pixels to logical
|
397
|
+
# window units (called 'points' on Mac) for the screen this WebDialog is
|
398
|
+
# currently in. On a retina screen Mac, this ratio will be greater than 1.0.
|
399
|
+
# On Windows this always return 1.0.
|
400
|
+
#
|
401
|
+
# @example
|
402
|
+
# factor = dialog.screen_scale_factor
|
403
|
+
#
|
404
|
+
# @return screen scale factor
|
405
|
+
#
|
406
|
+
# @version SketchUp 2014
|
407
|
+
def screen_scale_factor
|
408
|
+
end
|
409
|
+
|
410
|
+
# The set_background_color method is used to set the background color for the
|
411
|
+
# webdialog.
|
412
|
+
#
|
413
|
+
# @example
|
414
|
+
# dlg.set_background_color("f3f0f0")
|
415
|
+
#
|
416
|
+
# @param color
|
417
|
+
# A six digit hexidecimal color.
|
418
|
+
#
|
419
|
+
# @return nil
|
420
|
+
#
|
421
|
+
# @version SketchUp 6.0
|
422
|
+
def set_background_color(color)
|
423
|
+
end
|
424
|
+
|
425
|
+
# The #{set_file} method is used to identify a local HTML file to display in
|
426
|
+
# the webdialog.
|
427
|
+
#
|
428
|
+
# @example
|
429
|
+
# file = File.join(__dir__, 'mypage.html')
|
430
|
+
# dialog.set_file(file)
|
431
|
+
#
|
432
|
+
# @param [String] filename
|
433
|
+
# The filename for the webdialog file (HTML file).
|
434
|
+
#
|
435
|
+
# @param [String] path
|
436
|
+
# A path that filename is relative to.
|
437
|
+
#
|
438
|
+
# @return [nil]
|
439
|
+
#
|
440
|
+
# @version SketchUp 6.0
|
441
|
+
def set_file(filename, path = nil)
|
442
|
+
end
|
443
|
+
|
444
|
+
# The set_full_security method is used to place the WebDialog into a higher
|
445
|
+
# security mode where remote URLs and plugins (such as Flash) are not allowed
|
446
|
+
# inside the browser. This defaults to false when a new WebDialog is created.
|
447
|
+
#
|
448
|
+
# @example
|
449
|
+
# dialog.set_full_security
|
450
|
+
#
|
451
|
+
# @return dialog - the updated WebDialog
|
452
|
+
#
|
453
|
+
# @version SketchUp 7.0
|
454
|
+
def set_full_security
|
455
|
+
end
|
456
|
+
|
457
|
+
# The set_html method is used to load a webdialog with a string of provided
|
458
|
+
# HTML.
|
459
|
+
#
|
460
|
+
# @example
|
461
|
+
# html= '<b>Hello world!</b>'
|
462
|
+
# dialog.set_html(html)
|
463
|
+
#
|
464
|
+
# @param html_string
|
465
|
+
# A string of valid html to display in your webdialog.
|
466
|
+
#
|
467
|
+
# @return nil
|
468
|
+
#
|
469
|
+
# @version SketchUp 6.0
|
470
|
+
def set_html(html_string)
|
471
|
+
end
|
472
|
+
|
473
|
+
# The set_on_close method is used to establish one or more activities to
|
474
|
+
# perform when the dialog closes (such as saving values stored in the dialog).
|
475
|
+
#
|
476
|
+
# @example
|
477
|
+
# dialog.set_on_close{ UI.messagebox("Closing the webDialog") }
|
478
|
+
#
|
479
|
+
# @return nil
|
480
|
+
#
|
481
|
+
# @version SketchUp 6.0
|
482
|
+
#
|
483
|
+
# @yield Ruby block to perform when the dialog closes.
|
484
|
+
def set_on_close
|
485
|
+
end
|
486
|
+
|
487
|
+
# The set_position method is used to set the position of the webdialog
|
488
|
+
# relative to the screen, in pixels.
|
489
|
+
#
|
490
|
+
# @example
|
491
|
+
# dialog.set_position(100,50)
|
492
|
+
#
|
493
|
+
# @param left
|
494
|
+
# The number of pixels from the left.
|
495
|
+
#
|
496
|
+
# @param top
|
497
|
+
# The number of pixels from the top of the screen.
|
498
|
+
#
|
499
|
+
# @return nil
|
500
|
+
#
|
501
|
+
# @version SketchUp 6.0
|
502
|
+
def set_position(left, top)
|
503
|
+
end
|
504
|
+
|
505
|
+
# The set_size method is used to set the size of the webdialog, in pixels.
|
506
|
+
#
|
507
|
+
# @example
|
508
|
+
# dialog.set_size(320,240)
|
509
|
+
#
|
510
|
+
# @param w
|
511
|
+
# Width of the webdialog.
|
512
|
+
#
|
513
|
+
# @param h
|
514
|
+
# Height of the webdialog.
|
515
|
+
#
|
516
|
+
# @return nil
|
517
|
+
#
|
518
|
+
# @version SketchUp 6.0
|
519
|
+
def set_size(w, h)
|
520
|
+
end
|
521
|
+
|
522
|
+
# The set_url method is used to load a webdialog with the content at a
|
523
|
+
# specific URL. This method allows you to load web sites in a webdialog.
|
524
|
+
#
|
525
|
+
# @example
|
526
|
+
# dialog.set_url "http://www.sketchup.com"
|
527
|
+
#
|
528
|
+
# @param url
|
529
|
+
# The URL for a specific web site.
|
530
|
+
#
|
531
|
+
# @return nil
|
532
|
+
#
|
533
|
+
# @version SketchUp 6.0
|
534
|
+
def set_url(url)
|
535
|
+
end
|
536
|
+
|
537
|
+
# The show method is used to display a non-modal dialog box.
|
538
|
+
#
|
539
|
+
# @example
|
540
|
+
# dialog.show {
|
541
|
+
# dialog.execute_script("alert(10)");
|
542
|
+
# }
|
543
|
+
#
|
544
|
+
# @return nil
|
545
|
+
#
|
546
|
+
# @version SketchUp 6.0
|
547
|
+
#
|
548
|
+
# @yield [dialog] (optional) Ruby code to perform when the dialog is first
|
549
|
+
# displayed.
|
550
|
+
def show
|
551
|
+
end
|
552
|
+
|
553
|
+
# The show_modal method is used to display a modal dialog box. In SketchUp 6
|
554
|
+
# and 7, this behaves differently on Mac vs. PC. On the PC, it shows a truly
|
555
|
+
# modal dialog, meaning so long as the WebDialog is visible, no input can be
|
556
|
+
# performed elsewhere inside SketchUp. On the Mac, "modal" WebDialogs do not
|
557
|
+
# behave this way, but instead are "always on top" of other windows.
|
558
|
+
#
|
559
|
+
# @example
|
560
|
+
# dialog.show_modal {
|
561
|
+
# dialog.execute_script("alert(10)");
|
562
|
+
# }
|
563
|
+
#
|
564
|
+
# @return nil
|
565
|
+
#
|
566
|
+
# @version SketchUp 6.0
|
567
|
+
#
|
568
|
+
# @yield [dialog] (optional) Ruby code to perform when the dialog is first
|
569
|
+
# displayed.
|
570
|
+
def show_modal
|
571
|
+
end
|
572
|
+
|
573
|
+
# The visible? method is used to tell if the webdialog is currently shown.
|
574
|
+
#
|
575
|
+
# @example
|
576
|
+
# vis = dialog.visible?
|
577
|
+
#
|
578
|
+
# @return visibility - true if visible.
|
579
|
+
#
|
580
|
+
# @return [Boolean]
|
581
|
+
#
|
582
|
+
# @version SketchUp 6.0
|
583
|
+
def visible?
|
584
|
+
end
|
585
|
+
|
586
|
+
# The write_image method is used to grab a portion of the web dialog screen and
|
587
|
+
# save the image to the given file path.
|
588
|
+
#
|
589
|
+
# @example
|
590
|
+
# dialog.write_image('c:/grab.jpg', 70, 0, 0, 100, 100)
|
591
|
+
# dialog.write_image('c:/grab.png', 4, 0, 0, 100, 100)
|
592
|
+
#
|
593
|
+
# @param option
|
594
|
+
# Specifies what method to use when saving the image. For
|
595
|
+
# JPG/JPEG images, this specifies the image quality and
|
596
|
+
# can range from 1 to 100. For PNG images this specifies
|
597
|
+
# the compression algorithm: <4 (best speed), 4-8
|
598
|
+
# (default), or >=9 (best compression).
|
599
|
+
#
|
600
|
+
# @param image_path
|
601
|
+
# The destination path of the saved image.
|
602
|
+
#
|
603
|
+
# @param bottom_right_y
|
604
|
+
# The x coordinate of the lower right corner of the
|
605
|
+
# region to grab.
|
606
|
+
#
|
607
|
+
# @param bottom_right_x
|
608
|
+
# The x coordinate of the lower right corner of the
|
609
|
+
# region to grab.
|
610
|
+
#
|
611
|
+
# @param top_left_y
|
612
|
+
# The x coordinate of the upper left corner of the
|
613
|
+
# region to grab.
|
614
|
+
#
|
615
|
+
# @param top_left_x
|
616
|
+
# The x coordinate of the upper left corner of the
|
617
|
+
# region to grab.
|
618
|
+
#
|
619
|
+
# @version SketchUp 7.1
|
620
|
+
def write_image(image_path, option, top_left_x, top_left_y, bottom_right_x, bottom_right_y)
|
621
|
+
end
|
622
|
+
|
623
|
+
end
|