ImagemapClickableCircle Class Reference

This class represents a clickable circle. More...

#include <clicarea.h>

Inheritance diagram for ImagemapClickableCircle:

ImagemapClickableArea OverrideListItem ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ImagemapClickableCircle ()
 Default constructor.
 ImagemapClickableCircle (Path *pthToCopy, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL)
 Specific constructor.
INT32 Write (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes this clickable area, in client-side imagemap form, into the buffer or the file or both.
DocRect GetBoundingRect ()
 Gets the bounding rectangle.

Public Attributes

DocCoord m_dcCentre
INT32 m_lRadius

Detailed Description

This class represents a clickable circle.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97

Definition at line 217 of file clicarea.h.


Constructor & Destructor Documentation

ImagemapClickableCircle::ImagemapClickableCircle  ) 
 

Default constructor.

ImagemapClickableCircle::ImagemapClickableCircle():ImagemapClickableArea()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97

Definition at line 467 of file clicarea.cpp.

00467                                                  : ImagemapClickableArea()
00468 {
00469     m_dcCentre=DocCoord(0,0);
00470     m_lRadius=0;
00471 }

ImagemapClickableCircle::ImagemapClickableCircle Path ppthPath,
TCHAR pcURL = NULL,
TCHAR pcFrame = NULL
 

Specific constructor.

ImagemapClickableCircle::ImagemapClickableCircle(Path* ppthPath, TCHAR* pcURL, TCHAR* pcFrame) : ImagemapClickableArea(pcURL, pcFrame)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97

Definition at line 485 of file clicarea.cpp.

00486 : ImagemapClickableArea(pcURL, pcFrame)
00487 {
00488     //If we have been passed a path
00489     if (ppthPath)
00490     {
00491         //Get its bounding box
00492         DocRect rectBounds=ppthPath->GetBoundingRect();
00493         
00494         //Then the centre of the circle is the centre of the bounding box
00495         m_dcCentre=DocCoord(rectBounds.lo.x/2 + rectBounds.hi.x/2, rectBounds.lo.y/2 + rectBounds.hi.y/2);
00496 
00497         //And the radius of the circle is half the width of the rectangle
00498         m_lRadius=rectBounds.Width()/2;
00499     }
00500     else
00501     {
00502         m_dcCentre=DocCoord(0,0);
00503         m_lRadius=0;
00504     }
00505 
00506 }


Member Function Documentation

DocRect ImagemapClickableCircle::GetBoundingRect  )  [virtual]
 

Gets the bounding rectangle.

DocRect ImagemapClickableCircle::GetBoundingRect()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/97 - VOTE LABOUR!
Parameters:
- [INPUTS]
Returns:
The bounding rectangle of the circle

Implements ImagemapClickableArea.

Definition at line 586 of file clicarea.cpp.

INT32 ImagemapClickableCircle::Write CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
[virtual]
 

Writes this clickable area, in client-side imagemap form, into the buffer or the file or both.

INT32 Write(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
pfileToWrite The file to write to [INPUTS] pcBuffer The text buffer to write to
Either of the above may be NULL.

Returns:
The number of TCHARs written.
This function may be called with all parameters NULL, to find out how many TCHARs will be written into the imagemap, and hence to find out how long the text buffer must be

Implements ImagemapClickableArea.

Definition at line 530 of file clicarea.cpp.

00531 {
00532     PORTNOTETRACE("other","ImagemapClickableArea::Write - do nothing");
00533 #ifndef EXCLUDE_FROM_XARALX
00534     //Keep a count of the characters we write out
00535     INT32 lCharsWritten=0;
00536 
00537     ImagemapFilter * pFilter = GetImagemapFilter();
00538     ERROR2IF(pFilter == NULL,lCharsWritten,"ImagemapClickableCircle::Write no imagemap filter");
00539 
00540     //First indent the text
00541     pFilter->Indent();
00542     lCharsWritten += pFilter->WriteIndent(pfileToWrite, pcBuffer);
00543 
00544     //And write out <AREA
00545     lCharsWritten += pFilter->WriteStartOfTag(_R(IDS_HTMLEXPORT_AREA), pfileToWrite, pcBuffer);
00546 
00547     //Now write out SHAPE=CIRCLE
00548     lCharsWritten += pFilter->WriteParameter(_R(IDS_HTMLEXPORT_SHAPE), _R(IDS_HTMLEXPORT_CIRCLE), pfileToWrite, pcBuffer);
00549 
00550     //Write out the URL and the FRAME
00551     lCharsWritten += WriteURLAndFrame(pfileToWrite, pcBuffer);
00552 
00553     //And write out our coords
00554     lCharsWritten += pFilter->WriteCircleCoords(m_dcCentre, m_lRadius, m_pcFrame, pfileToWrite, pcBuffer);
00555 
00556     //And the end of the tag
00557     lCharsWritten += pFilter->WriteEndOfTag(pfileToWrite, pcBuffer);
00558 
00559     //Then reset the indent
00560     pFilter->Unindent();
00561 
00562     //And write out a new line
00563     lCharsWritten += pFilter->WriteEOL(pfileToWrite, pcBuffer);
00564     
00565     //And return the number of characters we've written
00566     return lCharsWritten;
00567 #else
00568     return 0;
00569 #endif
00570 }


Member Data Documentation

DocCoord ImagemapClickableCircle::m_dcCentre
 

Definition at line 237 of file clicarea.h.

INT32 ImagemapClickableCircle::m_lRadius
 

Definition at line 238 of file clicarea.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:21 2007 for Camelot by  doxygen 1.4.4