#include <imagemap.h>
Inheritance diagram for Imagemap:
Public Member Functions | |
Imagemap () | |
Default constructor. | |
~Imagemap () | |
Destructor. | |
void | AddRectangle (DocRect rectToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL) |
Adds a rectangular clickable region to the imagemap. | |
void | AddCircle (Path *pthToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL) |
Adds a circular clickable region to the imagemap. | |
void | AddPolygon (Path *pthToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL) |
Adds a straight-sided polygon to the imagemap. | |
INT32 | Write (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL) |
Writes out the imagemap. |
ImagemapClickableCircle ImagemapClickableRectangle ImagemapClickablePolygon
All these classes are derived from the ImagemapClickableArea class, which is in turn derived from ListItem.
This imagemap class also has the ability to write itself out to a file, via the Write function.
Definition at line 133 of file imagemap.h.
|
Default constructor.
Definition at line 126 of file imagemap.cpp. 00126 : OverrideList() 00127 { 00128 //Does nothing 00129 }
|
|
Destructor.
Definition at line 147 of file imagemap.cpp. 00148 { 00149 //Delete all our list items 00150 DeleteAll(); 00151 }
|
|
Adds a circular clickable region to the imagemap. > Imagemap::AddCircle(Path* pthToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);
Definition at line 194 of file imagemap.cpp. 00195 { 00196 //Create a new ImagemapClickableCircle with our scaled path 00197 ImagemapClickableCircle* pCircle=new ImagemapClickableCircle(pthToAdd, pcURL, pcFrame); 00198 00199 //And add it to the imagemap 00200 //Note that we add it to the head of the list. That's because, in imagemaps, 00201 //the first clickable area found in the file is the one nearest the front. 00202 AddHead(pCircle); 00203 }
|
|
Adds a straight-sided polygon to the imagemap. > Imagemap::AddPolygon(Path* pthToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);
Definition at line 218 of file imagemap.cpp. 00219 { 00220 //Create a new ImagemapClickableCircle with the path we've been given 00221 ImagemapClickablePolygon* pPolygon=new ImagemapClickablePolygon(pthToAdd, pcURL, pcFrame); 00222 00223 //And add it to the imagemap 00224 //Note that we add it to the head of the list. That's because, in imagemaps, 00225 //the first clickable area found in the file is the one nearest the front. 00226 AddHead(pPolygon); 00227 }
|
|
Adds a rectangular clickable region to the imagemap. > Imagemap::AddRectangle(DocRect rectToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);
Definition at line 171 of file imagemap.cpp. 00172 { 00173 //Create a new ImagemapClickableRectangle with the rectangle we've been given 00174 ImagemapClickableRectangle* pRectangle=new ImagemapClickableRectangle(rectToAdd, pcURL, pcFrame); 00175 00176 //And add it to the imagemap 00177 //Note that we add it to the head of the list. That's because, in imagemaps, 00178 //the first clickable area found in the file is the one nearest the front. 00179 AddHead(pRectangle); 00180 }
|
|
Writes out the imagemap. > INT32 Imagemap::WriteHelper(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)
SeeAlso: ImagemapRenderRegion::Write() Definition at line 258 of file imagemap.cpp. 00259 { 00260 //Set up a variable to remember how many bytes we have written 00261 INT32 lBytesWritten=0; 00262 00263 //Now, get the first clickable area in the imagemap 00264 ImagemapClickableArea* pAreaToWrite=(ImagemapClickableArea*) GetHead(); 00265 00266 //And while we're still looking at a valid clickable area 00267 while (pAreaToWrite!=NULL) 00268 { 00269 //Tell that area to write itself out to the imagemap. 00270 //This function will return the number of TCHARs it writes 00271 lBytesWritten+=pAreaToWrite->Write(pfileToWrite, pcBuffer); 00272 00273 //And move on to the next clickable area 00274 pAreaToWrite=(ImagemapClickableArea*) GetNext(pAreaToWrite); 00275 } 00276 00277 //And return the number of TCHARs we have written 00278 return lBytesWritten; 00279 00280 }
|