libsswf: sswf::TagScalingGrid Class Reference

# sswf::TagScalingGrid Class Reference

Defines a grid to scale windows, buttons and other objects with edges. More...

`#include <libsswf.h>`

Inheritance diagram for sswf::TagScalingGrid:

List of all members.

## Public Member Functions
const SRectangle & | Grid (void) const
| Returns the currently defined grid rectangle.
ErrorManager::error_code_t | GridPreSave (void)
| Ensures the minimum version.
ErrorManager::error_code_t | GridSave (Data &data, sswf_id_t id)
| Save the scaling grid tag.
ErrorManager::error_code_t | ParseGridTag (TagBase::swf_tag_t tag, const Data &data)
| Parse data from a file into a ScalingGrid tag.
void | SetGrid (const SRectangle &rect)
| Define the Scaling Grid rectangle.
virtual | ~TagScalingGrid ()
| Cleans up the object.
## Private Attributes
SRectangle | f_grid

## Detailed Description

This class was introduced in version 1.8.0.

The Scaling Grid tag defines a grid used to scale a button or a sprite (some window like object which has a border/edge and corners not to be scalled as usual.)

This tag is derived by the TagButton and TagSprite and is not otherwise supposed to be used by itself.

This tag adds the Grid() and SetGrid() functionality to the TagButton and TagSprite.

Internally, it also adds the GridPreSave() and GridSave() functions.

See also:
  SWF Alexis' Reference—Define Scaling Grid

  SWF Alexis' Reference—swf_tag

## Constructor & Destructor Documentation

TagScalingGrid::~TagScalingGrid | ( |  | ) | `[virtual]`

The destructor is virtual. It has nothing to do otherwise.

## Member Function Documentation

const SRectangle & TagScalingGrid::Grid | ( | void |  | ) | const

This function returns the currently defined grid rectangle.

Returns:
  The grid rectangle

References f_grid.

ErrorManager::error_code_t TagScalingGrid::GridPreSave | ( | void |  | ) |

This function requests that the movie be at least of version 8.

This function is automatically called by the TagButton::PreSave(Data& data) and TagSprite::PreSave(Data& data) functions.

Returns:
  ErrorManager::ERROR_CODE_NONE when no error occured, an error otherwise

References sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::SRectangle::IsEmpty(), and sswf::TagBase::MinimumVersion().

Referenced by sswf::TagSprite::PreSave(), and sswf::TagButton::PreSave().

ErrorManager::error_code_t TagScalingGrid::GridSave | ( | Data & | data,
|  | sswf_id_t | id |
| ) |  |  |

This function saves the button or sprite reference and grid rectangle.

This function is automatically called by the TagButton::PreSave(Data& data) and TagSprite::PreSave(Data& data) functions.

Parameters:

  | data | The Data buffer where the result is saved
  | id | The identification of the button or sprite

Returns:
  Zero when no error occur, non-zero otherwise

References sswf::Data::Append(), sswf::Data::ByteSize(), sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::SRectangle::IsEmpty(), sswf::Data::PutShort(), sswf::SRectangle::Save(), sswf::TagBase::SaveTag(), and sswf::TagBase::SWF_TAG_DEFINE_SCALING_GRID.

Referenced by sswf::TagSprite::Save(), and sswf::TagButton::Save().

ErrorManager::error_code_t TagScalingGrid::ParseGridTag | ( | TagBase::swf_tag_t | tag,
|  | const Data & | data |
| ) |  |  |

This function reads the password saved in the ScalingGrid tag.

Note that the password is kept encrypted.

Parameters:

  `[in]` | tag | The tag that generated this call
  `[in]` | data | The Data buffer from the Flash file being loaded

Returns:
  An error if one occurs, or ErrorManager::ERROR_CODE_NONE

References sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::Data::GetShort(), and sswf::SRectangle::Parse().

Referenced by sswf::TagSprite::ParseTag(), and sswf::TagButton::ParseTag().

void TagScalingGrid::SetGrid | ( | const SRectangle & | rect | ) |

This function copies the input rectangle as the new Scaling Grid rectangle of the button or sprite.

You use this function directly from the button or sprite as follow:

            TagButton *button;

            ...
            button->SetGrid(my_grid);
            ...

Parameters:

  | rect | The new Scaling Grid rectangle

References f_grid.

## Member Data Documentation

SRectangle sswf::TagScalingGrid::f_grid`[private]`

Referenced by Grid(), GridPreSave(), GridSave(), ParseGridTag(), and SetGrid().

The documentation for this class was generated from the following files:

- libsswf.h
- libsswf_tag_scalinggrid.c++