sketchup-api-stubs 0.7.9 → 0.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +157 -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 +182 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +111 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +423 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +693 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +535 -509
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +500 -476
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +267 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +133 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +547 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +678 -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 +751 -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/Dictionary.rb +234 -0
  23. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +683 -517
  24. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
  26. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +464 -353
  27. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
  28. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  29. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  30. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  31. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  33. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  34. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
  35. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +614 -567
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  37. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  38. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +282 -183
  39. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +458 -387
  40. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
  41. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +346 -344
  42. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  43. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
  44. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
  45. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1565 -1519
  46. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  49. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  50. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  51. data/lib/sketchup-api-stubs/stubs/Length.rb +286 -278
  52. data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +196 -144
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +145 -150
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +294 -281
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +296 -302
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +473 -478
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +673 -659
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +600 -593
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +252 -257
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +443 -449
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +167 -165
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +403 -406
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1282 -1239
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +122 -125
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1006 -937
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +740 -750
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +289 -282
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +64 -62
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +405 -468
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +432 -406
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +307 -306
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +332 -326
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +380 -422
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +409 -427
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +241 -249
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +55 -48
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1115 -414
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +330 -317
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1714 -1652
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +372 -357
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +133 -130
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +463 -490
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +104 -116
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +939 -797
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +388 -361
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +501 -478
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +385 -361
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +451 -458
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +211 -212
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +259 -255
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +88 -69
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +263 -217
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +283 -262
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +199 -217
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +924 -834
  143. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  144. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
  145. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
  146. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +143 -142
  147. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1566 -1311
  148. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +71 -45
  149. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1429 -1377
  150. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
  151. data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
  152. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +399 -389
  153. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +580 -494
  154. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +280 -269
  155. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +258 -241
  156. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +636 -635
  157. data/lib/sketchup-api-stubs/stubs/UI.rb +791 -683
  158. data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
  159. data/lib/sketchup-api-stubs.rb +1 -1
  160. metadata +10 -24
@@ -1,635 +1,636 @@
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 2026 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
+ # https://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
+ # https://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 "https://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("https://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
+ # @note {UI::WebDialog#close} method should not be called from the {UI::WebDialog#set_on_close}
486
+ # callback. That would make it trigger itself recursively.
487
+ #
488
+ # @return [nil]
489
+ #
490
+ # @version SketchUp 6.0
491
+ #
492
+ # @yield Ruby block to perform when the dialog closes.
493
+ def set_on_close
494
+ end
495
+
496
+ # The set_position method is used to set the position of the webdialog
497
+ # relative to the screen, in pixels.
498
+ #
499
+ # @example
500
+ # dialog.set_position(100,50)
501
+ #
502
+ # @note As of SU2017 this will automatically scale the x and y by the same
503
+ # factor as {UI.scale_factor}.
504
+ #
505
+ # @param [Integer] left
506
+ # The number of pixels from the left.
507
+ #
508
+ # @param [Integer] top
509
+ # The number of pixels from the top of the screen.
510
+ #
511
+ # @return [nil]
512
+ #
513
+ # @version SketchUp 6.0
514
+ def set_position(left, top)
515
+ end
516
+
517
+ # The set_size method is used to set the size of the webdialog, in pixels.
518
+ #
519
+ # @example
520
+ # dialog.set_size(320,240)
521
+ #
522
+ # @note As of SU2017 this will automatically scale the width and height by the
523
+ # same factor as {UI.scale_factor}.
524
+ #
525
+ # @param [Integer] w
526
+ # Width of the webdialog.
527
+ #
528
+ # @param [Integer] h
529
+ # Height of the webdialog.
530
+ #
531
+ # @return [nil]
532
+ #
533
+ # @version SketchUp 6.0
534
+ def set_size(w, h)
535
+ end
536
+
537
+ # The set_url method is used to load a webdialog with the content at a
538
+ # specific URL. This method allows you to load web sites in a webdialog.
539
+ #
540
+ # @example
541
+ # dialog.set_url "https://www.sketchup.com"
542
+ #
543
+ # @param [String] url
544
+ # The URL for a specific web site.
545
+ #
546
+ # @return [nil]
547
+ #
548
+ # @version SketchUp 6.0
549
+ def set_url(url)
550
+ end
551
+
552
+ # The show method is used to display a non-modal dialog box.
553
+ #
554
+ # @example
555
+ # dialog.show {
556
+ # dialog.execute_script("alert(10)");
557
+ # }
558
+ #
559
+ # @return [nil]
560
+ #
561
+ # @version SketchUp 6.0
562
+ #
563
+ # @yield [dialog] (optional) Ruby code to perform when the dialog is first
564
+ # displayed.
565
+ def show
566
+ end
567
+
568
+ # The show_modal method is used to display a modal dialog box. In SketchUp 6
569
+ # and 7, this behaves differently on Mac vs. PC. On the PC, it shows a truly
570
+ # modal dialog, meaning so long as the WebDialog is visible, no input can be
571
+ # performed elsewhere inside SketchUp. On the Mac, "modal" WebDialogs do not
572
+ # behave this way, but instead are "always on top" of other windows.
573
+ #
574
+ # @example
575
+ # dialog.show_modal {
576
+ # dialog.execute_script("alert(10)");
577
+ # }
578
+ #
579
+ # @return [nil]
580
+ #
581
+ # @version SketchUp 6.0
582
+ #
583
+ # @yield [dialog] (optional) Ruby code to perform when the dialog is first
584
+ # displayed.
585
+ def show_modal
586
+ end
587
+
588
+ # The visible? method is used to tell if the webdialog is currently shown.
589
+ #
590
+ # @example
591
+ # vis = dialog.visible?
592
+ #
593
+ # @return [Boolean]
594
+ #
595
+ # @version SketchUp 6.0
596
+ def visible?
597
+ end
598
+
599
+ # The write_image method is used to grab a portion of the web dialog screen and
600
+ # save the image to the given file path.
601
+ #
602
+ # @example
603
+ # dialog.write_image('c:/grab.jpg', 70, 0, 0, 100, 100)
604
+ # dialog.write_image('c:/grab.png', 4, 0, 0, 100, 100)
605
+ #
606
+ # @param [String] image_path
607
+ # The destination path of the saved image.
608
+ #
609
+ # @param [Integer] option
610
+ # Specifies what method to use when saving the image. For
611
+ # JPG/JPEG images, this specifies the image quality and
612
+ # can range from 1 to 100. For PNG images this specifies
613
+ # the compression algorithm: <4 (best speed), 4-8
614
+ # (default), or >=9 (best compression).
615
+ #
616
+ # @param [Integer] top_left_x
617
+ # The x coordinate of the upper left corner of the
618
+ # region to grab.
619
+ #
620
+ # @param [Integer] top_left_y
621
+ # The x coordinate of the upper left corner of the
622
+ # region to grab.
623
+ #
624
+ # @param [Integer] bottom_right_x
625
+ # The x coordinate of the lower right corner of the
626
+ # region to grab.
627
+ #
628
+ # @param [Integer] bottom_right_y
629
+ # The x coordinate of the lower right corner of the
630
+ # region to grab.
631
+ #
632
+ # @version SketchUp 7.1
633
+ def write_image(image_path, option, top_left_x, top_left_y, bottom_right_x, bottom_right_y)
634
+ end
635
+
636
+ end