MAUI::WidgetSkin Class Reference

#include <MAUI/WidgetSkin.h>

List of all members.


Detailed Description

A WidgetSkin is a class used to define the visual appearance of a widget. It is instanciated by passing an image for the selected and unselected mode, and two coordinates telling how to divide the image into 9 segments. These segments are then used as information of how to tile the skin to different widget sizes. The constructor also takes parameters telling if the selected or unselected images are transparent or not, used to optimize MAUI drawing.


Public Types

enum  eType { SELECTED = 0, UNSELECTED = 1 }

Public Member Functions

 WidgetSkin ()
 WidgetSkin (MAHandle selectedImage, MAHandle unselectedImage, int x1, int x2, int y1, int y2, bool selectedTransparent=true, bool unselectedTransparent=true)
void setStartX (int x)
void setEndX (int x)
void setStartY (int y)
void setEndY (int y)
int getStartX () const
int getStartY () const
int getEndX () const
int getEndY () const
MAHandle getUnselectedImage () const
MAHandle getSelectedImage () const
void setSelectedImage (MAHandle image)
void setUnselectedImage (MAHandle image)
void draw (int x, int y, int width, int height, eType type)
int getImageHeight () const
int getImageWidth () const
bool isSelectedTransparent () const
bool isUnselectedTransparent () const


Member Enumeration Documentation

enum MAUI::WidgetSkin::eType
 

Enumerator for the different drawing states of a WidgetSkin.

Enumerator:
SELECTED 
UNSELECTED 


Constructor & Destructor Documentation

MAUI::WidgetSkin::WidgetSkin  ) 
 

The default constructor.

MAUI::WidgetSkin::WidgetSkin MAHandle  selectedImage,
MAHandle  unselectedImage,
int  x1,
int  x2,
int  y1,
int  y2,
bool  selectedTransparent = true,
bool  unselectedTransparent = true
 

The WidgetSkin constructor takes two images (selected and unselected) and 2 coordinate pairs, defining the 9 segments of the images. Finally it takes two bools that specifies if the images are transparent or not (default true).


Member Function Documentation

void MAUI::WidgetSkin::setStartX int  x  ) 
 

Set the start x coordinate of the WidgetSkin rect.

void MAUI::WidgetSkin::setEndX int  x  ) 
 

Set the end x coordinate of the WidgetSkin rect.

void MAUI::WidgetSkin::setStartY int  y  ) 
 

Set the start y coordinate of the WidgetSkin rect.

void MAUI::WidgetSkin::setEndY int  y  ) 
 

Set the end y coordinate of the WidgetSkin rect.

int MAUI::WidgetSkin::getStartX  )  const
 

Get the start x coordinate of the WidgetSkin rect.

int MAUI::WidgetSkin::getStartY  )  const
 

Get the start y coordinate of the WidgetSkin rect.

int MAUI::WidgetSkin::getEndX  )  const
 

Get the end x coordinate of the WidgetSkin rect.

int MAUI::WidgetSkin::getEndY  )  const
 

Get the end y coordinate of the WidgetSkin rect.

MAHandle MAUI::WidgetSkin::getUnselectedImage  )  const
 

Get the image used to display an unselected state.

MAHandle MAUI::WidgetSkin::getSelectedImage  )  const
 

Get the image used to display a selected state.

void MAUI::WidgetSkin::setSelectedImage MAHandle  image  ) 
 

Set the selected image, returns false if there is an unselected image and the dimensions of the selected image does not equal the unselected image.

void MAUI::WidgetSkin::setUnselectedImage MAHandle  image  ) 
 

Set the unselected image, returns false if there is a selected image and the dimensions of the unselected image does not equal the selected image.

void MAUI::WidgetSkin::draw int  x,
int  y,
int  width,
int  height,
eType  type
 

Use this to draw the WidgetSkin. The upper-left corner is placed at 'x' and 'y' and the skin is automatically resized to 'width' and 'height. 'type' specifies which drawing state should be used when drawing the widget skin.

int MAUI::WidgetSkin::getImageHeight  )  const
 

Get the image height.

int MAUI::WidgetSkin::getImageWidth  )  const
 

Get the image width.

bool MAUI::WidgetSkin::isSelectedTransparent  )  const
 

Returns whether the selected image is transparent or not.

bool MAUI::WidgetSkin::isUnselectedTransparent  )  const
 

Returns whether the unselected image is transparent or not.


Generated on Sat Feb 13 00:15:39 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO