sketchup-api-stubs 0.7.9 → 0.7.10

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