Layout view functions

 < Day Day Up > 

Layout view functions handle operations that change the layout elements within a document. They affect table, column, and cell settings, including position, properties, and appearance.

dom.addSpacerToColumn()

Availability

Dreamweaver 4.

Description

Creates a 1-pixel-high transparent spacer image at the bottom of a specified column in the currently selected table. This function fails if the current selection is not a table or if the operation is not successful.

Arguments

 colNum 

  • The colNum argument is the column at the bottom of which the spacer image is created.

Returns

Nothing.

dom.createLayoutCell()

Availability

Dreamweaver 4.

Description

Creates a layout cell in the current document at the specified position and dimensions, either within an existing layout table or in the area below the existing content on the page. If the cell is created in an existing layout table, it must not overlap or contain any other layout cells or nested layout tables. If the rectangle is not inside an existing layout table, Dreamweaver tries to create a layout table to house the new cell. This function does not force the document into Layout view. This function fails if the cell cannot be created.

Arguments

 left, top, width, height 

  • The left argument is the x position of the left border of the cell.

  • The top argument is the y position of the top border of the cell.

  • The width argument is the width of the cell in pixels.

  • The height argument is the height of the cell in pixels.

Returns

Nothing.

dom.createLayoutTable()

Availability

Dreamweaver 4.

Description

Creates a layout table in the current document at the specified position and dimensions, either within an existing table or in the area below the existing content on the page. If the table is created in an existing layout table, it cannot overlap other layout cells or nested layout tables, but it can contain other layout cells or nested layout tables. This function does not force the document into Layout view. This function fails if the table cannot be created.

Arguments

 left, top, width, height 

  • The left argument is the x position of the left border of the table.

  • The top argument is the y position of the top border of the table.

  • The width argument is the width of the table in pixels.

  • The height argument is the height of the table in pixels.

Returns

Nothing.

dom.doesColumnHaveSpacer()

Availability

Dreamweaver 4.

Description

Determines whether a column contains a spacer image that Dreamweaver generated. It fails if the current selection is not a table.

Arguments

 colNum 

  • The colNum argument is the column to check for a spacer image.

Returns

Returns TRue if the specified column in the currently selected table contains a spacer image that Dreamweaver generated; false otherwise.

dom.doesGroupHaveSpacers()

Availability

Dreamweaver 4.

Description

Determines whether the currently selected table contains a row of spacer images that Dreamweaver generated. It fails if the current selection is not a table.

Arguments

None.

Returns

Returns TRue if the table contains a row of spacer images; false otherwise.

dom.getClickedHeaderColumn()

Availability

Dreamweaver 4.

Description

If the user clicks a menu button in the header of a table in Layout view and causes the table header menu to appear, this function returns the index of the column that the user clicked. The result is undefined if the table header menu is not visible.

Arguments

None.

Returns

An integer that represents the index of the column.

dom.getShowLayoutTableTabs()

Availability

Dreamweaver 4.

Description

Determines whether the current document shows tabs for layout tables in Layout view.

Arguments

None.

Returns

Returns true if the current document displays tabs for layout tables in Layout view; false otherwise.

dom.getShowLayoutView()

Availability

Dreamweaver 4.

Description

Determines the view for the current document; either Layout or Standard view.

Arguments

None.

Returns

Returns TRue if the current document is in Layout view; false if the document is in Standard view.

dom.isColumnAutostretch()

Availability

Dreamweaver 4.

Description

Determines whether a column is set to expand and contract automatically, depending on the document size. This function fails if the current selection is not a table.

Arguments

 colNum 

  • The colNum argument is the column to be automatically sized or fixed width.

Returns

Returns TRue if the column at the given index in the currently selected table is set to autostretch; false otherwise.

dom.makeCellWidthsConsistent()

Availability

Dreamweaver 4.

Description

In the currently selected table, this function sets the width of each column in the HTML to match the currently rendered width of the column. This function fails if the current selection is not a table or if the operation is not successful.

Arguments

None.

Returns

Nothing.

dom.removeAllSpacers()

Availability

Dreamweaver 4.

Description

Removes all spacer images generated by Dreamweaver from the currently selected table. This function fails if the current selection is not a table or if the operation is not successful.

Arguments

None.

Returns

Nothing.

dom.removeSpacerFromColumn()

Availability

Dreamweaver 4.

Description

Removes the spacer image from a specified column and deletes the spacer row if there are no more spacer images that Dreamweaver generated. This function fails if the current selection is not a table or if the operation is not successful.

Arguments

 colNum 

  • The colNum argument is the column from which to remove the spacer image.

Returns

Nothing.

dom.setColumnAutostretch()

Availability

Dreamweaver 4.

Description

Switches a column between automatically sized or fixed width. If bAutostretch is TRue, the column at the given index in the currently selected table is set to autostretch; otherwise it's set to a fixed width at its current rendered width. This function fails if the current selection isn't a table or if the operation isn't successful.

Arguments

 colNum, bAutostretch 

  • The colNum argument is the column to be automatically sized or set to a fixed width.

  • The bAutostretch argument specifies whether to set the column to autostretch (true) or to a fixed width (false).

Returns

Nothing.

dom.getShowBlockBackgrounds()

Availability

Dreamweaver 8.

Description

This function gets the state of the visual aid that forces background coloring for all blocks or divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to true to apply to div tags only. Set the value to false to apply to all block elements.

Returns

A Boolean. If true, backgrounds are being forced; if false, backgrounds are not being forced.

Example

The following example checks whether the background coloring for all blocks is being forced, and if not, forces background coloring for all blocks.:

 var currentDOM = dw.getDocumentDOM(); if (currentDOM.getShowBlockBackgrounds(false) == false){   currentDOM.setShowBlockBackgrounds(false);   } 

dom.getShowBlockBorders()

Availability

Dreamweaver 8.

Description

This function gets the state of the visual aid that draws borders for all blocks or all divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to TRue to get the state for div tags only. Set the value to false to get the state for all block elements.

Returns

A Boolean value; if true, borders are displayed; if false, borders are not displayed.

Example

The following example checks whether the block borders visual aid is on and, if not, turns it on:

 var currentDOM = dw.getDocumentDOM(); if (currentDOM.getShowBlockBorders(false) == false){   currentDOM.setShowBlockBorders(true);   } 

dom.getShowBlockIDs()

Availability

Dreamweaver 8.

Description

This function gets the state of the visual aid that displays ID and class information for all blocks or divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to true to display ID and class for div tags only. Set the value to false to display the ID and class for all block elements.

Returns

A Boolean: If true, IDs are displayed; if false IDs are not displayed.

Example

The following example checks whether the block IDs are displayed and, if not, displays them:

 var currentDOM = dw.getDocumentDOM(); if (currentDOM.getShowBlockIDs(false) == false){   currentDOM.setShowBlockIDs(true);   } 

dom.getShowBoxModel()

Availability

Dreamweaver 8.

Description

This function turns on and off the visual aid that colors the full box model for the selected block.

Arguments

None.

Returns

Nothing.

Example

The following example checks whether the full box model for the selected box is displayed in color, and, if not, colors it:

 var currentDOM = dw.getDocumentDOM(); if (currentDOM.getShowBoxModel() == false){   currentDOM.setShowBoxModel(true);   } 

dom.setShowBlockBackgrounds()

Availability

Dreamweaver 8.

Description

This function turns on and off the visual aid that forces background coloring for all blocks or all divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to true to apply background coloring to div tags only. Set the value to false to apply background coloring to all block elements.

Returns

Nothing.

Example

See "dom.getShowBlockBackgrounds()" on page 963.

dom.setShowBlockBorders()

Availability

Dreamweaver 8.

Description

This function turns on or off the visual aid that draws borders for all blocks or divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to true to apply borders to div tags only. Set the value to false to apply borders to all block elements.

Returns

Nothing.

Example

See "dom.getShowBlockBorders()" on page 963.

dom.setShowBlockIDs()

Availability

Dreamweaver 8.

Description

This function turns on or off the visual aid that displays the ID and class for all blocks or divs.

Arguments

 allblocks 

  • The allblocks argument, which is required, is a Boolean. Set the value to TRue to display the ID and class for div tags only. Set the value to false to display the ID and class for all block elements.

Returns

Nothing.

Example

See "dom.getShowBlockIDs()" on page 964.

dom.setShowBoxModel()

Availability

Dreamweaver 8.

Description

This function sets the state of the visual aid that colors the full box model for the selected block.

Arguments

None.

Returns

A Boolean: true if the box model is displayed; false if the box model is not displayed.

Example

See "dom.getShowBoxModel()" on page 965.

dom.setShowLayoutTableTabs()

Availability

Dreamweaver 4.

Description

Sets the current document to display tabs for layout tables whenever it's in Layout view. This function does not force the document into Layout view.

Arguments

 bShow 

  • The bShow argument indicates whether to display tabs for layout tables when the current document is in Layout view. If bShow is true, Dreamweaver displays tabs; if bShow is false, Dreamweaver does not display tabs.

Returns

Nothing.

dom.setShowLayoutView()

Availability

Dreamweaver 4.

Description

Places the current document in Layout view if bShow is true.

Arguments

 bShow 

  • The bShow argument is a Boolean value that toggles the current document between Layout view and Standard view. If bShow is TRue, the current document is in Layout view; if bShow is false, the current document is in Standard view.

Returns

Nothing.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net