From 4d16bfc43780e5d3f7368625700b583e3e98217a Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 18:11:42 +0900 Subject: adding in row_style and col_style methods to worksheet and active record 'acts_as_axlsx' to provide to_xlsx. --- doc/Axlsx/Pic.html | 354 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 202 insertions(+), 152 deletions(-) (limited to 'doc/Axlsx/Pic.html') diff --git a/doc/Axlsx/Pic.html b/doc/Axlsx/Pic.html index c18b3682..27dd83cf 100644 --- a/doc/Axlsx/Pic.html +++ b/doc/Axlsx/Pic.html @@ -94,9 +94,10 @@

Overview

- -

a Pic object represents an image in your worksheet Worksheet#add_image is -the recommended way to manage images in your sheets

+

+a Pic object represents an image in your worksheet Worksheet#add_image is +the recommended way to manage images in your sheets +

@@ -119,8 +120,9 @@ the recommended way to manage images in your sheets

ALLOWED_EXTENSIONS =
- -

allowed file extenstions

+

+allowed file extenstions +

@@ -130,7 +132,8 @@ the recommended way to manage images in your sheets

-
['gif', 'jpeg', 'png', 'jpg']
+
['gif', 'jpeg', 'png', 'jpg']
+
@@ -158,8 +161,9 @@ the recommended way to manage images in your sheets

-
-

The anchor for this image.

+

+The anchor for this image. +

@@ -184,8 +188,9 @@ the recommended way to manage images in your sheets

-
-

A description of the picture.

+

+A description of the picture. +

@@ -210,9 +215,10 @@ the recommended way to manage images in your sheets

-
-

The path to the image you want to include Only local images are supported -at this time and only jpg support.

+

+The path to the image you want to include Only local images are supported +at this time and only jpg support. +

@@ -237,8 +243,9 @@ at this time and only jpg support.

-
-

The name to use for this picture.

+

+The name to use for this picture. +

@@ -273,8 +280,9 @@ at this time and only jpg support.

-
-

returns the extension of image_src without the preceeding '.'.

+

+returns the extension of image_src without the preceeding ’.’. +

@@ -296,8 +304,9 @@ at this time and only jpg support.

-
-

The file name of image_src without any path information.

+

+The file name of image_src without any path information. +

@@ -319,8 +328,9 @@ at this time and only jpg support.

-
-

providing access to update the anchor's height attribute.

+

+providing access to update the anchor’s height attribute. +

@@ -363,8 +373,9 @@ at this time and only jpg support.

-
-

The index of this image in the workbooks images collections.

+

+The index of this image in the workbooks images collections. +

@@ -388,8 +399,9 @@ at this time and only jpg support.

-
-

Creates a new Pic(ture) object.

+

+Creates a new Pic(ture) object. +

@@ -411,9 +423,10 @@ at this time and only jpg support.

-
-

The part name for this image used in serialization and relationship -building.

+

+The part name for this image used in serialization and relationship +building. +

@@ -435,10 +448,11 @@ building.

-
-

This is a short cut method to set the start anchor position If you need +

+This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff.

+rowOff. +

@@ -460,8 +474,9 @@ rowOff.

-
-

Serializes the picture.

+

+Serializes the picture. +

@@ -483,8 +498,9 @@ rowOff.

-
-

providing access to the anchor's width attribute.

+

+providing access to the anchor’s width attribute. +

@@ -526,8 +542,9 @@ rowOff.

- -

Creates a new Pic(ture) object

+

+Creates a new Pic(ture) object +

@@ -546,8 +563,9 @@ rowOff.

— -
-

the anchor that holds this image

+

+the anchor that holds this image +

@@ -564,8 +582,9 @@ rowOff.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -663,8 +682,9 @@ rowOff.

— -
-

the object that the method was called on

+

+the object that the method was called on +

@@ -690,15 +710,16 @@ rowOff.

# File 'lib/axlsx/drawing/pic.rb', line 38
 
-def initialize(anchor, options={})
-  @anchor = anchor
-  @anchor.drawing.worksheet.workbook.images << self
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
-  end
-  start_at(*options[:start_at]) if options[:start_at]
-  yield self if block_given?
-end
+def initialize(anchor, options={}) + @anchor = anchor + @anchor.drawing.worksheet.workbook.images << self + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + start_at(*options[:start_at]) if options[:start_at] + yield self if block_given? +end + @@ -721,8 +742,9 @@ rowOff.

- -

The anchor for this image

+

+The anchor for this image +

@@ -756,9 +778,10 @@ rowOff.

# File 'lib/axlsx/drawing/pic.rb', line 27
 
-def anchor
-  @anchor
-end
+def anchor + @anchor +end + @@ -776,8 +799,9 @@ rowOff.

- -

A description of the picture

+

+A description of the picture +

@@ -811,9 +835,10 @@ rowOff.

# File 'lib/axlsx/drawing/pic.rb', line 18
 
-def descr
-  @descr
-end
+def descr + @descr +end + @@ -831,9 +856,10 @@ rowOff.

- -

The path to the image you want to include Only local images are supported -at this time and only jpg support

+

+The path to the image you want to include Only local images are supported +at this time and only jpg support +

@@ -867,9 +893,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 23
 
-def image_src
-  @image_src
-end
+def image_src + @image_src +end + @@ -887,8 +914,9 @@ at this time and only jpg support

- -

The name to use for this picture

+

+The name to use for this picture +

@@ -922,9 +950,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 13
 
-def name
-  @name
-end
+def name + @name +end + @@ -946,8 +975,9 @@ at this time and only jpg support

- -

returns the extension of image_src without the preceeding '.'

+

+returns the extension of image_src without the preceeding ’.’ +

@@ -981,9 +1011,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 70
 
-def extname
-  File.extname(image_src).delete('.') unless image_src.nil?
-end
+def extname + File.extname(image_src).delete('.') unless image_src.nil? +end + @@ -998,8 +1029,9 @@ at this time and only jpg support

- -

The file name of image_src without any path information

+

+The file name of image_src without any path information +

@@ -1033,9 +1065,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 64
 
-def file_name
-  File.basename(image_src) unless image_src.nil?
-end
+def file_name + File.basename(image_src) unless image_src.nil? +end + @@ -1050,8 +1083,9 @@ at this time and only jpg support

- -

providing access to update the anchor's height attribute

+

+providing access to update the anchor’s height attribute +

@@ -1094,9 +1128,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 101
 
-def height
-  @anchor.height
-end
+def height + @anchor.height +end + @@ -1138,9 +1173,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 106
 
-def height=(v)
-  @anchor.height = v
-end
+def height=(v) + @anchor.height = v +end + @@ -1155,8 +1191,9 @@ at this time and only jpg support

- -

The index of this image in the workbooks images collections

+

+The index of this image in the workbooks images collections +

@@ -1190,9 +1227,10 @@ at this time and only jpg support

# File 'lib/axlsx/drawing/pic.rb', line 76
 
-def index
-  @anchor.drawing.worksheet.workbook.images.index(self)
-end
+def index + @anchor.drawing.worksheet.workbook.images.index(self) +end + @@ -1207,9 +1245,10 @@ at this time and only jpg support

- -

The part name for this image used in serialization and relationship -building

+

+The part name for this image used in serialization and relationship +building +

@@ -1243,9 +1282,10 @@ building

# File 'lib/axlsx/drawing/pic.rb', line 82
 
-def pn
-  "#{IMAGE_PN % [(index+1), extname]}"
-end
+def pn + "#{IMAGE_PN % [(index+1), extname]}" +end + @@ -1260,10 +1300,11 @@ building

- -

This is a short cut method to set the start anchor position If you need +

+This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff

+rowOff +

@@ -1282,8 +1323,9 @@ rowOff

— -
-

The column

+

+The column +

@@ -1298,8 +1340,9 @@ rowOff

— -
-

The row

+

+The row +

@@ -1334,10 +1377,11 @@ rowOff

# File 'lib/axlsx/drawing/pic.rb', line 116
 
-def start_at(x, y)
-  @anchor.from.col = x
-  @anchor.from.row = y
-end
+def start_at(x, y) + @anchor.from.col = x + @anchor.from.row = y +end + @@ -1352,8 +1396,9 @@ rowOff

- -

Serializes the picture

+

+Serializes the picture +

@@ -1372,8 +1417,9 @@ rowOff

— -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -1429,31 +1475,32 @@ rowOff

# File 'lib/axlsx/drawing/pic.rb', line 124
 
-def to_xml(xml)
-  xml.send('xdr:pic') {
-    xml.send('xdr:nvPicPr') {
-      xml.send('xdr:cNvPr', :id=>"2", :name=>name, :descr=>descr)
-      xml.send('xdr:cNvPicPr') {
-        xml.send('a:picLocks', :noChangeAspect=>1)
-      }
-    }
-    xml.send('xdr:blipFill') {
-      xml.send('a:blip', :xmlns:r' => XML_NS_R, :r:embed'=>"rId1")
-      xml.send('a:stretch') {
-        xml.send('a:fillRect')
-      }
-    }
-    xml.send('xdr:spPr') {
-      xml.send('a:xfrm') {
-        xml.send('a:off', :x=>0, :y=>0)
-        xml.send('a:ext', :cx=>2336800, :cy=>2161540)
-      }
-      xml.send('a:prstGeom', :prst=>:rect) {
-        xml.send('a:avLst')
-      }
-    }
-  }
-end
+def to_xml(xml) + xml.send('xdr:pic') { + xml.send('xdr:nvPicPr') { + xml.send('xdr:cNvPr', :id=>"2", :name=>name, :descr=>descr) + xml.send('xdr:cNvPicPr') { + xml.send('a:picLocks', :noChangeAspect=>1) + } + } + xml.send('xdr:blipFill') { + xml.send('a:blip', :'xmlns:r' => XML_NS_R, :'r:embed'=>"rId1") + xml.send('a:stretch') { + xml.send('a:fillRect') + } + } + xml.send('xdr:spPr') { + xml.send('a:xfrm') { + xml.send('a:off', :x=>0, :y=>0) + xml.send('a:ext', :cx=>2336800, :cy=>2161540) + } + xml.send('a:prstGeom', :prst=>:rect) { + xml.send('a:avLst') + } + } + } +end + @@ -1468,8 +1515,9 @@ rowOff

- -

providing access to the anchor's width attribute

+

+providing access to the anchor’s width attribute +

@@ -1512,9 +1560,10 @@ rowOff

# File 'lib/axlsx/drawing/pic.rb', line 89
 
-def width
-  @anchor.width
-end
+def width + @anchor.width +end + @@ -1556,9 +1605,10 @@ rowOff

# File 'lib/axlsx/drawing/pic.rb', line 94
 
-def width=(v)
-  @anchor.width = v
-end
+def width=(v) + @anchor.width = v +end + @@ -1569,9 +1619,9 @@ rowOff

-- cgit v1.2.3