Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HImagePanel Class Reference

The HImagePanel class displays an image usually representing buttons which a user can highlight with a mouse click and which trigger user defined actions. More...

#include <HObjects.h>

Inheritance diagram for HImagePanel:

HBaseOperator

List of all members.

Public Member Functions

void AddImageRegion (int identifier, char const *const name)
HImageRegionFindSelectedRegion (float xpos, float ypos)
char const * GetPanelName ()
 HImagePanel (HBaseView *view, HC_KEY startkey, int width, int height, float xpos, float ypos, char const *const name)
virtual int OnLButtonDown (HEventInfo &hevent)
virtual int OnLButtonDownAndMove (HEventInfo &hevent)
virtual int OnLButtonUp (HEventInfo &hevent)
void SetImageAction (int(*image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
void SetImages (HC_KEY NormalImageKey, HC_KEY HighlightedImageKey, HC_KEY RegionImageKey)
void SetImagesFromFile (char const *normal_image_path, char const *highlighted_image_path, char const *region_image_path)
void SetPosition (float x, float y, float z=0.0f)
void ZoomIn ()
void ZoomOut ()

Static Public Member Functions

static bool ButtonTimerClbk (float request_time, float actual_time, void *user_data)


Detailed Description

The HImagePanel class displays an image usually representing buttons which a user can highlight with a mouse click and which trigger user defined actions.

An image panel object consists of 3 HOOPS images which must be stored in separate HMF files. One of them represents the visual representaton of the unselected panel while the other represents the selected state. The third image defines regions inside the panel (based on the rgb values in the image) which trigger execution of a user supplied callback function.


Constructor & Destructor Documentation

HImagePanel::HImagePanel ( HBaseView view,
HC_KEY  startkey,
int  width,
int  height,
float  xpos,
float  ypos,
char const *const   name 
)

Constructs an HImagePanel object.

Parameters:
view A pointer to the HBaseView object.
startkey Key of segment containing the image panel.
width Width of image panel
height Height of image panel
xpos Initial X Position of image panel
ypos Initial Y Position of image panel
name Name of image panel


Member Function Documentation

void HImagePanel::AddImageRegion ( int  identifier,
char const *const   name 
)

This method adds a new image region to the panel

Parameters:
identifier Identifier of new image region
name Name of new image region

static bool HImagePanel::ButtonTimerClbk ( float  request_time,
float  actual_time,
void *  user_data 
) [static]

Timer callback used to react to button presses

HImageRegion* HImagePanel::FindSelectedRegion ( float  xpos,
float  ypos 
)

This method finds the region associated to a specific x/y position in the image

Parameters:
xpos Mouse X Position
ypos Mouse Y Position
Returns:
Image Region

char const* HImagePanel::GetPanelName (  )  [inline]

This method returns the name of the image panel

Returns:
Name of image panel

virtual int HImagePanel::OnLButtonDown ( HEventInfo hevent  )  [virtual]

Left Button Down Handler

Parameters:
hevent An HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

virtual int HImagePanel::OnLButtonDownAndMove ( HEventInfo hevent  )  [virtual]

Mouse Move Handler

Parameters:
hevent An HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

virtual int HImagePanel::OnLButtonUp ( HEventInfo hevent  )  [virtual]

Left Button Up Handler

Parameters:
hevent An HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

void HImagePanel::SetImageAction ( int(*)(HImageRegion *ii, void *data, HButtonState button_state)  image_action,
void *  data 
) [inline]

This method associates a callback function to the image panel

Parameters:
image_action Function to call for image actions
data generic data passed to image panel callback function

void HImagePanel::SetImagesFromFile ( char const *  normal_image_path,
char const *  highlighted_image_path,
char const *  region_image_path 
)

This method associates a callback function to the image panel

Parameters:
image_action Function to call for image actions
data generic data passed to image panel callback function
This method sets the 3 images used for display of the image panel and region selection
Parameters:
normal_image_path Path to HMF file containing the image which defines the unhighligted "look" of the image panel
highlighted_image_path Path to HMF file containing the image which defines the highlighted "look" of the image panel
region_image_path Path to HMF file containing the image which defines the selectable regions of the image panel


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