sketchup-api-stubs 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardopts +7 -7
- data/SketchUp/Geom/BoundingBox.rb +7 -15
- data/SketchUp/Geom/Bounds2d.rb +18 -18
- data/SketchUp/Geom/LatLong.rb +6 -6
- data/SketchUp/Geom/OrientedBounds2d.rb +1 -1
- data/SketchUp/Geom/Point2d.rb +42 -6
- data/SketchUp/Geom/Point3d.rb +32 -21
- data/SketchUp/Geom/PolygonMesh.rb +22 -17
- data/SketchUp/Geom/Transformation.rb +35 -35
- data/SketchUp/Geom/Transformation2d.rb +153 -13
- data/SketchUp/Geom/UTM.rb +1 -1
- data/SketchUp/Geom/Vector2d.rb +45 -9
- data/SketchUp/Geom/Vector3d.rb +11 -11
- data/SketchUp/Layout.rb +1 -1
- data/SketchUp/Layout/AngularDimension.rb +25 -25
- data/SketchUp/Layout/AutoTextDefinition.rb +5 -5
- data/SketchUp/Layout/AutoTextDefinitions.rb +1 -1
- data/SketchUp/Layout/ConnectionPoint.rb +1 -1
- data/SketchUp/Layout/Document.rb +6 -5
- data/SketchUp/Layout/Ellipse.rb +1 -1
- data/SketchUp/Layout/Entities.rb +1 -1
- data/SketchUp/Layout/Entity.rb +16 -16
- data/SketchUp/Layout/FormattedText.rb +21 -21
- data/SketchUp/Layout/Grid.rb +1 -1
- data/SketchUp/Layout/Group.rb +18 -18
- data/SketchUp/Layout/Image.rb +6 -6
- data/SketchUp/Layout/Label.rb +15 -15
- data/SketchUp/Layout/Layer.rb +5 -5
- data/SketchUp/Layout/LayerInstance.rb +3 -3
- data/SketchUp/Layout/Layers.rb +1 -1
- data/SketchUp/Layout/LinearDimension.rb +25 -25
- data/SketchUp/Layout/LockedEntityError.rb +1 -1
- data/SketchUp/Layout/LockedLayerError.rb +1 -1
- data/SketchUp/Layout/Page.rb +3 -3
- data/SketchUp/Layout/PageInfo.rb +1 -1
- data/SketchUp/Layout/Pages.rb +1 -1
- data/SketchUp/Layout/Path.rb +47 -27
- data/SketchUp/Layout/Rectangle.rb +8 -8
- data/SketchUp/Layout/SketchUpModel.rb +61 -26
- data/SketchUp/Layout/Style.rb +18 -17
- data/SketchUp/Layout/Table.rb +14 -14
- data/SketchUp/Layout/TableCell.rb +5 -5
- data/SketchUp/Layout/TableColumn.rb +7 -7
- data/SketchUp/Layout/TableRow.rb +7 -7
- data/SketchUp/Sketchup/Animation.rb +1 -1
- data/SketchUp/Sketchup/AppObserver.rb +1 -1
- data/SketchUp/Sketchup/ArcCurve.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionaries.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionary.rb +7 -7
- data/SketchUp/Sketchup/Axes.rb +4 -4
- data/SketchUp/Sketchup/Behavior.rb +1 -1
- data/SketchUp/Sketchup/Camera.rb +30 -41
- data/SketchUp/Sketchup/ClassificationSchema.rb +1 -1
- data/SketchUp/Sketchup/Classifications.rb +1 -1
- data/SketchUp/Sketchup/Color.rb +1 -1
- data/SketchUp/Sketchup/ComponentDefinition.rb +3 -3
- data/SketchUp/Sketchup/ComponentInstance.rb +10 -10
- data/SketchUp/Sketchup/Console.rb +5 -5
- data/SketchUp/Sketchup/ConstructionLine.rb +11 -11
- data/SketchUp/Sketchup/ConstructionPoint.rb +1 -1
- data/SketchUp/Sketchup/Curve.rb +1 -1
- data/SketchUp/Sketchup/DefinitionList.rb +12 -9
- data/SketchUp/Sketchup/DefinitionObserver.rb +6 -7
- data/SketchUp/Sketchup/DefinitionsObserver.rb +3 -3
- data/SketchUp/Sketchup/Dimension.rb +1 -1
- data/SketchUp/Sketchup/DimensionLinear.rb +81 -1
- data/SketchUp/Sketchup/DimensionObserver.rb +1 -1
- data/SketchUp/Sketchup/DimensionRadial.rb +1 -1
- data/SketchUp/Sketchup/Drawingelement.rb +1 -1
- data/SketchUp/Sketchup/Edge.rb +13 -16
- data/SketchUp/Sketchup/EdgeUse.rb +1 -1
- data/SketchUp/Sketchup/Entities.rb +181 -100
- data/SketchUp/Sketchup/EntitiesObserver.rb +1 -1
- data/SketchUp/Sketchup/Entity.rb +29 -26
- data/SketchUp/Sketchup/EntityObserver.rb +1 -1
- data/SketchUp/Sketchup/ExtensionsManager.rb +1 -1
- data/SketchUp/Sketchup/Face.rb +7 -7
- data/SketchUp/Sketchup/FrameChangeObserver.rb +4 -4
- data/SketchUp/Sketchup/Group.rb +1 -1
- data/SketchUp/Sketchup/Http.rb +1 -1
- data/SketchUp/Sketchup/Http/Request.rb +3 -3
- data/SketchUp/Sketchup/Http/Response.rb +1 -1
- data/SketchUp/Sketchup/Image.rb +1 -1
- data/SketchUp/Sketchup/ImageRep.rb +16 -16
- data/SketchUp/Sketchup/Importer.rb +1 -1
- data/SketchUp/Sketchup/InputPoint.rb +8 -4
- data/SketchUp/Sketchup/InstanceObserver.rb +1 -1
- data/SketchUp/Sketchup/InstancePath.rb +15 -12
- data/SketchUp/Sketchup/Layer.rb +27 -1
- data/SketchUp/Sketchup/Layers.rb +1 -1
- data/SketchUp/Sketchup/LayersObserver.rb +1 -1
- data/SketchUp/Sketchup/Licensing.rb +1 -1
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/SketchUp/Sketchup/LineStyle.rb +24 -0
- data/SketchUp/Sketchup/LineStyles.rb +123 -0
- data/SketchUp/Sketchup/Loop.rb +1 -1
- data/SketchUp/Sketchup/Material.rb +16 -10
- data/SketchUp/Sketchup/Materials.rb +9 -1
- data/SketchUp/Sketchup/MaterialsObserver.rb +3 -3
- data/SketchUp/Sketchup/Menu.rb +1 -1
- data/SketchUp/Sketchup/Model.rb +47 -21
- data/SketchUp/Sketchup/ModelObserver.rb +3 -3
- data/SketchUp/Sketchup/OptionsManager.rb +1 -1
- data/SketchUp/Sketchup/OptionsProvider.rb +5 -5
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +1 -1
- data/SketchUp/Sketchup/Page.rb +1 -1
- data/SketchUp/Sketchup/Pages.rb +13 -8
- data/SketchUp/Sketchup/PagesObserver.rb +1 -1
- data/SketchUp/Sketchup/PickHelper.rb +49 -50
- data/SketchUp/Sketchup/RegionalSettings.rb +1 -1
- data/SketchUp/Sketchup/RenderingOptions.rb +4 -4
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +3 -3
- data/SketchUp/Sketchup/SectionPlane.rb +1 -1
- data/SketchUp/Sketchup/Selection.rb +3 -3
- data/SketchUp/Sketchup/SelectionObserver.rb +3 -3
- data/SketchUp/Sketchup/Set.rb +1 -1
- data/SketchUp/Sketchup/ShadowInfo.rb +3 -3
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +1 -1
- data/SketchUp/Sketchup/Style.rb +1 -1
- data/SketchUp/Sketchup/Styles.rb +1 -1
- data/SketchUp/Sketchup/Text.rb +28 -1
- data/SketchUp/Sketchup/Texture.rb +1 -1
- data/SketchUp/Sketchup/TextureWriter.rb +13 -13
- data/SketchUp/Sketchup/Tool.rb +68 -64
- data/SketchUp/Sketchup/Tools.rb +13 -1
- data/SketchUp/Sketchup/ToolsObserver.rb +13 -13
- data/SketchUp/Sketchup/UVHelper.rb +1 -1
- data/SketchUp/Sketchup/Vertex.rb +1 -1
- data/SketchUp/Sketchup/View.rb +57 -56
- data/SketchUp/Sketchup/ViewObserver.rb +2 -2
- data/SketchUp/UI/Command.rb +4 -1
- data/SketchUp/UI/HtmlDialog.rb +23 -14
- data/SketchUp/UI/Notification.rb +10 -10
- data/SketchUp/UI/Toolbar.rb +1 -1
- data/SketchUp/UI/WebDialog.rb +38 -20
- data/SketchUp/_top_level.rb +32 -34
- data/SketchUp/array.rb +125 -112
- data/SketchUp/geom.rb +2 -2
- data/SketchUp/languagehandler.rb +1 -1
- data/SketchUp/length.rb +1 -1
- data/SketchUp/numeric.rb +3 -3
- data/SketchUp/sketchup.rb +11 -11
- data/SketchUp/sketchupextension.rb +6 -2
- data/SketchUp/string.rb +1 -1
- data/SketchUp/ui.rb +14 -14
- data/autoload/sketchup.rb +2 -0
- metadata +5 -3
data/SketchUp/Sketchup/Vertex.rb
CHANGED
data/SketchUp/Sketchup/View.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This class contains methods to manipulate the current point of view of the
|
@@ -80,15 +80,14 @@ class Sketchup::View
|
|
80
80
|
def camera
|
81
81
|
end
|
82
82
|
|
83
|
-
# The camera= method is used to set the camera for the view. If a transition
|
83
|
+
# The {#camera=} method is used to set the camera for the view. If a transition
|
84
84
|
# time is given, then it will animate the transition from the current camera
|
85
85
|
# to the new one.
|
86
86
|
#
|
87
87
|
# @example
|
88
|
-
#
|
89
|
-
#
|
90
|
-
# view =
|
91
|
-
# status = view.camera=camera2
|
88
|
+
# camera = Sketchup::Camera.new([5, 5, 9], [5, 10, 0], Z_AXIS)
|
89
|
+
# view = Sketchup.active_model.active_view
|
90
|
+
# view.camera = camera
|
92
91
|
#
|
93
92
|
# @overload camera=(camera)
|
94
93
|
#
|
@@ -333,16 +332,16 @@ class Sketchup::View
|
|
333
332
|
# @param [Array<Geom::Point3d>] pts
|
334
333
|
# An array of Point3d objects.
|
335
334
|
#
|
336
|
-
# @param [Integer]
|
337
|
-
#
|
338
|
-
# 2 = filled square, 3 = "+", 4 = "X", 5 = "*",
|
339
|
-
# 6 = open triangle, 7 = filled triangle.
|
335
|
+
# @param [Integer] pointsize
|
336
|
+
# Size of the point in pixels.
|
340
337
|
#
|
341
338
|
# @param [Sketchup::Color] pointcolor
|
342
339
|
# Color of the point.
|
343
340
|
#
|
344
|
-
# @param [Integer]
|
345
|
-
#
|
341
|
+
# @param [Integer] pointstyle
|
342
|
+
# Style of the point. 1 = open square,
|
343
|
+
# 2 = filled square, 3 = "+", 4 = "X", 5 = "*",
|
344
|
+
# 6 = open triangle, 7 = filled triangle.
|
346
345
|
#
|
347
346
|
# @return [Sketchup::View] a View object
|
348
347
|
#
|
@@ -404,31 +403,34 @@ class Sketchup::View
|
|
404
403
|
# @note Under Windows the font name must be less than 32 characters - due to
|
405
404
|
# system limitations.
|
406
405
|
#
|
407
|
-
# @
|
406
|
+
# @note As of SU2017 this will automatically scale the font-size by the same
|
407
|
+
# factor as {UI.scale_factor}.
|
408
408
|
#
|
409
|
-
# @option options [
|
410
|
-
#
|
409
|
+
# @option options [String] :font The name of the font to use. If it does not
|
410
|
+
# exist on the system, a default font will be used instead.
|
411
411
|
#
|
412
|
-
# @option options [
|
412
|
+
# @option options [Integer] :size The size of the font in points
|
413
413
|
#
|
414
414
|
# @option options [Boolean] :bold Controls the Bold property of the font.
|
415
415
|
#
|
416
|
-
# @option options [
|
417
|
-
#
|
418
|
-
# @option options [String] :font The name of the font to use. If it does not
|
419
|
-
# exist on the system, a default font will be used instead.
|
416
|
+
# @option options [Boolean] :italic Controls the Italic property of the font.
|
420
417
|
#
|
421
|
-
# @
|
422
|
-
# The text can be customized by providing a hash or
|
423
|
-
# named arguments of options. Available from SketchUp 2016.
|
418
|
+
# @option options [Sketchup::Color] :color The color to draw the text with.
|
424
419
|
#
|
425
|
-
# @
|
426
|
-
#
|
420
|
+
# @option options [Integer] :align The text alignment, one of the following
|
421
|
+
# constants +TextAlignLeft+, +TextAlignCenter+ or +TextAlignRight+.
|
427
422
|
#
|
428
423
|
# @param [Geom::Point3d] point
|
429
424
|
# A Point3d object representing a 2D coordinate
|
430
425
|
# in view space.
|
431
426
|
#
|
427
|
+
# @param [String] text
|
428
|
+
# The text string to draw.
|
429
|
+
#
|
430
|
+
# @param [Hash] options
|
431
|
+
# The text can be customized by providing a hash or
|
432
|
+
# named arguments of options. Available from SketchUp 2016.
|
433
|
+
#
|
432
434
|
# @return [Sketchup::View]
|
433
435
|
#
|
434
436
|
# @version SketchUp 6.0
|
@@ -545,12 +547,12 @@ class Sketchup::View
|
|
545
547
|
# @param [Numeric] x
|
546
548
|
# A x value.
|
547
549
|
#
|
548
|
-
# @param [Sketchup::InputPoint] inputpoint1
|
549
|
-
# An InputPoint object.
|
550
|
-
#
|
551
550
|
# @param [Numeric] y
|
552
551
|
# A y value.
|
553
552
|
#
|
553
|
+
# @param [Sketchup::InputPoint] inputpoint1
|
554
|
+
# An InputPoint object.
|
555
|
+
#
|
554
556
|
# @return [Sketchup::InputPoint]
|
555
557
|
#
|
556
558
|
# @version SketchUp 6.0
|
@@ -619,6 +621,9 @@ class Sketchup::View
|
|
619
621
|
# @example
|
620
622
|
# view.line_width = width
|
621
623
|
#
|
624
|
+
# @note As of SU2017 this will automatically scale the line width by the same
|
625
|
+
# factor as {UI.scale_factor}.
|
626
|
+
#
|
622
627
|
# @param [Integer] width
|
623
628
|
# The width in pixels.
|
624
629
|
#
|
@@ -726,7 +731,10 @@ class Sketchup::View
|
|
726
731
|
# desired size in pixels.
|
727
732
|
#
|
728
733
|
# @example
|
729
|
-
# size = view.pixels_to_model
|
734
|
+
# size = view.pixels_to_model(pixels, point)
|
735
|
+
#
|
736
|
+
# @note As of SU2017 this will automatically scale the pixel-size by the same
|
737
|
+
# factor as {UI.scale_factor}.
|
730
738
|
#
|
731
739
|
# @param [Numeric] pixels
|
732
740
|
# The pixel size.
|
@@ -880,32 +888,9 @@ class Sketchup::View
|
|
880
888
|
#
|
881
889
|
# If a hash is passed as the first parameter, then the contents of that hash
|
882
890
|
# define how the image is exported.
|
883
|
-
#
|
884
|
-
#
|
885
|
-
#
|
886
|
-
# - height (optional) Height in pixels (max 16000).
|
887
|
-
# - antialias (optional) true or false
|
888
|
-
# - compression (optional) Float compression factor for JPEG images,
|
889
|
-
# between 0.0 and 1.0
|
890
|
-
# - transparent true or false
|
891
|
-
#
|
892
|
-
# @example
|
893
|
-
# depth = 100
|
894
|
-
# width = 100
|
895
|
-
# model = Sketchup.active_model
|
896
|
-
# entities = model.active_entities
|
897
|
-
# pts = []
|
898
|
-
# pts[0] = [0, 0, 0]
|
899
|
-
# pts[1] = [width, 0, 0]
|
900
|
-
# pts[2] = [width, depth, 0]
|
901
|
-
# pts[3] = [0, depth, 0]
|
902
|
-
# # Add the face to the entities in the model
|
903
|
-
# face = entities.add_face pts
|
904
|
-
# UI.messagebox "Now Lets Write the Image"
|
905
|
-
# view = model.active_view
|
906
|
-
# # Puts in SketchUp install directory by default
|
907
|
-
# status = view.write_image "test.jpg"
|
908
|
-
# keys = {
|
891
|
+
#
|
892
|
+
# @example With options hash.
|
893
|
+
# options = {
|
909
894
|
# :filename => "c:/tmp/write_image.png",
|
910
895
|
# :width => 640,
|
911
896
|
# :height => 480,
|
@@ -915,7 +900,15 @@ class Sketchup::View
|
|
915
900
|
# }
|
916
901
|
# model = Sketchup.active_model
|
917
902
|
# view = model.active_view
|
918
|
-
# view.write_image
|
903
|
+
# view.write_image(options)
|
904
|
+
#
|
905
|
+
# @example Legacy arguments variant.
|
906
|
+
# filename => "c:/tmp/write_image.png"
|
907
|
+
# antialias => false
|
908
|
+
# compression => 0.9
|
909
|
+
# model = Sketchup.active_model
|
910
|
+
# view = model.active_view
|
911
|
+
# view.write_image(filename, 640, 480, antialias, compression)
|
919
912
|
#
|
920
913
|
# @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false, compression = 1.0)
|
921
914
|
#
|
@@ -933,7 +926,15 @@ class Sketchup::View
|
|
933
926
|
#
|
934
927
|
# @overload write_image(options)
|
935
928
|
#
|
929
|
+
# @version SketchUp 7
|
936
930
|
# @param [Hash] options
|
931
|
+
# @option options [String] filename The filename for the saved image.
|
932
|
+
# @option options [Integer] width (#vpwidth) Width in pixels (max 16000).
|
933
|
+
# @option options [Integer] height (#vpheight) Height in pixels (max 16000).
|
934
|
+
# @option options [Boolean] antialias (false)
|
935
|
+
# @option options [Float] compression (1.0) Compression factor for JPEG,
|
936
|
+
# images between 0.0 and 1.0
|
937
|
+
# @option options [Boolean] transparent (false) Added in SketchUp 8.
|
937
938
|
#
|
938
939
|
# @return [Boolean]
|
939
940
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This observer interface is implemented to react to view events. To implement
|
@@ -26,7 +26,7 @@ class Sketchup::ViewObserver
|
|
26
26
|
#
|
27
27
|
# @example
|
28
28
|
# def onViewChanged(view)
|
29
|
-
#
|
29
|
+
# puts "onViewChanged: #{view}"
|
30
30
|
# end
|
31
31
|
#
|
32
32
|
# @param [Sketchup::View] view
|
data/SketchUp/UI/Command.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Command class is the preferred class for adding tools to the menus and
|
@@ -49,6 +49,9 @@ class UI::Command
|
|
49
49
|
# cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
|
50
50
|
# testmenu.add_item cmd
|
51
51
|
#
|
52
|
+
# @note Prior to SketchUp 2019 it was not possible to sub-class {UI::Command}
|
53
|
+
# due to a bug in how SketchUp initialized the class.
|
54
|
+
#
|
52
55
|
# @param [String] menutext
|
53
56
|
# The text that will appear for this command's menu item
|
54
57
|
# if it appears on a menu.
|
data/SketchUp/UI/HtmlDialog.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Ruby HtmlDialog class allows you to create and interact with HTML dialog
|
@@ -9,6 +9,11 @@
|
|
9
9
|
# {UI#openURL}, which will show them a web page in their default browser rather
|
10
10
|
# than inside a dialog in SketchUp.
|
11
11
|
#
|
12
|
+
# The left, top, width, height etc. dimensions of the dialog are in logical
|
13
|
+
# units. This means you provide the units as if they where on a monitor with
|
14
|
+
# "normal" DPI. The units given will be multiplied by the same factor as
|
15
|
+
# returned by {UI.scale_factor}.
|
16
|
+
#
|
12
17
|
# @version SketchUp 2017
|
13
18
|
class UI::HtmlDialog
|
14
19
|
|
@@ -33,6 +38,11 @@ class UI::HtmlDialog
|
|
33
38
|
# Basic types such as booleans, numbers, strings, arrays and hashes are
|
34
39
|
# automatically converted between Ruby and JavaScript.
|
35
40
|
#
|
41
|
+
# @example Ruby Code
|
42
|
+
# dialog.add_action_callback("say") { |action_context, param1, param2|
|
43
|
+
# puts "JavaScript said #{param1} and #{param2}"
|
44
|
+
# }
|
45
|
+
#
|
36
46
|
# @example JavaScript
|
37
47
|
# sketchup.say('Hello World', 42);
|
38
48
|
#
|
@@ -43,11 +53,6 @@ class UI::HtmlDialog
|
|
43
53
|
# }
|
44
54
|
# });
|
45
55
|
#
|
46
|
-
# @example Ruby Code
|
47
|
-
# dialog.add_action_callback("say") { |action_context, param1, param2|
|
48
|
-
# puts "JavaScript said #{param1} and #{param2}"
|
49
|
-
# }
|
50
|
-
#
|
51
56
|
# @note When an HtmlDialog is closed, all callbacks to that instance are
|
52
57
|
# cleared. Re-attach them if you need to open the dialog again.
|
53
58
|
#
|
@@ -62,11 +67,11 @@ class UI::HtmlDialog
|
|
62
67
|
#
|
63
68
|
# @yield [action_context, ...]
|
64
69
|
#
|
65
|
-
# @yieldparam [Object] ...
|
66
|
-
# The parameters sent from JavaScript.
|
67
|
-
#
|
68
70
|
# @yieldparam [Object] action_context
|
69
71
|
# action_context Currently unused.
|
72
|
+
#
|
73
|
+
# @yieldparam [Object] ...
|
74
|
+
# The parameters sent from JavaScript.
|
70
75
|
def add_action_callback(callback_name)
|
71
76
|
end
|
72
77
|
|
@@ -156,9 +161,9 @@ class UI::HtmlDialog
|
|
156
161
|
# dialog.set_url("http://www.sketchup.com")
|
157
162
|
# dialog.show
|
158
163
|
#
|
159
|
-
# @
|
160
|
-
#
|
161
|
-
#
|
164
|
+
# @note Prior to SketchUp 2019 the +:width+ and +:height+ provided is ignored
|
165
|
+
# if a +:preference_key+ is also present. To work around this bug on older
|
166
|
+
# versions use {#set_size} after you initialize the dialog.
|
162
167
|
#
|
163
168
|
# @option properties [String] :dialog_title
|
164
169
|
#
|
@@ -168,9 +173,9 @@ class UI::HtmlDialog
|
|
168
173
|
#
|
169
174
|
# @option properties [Boolean] :resizable (true)
|
170
175
|
#
|
171
|
-
# @option properties [Integer] :
|
176
|
+
# @option properties [Integer] :width (250)
|
172
177
|
#
|
173
|
-
# @option properties [Integer] :
|
178
|
+
# @option properties [Integer] :height (250)
|
174
179
|
#
|
175
180
|
# @option properties [Integer] :left (0)
|
176
181
|
#
|
@@ -180,6 +185,10 @@ class UI::HtmlDialog
|
|
180
185
|
#
|
181
186
|
# @option properties [Integer] :min_height (0)
|
182
187
|
#
|
188
|
+
# @option properties [Integer] :max_width (-1)
|
189
|
+
#
|
190
|
+
# @option properties [Integer] :max_height (-1)
|
191
|
+
#
|
183
192
|
# @option properties [Integer] :style (UI::HtmlDialog::STYLE_DIALOG)
|
184
193
|
#
|
185
194
|
# @param [Hash] properties
|
data/SketchUp/UI/Notification.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# UI::Notification objects allows you to show native notifications in the
|
@@ -47,7 +47,7 @@ class UI::Notification
|
|
47
47
|
#
|
48
48
|
# @example
|
49
49
|
# notification = UI::Notification.new(sketchup_extension, "Hello world", "/path/to/icon", "icon Tooltip")
|
50
|
-
# puts "Tooltip:
|
50
|
+
# puts "Tooltip: #{notification.icon_tooltip}"
|
51
51
|
# notification.show
|
52
52
|
#
|
53
53
|
# @return [String]
|
@@ -81,18 +81,18 @@ class UI::Notification
|
|
81
81
|
# notification = UI::Notification.new(sketchup_extension, "Hello world", "/path/to/icon", "icon Tooltip")
|
82
82
|
# notification.show
|
83
83
|
#
|
84
|
-
# @param [
|
85
|
-
#
|
86
|
-
#
|
87
|
-
# @param [String] icon_name
|
88
|
-
# Optionally set a path to an image.
|
84
|
+
# @param [SketchupExtension] sketchup_extension
|
85
|
+
# Required sketchup_extension
|
86
|
+
# to identify the sender.
|
89
87
|
#
|
90
88
|
# @param [String] message
|
91
89
|
# Optionally assign the message.
|
92
90
|
#
|
93
|
-
# @param [
|
94
|
-
#
|
95
|
-
#
|
91
|
+
# @param [String] icon_name
|
92
|
+
# Optionally set a path to an image.
|
93
|
+
#
|
94
|
+
# @param [String] icon_tooltip
|
95
|
+
# Optionally set an image tooltip.
|
96
96
|
#
|
97
97
|
# @return [UI::Notification]
|
98
98
|
#
|
data/SketchUp/UI/Toolbar.rb
CHANGED
data/SketchUp/UI/WebDialog.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Ruby WebDialog class allows you to create and interact with DHTML dialog
|
@@ -75,12 +75,12 @@ class UI::WebDialog
|
|
75
75
|
#
|
76
76
|
# @yield [dialog, params]
|
77
77
|
#
|
78
|
+
# @yieldparam dialog
|
79
|
+
# The dialog.
|
80
|
+
#
|
78
81
|
# @yieldparam params
|
79
82
|
# Any parameters passed to the dialog from HTML.
|
80
83
|
# This is passed as a single string.
|
81
|
-
#
|
82
|
-
# @yieldparam dialog
|
83
|
-
# The dialog.
|
84
84
|
def add_action_callback(callback_name)
|
85
85
|
end
|
86
86
|
|
@@ -177,20 +177,20 @@ class UI::WebDialog
|
|
177
177
|
|
178
178
|
# The +new+ method is used to create a new webdialog.
|
179
179
|
#
|
180
|
-
# Since SU2017 the position and size of the dialog is DPI aware - it will scale
|
181
|
-
# to the DPI of the monitor automatically. Specify units as they would be on a
|
182
|
-
# traditional low-DPI monitor.
|
183
|
-
#
|
184
|
-
# Note that the browser which is embedded inside the dialog depends on the
|
185
|
-
# user's OS. On Mac, Safari is embedded, while on the PC whatever version of
|
186
|
-
# Internet Explorer is installed will be embedded.
|
187
|
-
#
|
188
180
|
# @example
|
189
181
|
# dlg = UI::WebDialog.new("Show sketchup.com", true,
|
190
182
|
# "ShowSketchupDotCom", 739, 641, 150, 150, true);
|
191
183
|
# dlg.set_url "http://www.sketchup.com"
|
192
184
|
# dlg.show
|
193
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
194
|
# @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = 250, left = 0, top = 0, resizable = true)
|
195
195
|
#
|
196
196
|
# @param [String] dialog_title The title to be displayed in the webdialog.
|
@@ -251,6 +251,9 @@ class UI::WebDialog
|
|
251
251
|
# @example
|
252
252
|
# dialog.max_height = 400
|
253
253
|
#
|
254
|
+
# @note As of SU2017 this will automatically scale the height by the same
|
255
|
+
# factor as {UI.scale_factor}.
|
256
|
+
#
|
254
257
|
# @param [Integer] height
|
255
258
|
# The maximum height in pixels
|
256
259
|
#
|
@@ -278,6 +281,9 @@ class UI::WebDialog
|
|
278
281
|
# @example
|
279
282
|
# dialog.max_width = 500
|
280
283
|
#
|
284
|
+
# @note As of SU2017 this will automatically scale the width by the same factor
|
285
|
+
# as {UI.scale_factor}.
|
286
|
+
#
|
281
287
|
# @param [Integer] width
|
282
288
|
# The maximum width in pixels
|
283
289
|
#
|
@@ -305,6 +311,9 @@ class UI::WebDialog
|
|
305
311
|
# @example
|
306
312
|
# dialog.min_height = 100
|
307
313
|
#
|
314
|
+
# @note As of SU2017 this will automatically scale the height by the same
|
315
|
+
# factor as {UI.scale_factor}.
|
316
|
+
#
|
308
317
|
# @param [Integer] height
|
309
318
|
# The minimum height in pixels
|
310
319
|
#
|
@@ -332,6 +341,9 @@ class UI::WebDialog
|
|
332
341
|
# @example
|
333
342
|
# dialog.min_width = 200
|
334
343
|
#
|
344
|
+
# @note As of SU2017 this will automatically scale the width by the same factor
|
345
|
+
# as {UI.scale_factor}.
|
346
|
+
#
|
335
347
|
# @param [Integer] width
|
336
348
|
# The minimum width in pixels
|
337
349
|
#
|
@@ -486,6 +498,9 @@ class UI::WebDialog
|
|
486
498
|
# @example
|
487
499
|
# dialog.set_position(100,50)
|
488
500
|
#
|
501
|
+
# @note As of SU2017 this will automatically scale the x and y by the same
|
502
|
+
# factor as {UI.scale_factor}.
|
503
|
+
#
|
489
504
|
# @param [Integer] left
|
490
505
|
# The number of pixels from the left.
|
491
506
|
#
|
@@ -503,6 +518,9 @@ class UI::WebDialog
|
|
503
518
|
# @example
|
504
519
|
# dialog.set_size(320,240)
|
505
520
|
#
|
521
|
+
# @note As of SU2017 this will automatically scale the width and height by the
|
522
|
+
# same factor as {UI.scale_factor}.
|
523
|
+
#
|
506
524
|
# @param [Integer] w
|
507
525
|
# Width of the webdialog.
|
508
526
|
#
|
@@ -586,10 +604,6 @@ class UI::WebDialog
|
|
586
604
|
# dialog.write_image('c:/grab.jpg', 70, 0, 0, 100, 100)
|
587
605
|
# dialog.write_image('c:/grab.png', 4, 0, 0, 100, 100)
|
588
606
|
#
|
589
|
-
# @param [Integer] top_left_x
|
590
|
-
# The x coordinate of the upper left corner of the
|
591
|
-
# region to grab.
|
592
|
-
#
|
593
607
|
# @param [String] image_path
|
594
608
|
# The destination path of the saved image.
|
595
609
|
#
|
@@ -600,16 +614,20 @@ class UI::WebDialog
|
|
600
614
|
# the compression algorithm: <4 (best speed), 4-8
|
601
615
|
# (default), or >=9 (best compression).
|
602
616
|
#
|
603
|
-
# @param [Integer]
|
604
|
-
# The x coordinate of the
|
617
|
+
# @param [Integer] top_left_x
|
618
|
+
# The x coordinate of the upper left corner of the
|
619
|
+
# region to grab.
|
620
|
+
#
|
621
|
+
# @param [Integer] top_left_y
|
622
|
+
# The x coordinate of the upper left corner of the
|
605
623
|
# region to grab.
|
606
624
|
#
|
607
625
|
# @param [Integer] bottom_right_x
|
608
626
|
# The x coordinate of the lower right corner of the
|
609
627
|
# region to grab.
|
610
628
|
#
|
611
|
-
# @param [Integer]
|
612
|
-
# The x coordinate of the
|
629
|
+
# @param [Integer] bottom_right_y
|
630
|
+
# The x coordinate of the lower right corner of the
|
613
631
|
# region to grab.
|
614
632
|
#
|
615
633
|
# @version SketchUp 7.1
|