Index: /trunk/Documentation/perldoc_idl/SelectMap__define.html
===================================================================
--- /trunk/Documentation/perldoc_idl/SelectMap__define.html	(revision 61)
+++ /trunk/Documentation/perldoc_idl/SelectMap__define.html	(revision 61)
@@ -0,0 +1,424 @@
+<html>
+<head>
+<title>GRAHI Documentation Project (GDP): SelectMap__define.pro</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="author" content="Antonio Santiago" />
+<meta name="generator" content="PerlScript IDL documentation generator" />
+<link rel="stylesheet" type="text/css" href="style.css">
+<script language="javascript" type="text/javascript">
+function changeVisibility(elemId){
+var elem = document.getElementById(elemId).style;
+if(elem.display=='block') elem.display='none';
+else elem.display='block';
+}
+</script>
+</head>
+<body>
+<div class="head">GRAHI Documentation Project (GDP)</div><div class="descrip">Filename: <b>SelectMap__define.pro</b></div>
+</code></div></div><div class="comment"><div class="tag_name"><b>CLASSNAME:</b>&nbsp;SelectMap</br></div><div class="tag_author"><b>AUTHOR:</b>&nbsp;</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Antonio&nbsp;Santiago&nbsp;Perez&nbsp;<a href="mailto:santiago@grahi.upc.edu">&lt;santiago@grahi.upc.edu&gt;</a>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(http://asantiago.gentelibre.org)
+</br></div><div class="tag_description"><b>DESCRIPTION:</b>&nbsp;</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Show&nbsp;a&nbsp;background&nbsp;image&nbsp;and&nbsp;make&nbsp;line&nbsp;selection.&nbsp;The
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;coordenates&nbsp;of&nbsp;initial/final&nbsp;points&nbsp;of&nbsp;the&nbsp;line&nbsp;seleccion&nbsp;are
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returned&nbsp;normalized&nbsp;respect&nbsp;widget&nbsp;and&nbsp;image&nbsp;size.
+</br></div><div class="tag_methods"><b>METHODS:</b></br></div><div class="tag_history"><b>HISTORY:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mon&nbsp;Nov&nbsp;15&nbsp;17:44:54&nbsp;2004,&nbsp;Antonio&nbsp;Santiago
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:santiago@grahi.upc.edu">&lt;santiago@grahi.upc.edu&gt;</a>
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_0');">+Code:</a></br><div class="code_text" id="code_0"><code><b>PRO</b>&nbsp;SelectMap__define
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;=&nbsp;{&nbsp;SelectMap,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INHERITS&nbsp;EventAction,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent_id:&nbsp;0L,&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Parent&nbsp;widget</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base_id:&nbsp;0L,&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;WIDGET_BASE&nbsp;of&nbsp;the&nbsp;object.</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;widget_id:&nbsp;0L,&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;WIDGET_DRAW&nbsp;inside&nbsp;widget_base.</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWindow:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;The&nbsp;window</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oView:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;The&nbsp;view</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oModel:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;The&nbsp;model</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oImage:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Background&nbsp;image</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oPalette:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Palette&nbsp;for&nbsp;the&nbsp;image</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oSelectLine:&nbsp;OBJ_NEW(),&nbsp;$&nbsp;<i><b>;Selection&nbsp;line</b></i></br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size:&nbsp;[0.,&nbsp;0.],&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Widget&nbsp;draw&nbsp;size</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map_size:&nbsp;[0.,&nbsp;0.],&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Image&nbsp;size</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Line&nbsp;selection
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_sel:&nbsp;[[0.,0.],&nbsp;[0.,0.]],&nbsp;$&nbsp;<i><b>;Initial/final&nbsp;poinst&nbsp;of&nbsp;the</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;selected&nbsp;line&nbsp;with&nbsp;coordenates&nbsp;respect
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;widget_draw&nbsp;size.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_map_sel:&nbsp;[[0.,0.],&nbsp;[0.,0.]],&nbsp;$&nbsp;<i><b>;Initial/final&nbsp;points&nbsp;of&nbsp;the</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;selected&nbsp;line&nbsp;with&nbsp;coordenates&nbsp;respect
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;image&nbsp;size.
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Square&nbsp;selection
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;square_sel:&nbsp;[[0.,0.],&nbsp;[0.,0.],&nbsp;$&nbsp;<i><b>;Initial/final&nbsp;poinst&nbsp;of&nbsp;the</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0.,0.],&nbsp;[0.,0.]],&nbsp;$&nbsp;<i><b>;selected&nbsp;square&nbsp;with</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;coordenates&nbsp;respect
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;widget_draw&nbsp;size.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;square_map_sel:&nbsp;[[0.,0.],&nbsp;[0.,0.],&nbsp;$&nbsp;<i><b>;Initial/final&nbsp;points&nbsp;of&nbsp;the</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0.,0.],&nbsp;[0.,0.]],&nbsp;$&nbsp;<i><b>;selected&nbsp;square&nbsp;with</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;coordenates&nbsp;respect
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;image&nbsp;size.
+</b></i></br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selectionType:&nbsp;'',&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Specifies&nbsp;the&nbsp;selection&nbsp;type:&nbsp;LINE/SQUARE</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bSelecting:&nbsp;0B,&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Are&nbsp;we&nbsp;making&nbsp;a&nbsp;selection?</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bHideSelection:&nbsp;0B,&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><b>;Is&nbsp;visible&nbsp;the&nbsp;selection&nbsp;line?</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bDynamicSelection:&nbsp;0B&nbsp;$&nbsp;&nbsp;&nbsp;<i><b>;Emit&nbsp;SELECTION&nbsp;signals&nbsp;when&nbsp;we&nbsp;are</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;making&nbsp;the&nbsp;selection?
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::Init</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates&nbsp;an&nbsp;instance&nbsp;of&nbsp;'SelectMap'&nbsp;class.
+</br></div><div class="tag_parameters"><b>PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent&nbsp;-&nbsp;Parents&nbsp;widget&nbsp;ID.
+</br></div><div class="tag_parameters"><b>EXTRA PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extra&nbsp;-&nbsp;Extra&nbsp;KEYWORD&nbsp;with&nbsp;options&nbsp;to&nbsp;be&nbsp;passed&nbsp;to&nbsp;the
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;widget_draw.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_1');">+Code:</a></br><div class="code_text" id="code_1"><code><b>FUNCTION</b>&nbsp;SelectMap::Init,&nbsp;parent,&nbsp;<b>_EXTRA</b>=extra
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Initilize&nbsp;superclass
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;=&nbsp;self->EventAction::Init()
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>NOT</b>&nbsp;<b>KEYWORD_SET</b>(parent)&nbsp;<b>THEN</b>&nbsp;<b>RETURN</b>,&nbsp;0
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Create&nbsp;widget&nbsp;and&nbsp;object&nbsp;hieriarchy.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;wBase&nbsp;=&nbsp;<b>WIDGET_BASE</b>(parent)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;wDraw&nbsp;=&nbsp;<b>WIDGET_DRAW</b>(wBase,&nbsp;GRAPHICS_LEVEL=2,&nbsp;/EXPOSE_EVENTS,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/BUTTON_EVENTS,&nbsp;/MOTION_EVENTS,&nbsp;<b>_EXTRA</b>=extra,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UVALUE={class_name:&nbsp;'SelectMap',&nbsp;object:&nbsp;self,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handler:&nbsp;'EventHandler'})
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.parent_id&nbsp;=&nbsp;parent
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.base_id&nbsp;=&nbsp;wBase
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.widget_id&nbsp;=&nbsp;wDraw
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Register&nbsp;the&nbsp;'event'&nbsp;of&nbsp;the&nbsp;class
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self->AddEvent,&nbsp;'SELECTION'
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self->AddEvent,&nbsp;'MOTION'
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self->Initialize
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>RETURN</b>,&nbsp;1
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::Initialize</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialize&nbsp;the&nbsp;state&nbsp;of&nbsp;the&nbsp;object.&nbsp;If&nbsp;it&nbsp;is&nbsp;executed&nbsp;when&nbsp;the
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object&nbsp;is&nbsp;running&nbsp;the&nbsp;object's&nbsp;state&nbsp;goes&nbsp;back&nbsp;to&nbsp;the&nbsp;same&nbsp;as
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;creation&nbsp;state.&nbsp;All&nbsp;possible&nbsp;used&nbsp;memory&nbsp;are&nbsp;free.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_2');">+Code:</a></br><div class="code_text" id="code_2"><code><b>PRO</b>&nbsp;SelectMap::Initialize
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Free&nbsp;memory&nbsp;usage
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self->Clear
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Realize&nbsp;the&nbsp;WIDGET_BASE&nbsp;and&nbsp;get&nbsp;the&nbsp;IDLgrWindow&nbsp;object&nbsp;from,
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;WIDGET_DRAW
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>WIDGET_CONTROL</b>,&nbsp;self.base_id&nbsp;,&nbsp;/REALIZE
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>WIDGET_CONTROL</b>,&nbsp;self.widget_id,&nbsp;GET_VALUE=oWindow	
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oWindow->SetProperty,&nbsp;QUALITY=0
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oView&nbsp;=&nbsp;OBJ_NEW('IDLgrView',&nbsp;ZCLIP=[0.2,-0.2],&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VIEWPLANE_RECT=[0,0,1,1],&nbsp;COLOR=[50,50,70])		
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oModel&nbsp;=&nbsp;OBJ_NEW('IDLgrModel')	
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oLight&nbsp;=&nbsp;OBJ_NEW('IDLgrLight',&nbsp;TYPE=1,&nbsp;LOCATION=[0,0,12],&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTENSITY=0.95)
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Initialize&nbsp;attributes
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;geom&nbsp;=&nbsp;<b>WIDGET_INFO</b>(self.widget_id,&nbsp;/GEOMETRY)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.size&nbsp;=&nbsp;[geom.xsize,&nbsp;geom.ysize]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.map_size&nbsp;=&nbsp;[0.,&nbsp;0.]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.line_sel&nbsp;=&nbsp;[[0.,0.],&nbsp;[0.,0.]]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.line_map_sel&nbsp;=&nbsp;[[0.,0.],&nbsp;[0.,0.]]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.selectionType&nbsp;=&nbsp;'SQUARE'
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.bHideSelection&nbsp;=&nbsp;0	<i><b>;Hide&nbsp;selection</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.bDynamicSelection&nbsp;=&nbsp;0&nbsp;&nbsp;<i><b>;No&nbsp;dynamic&nbsp;selection</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.bSelecting&nbsp;=&nbsp;0
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Save&nbsp;references&nbsp;to&nbsp;the&nbsp;objects
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;oView->Add,&nbsp;oModel	
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oModel->Add,&nbsp;oLight
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oWindow&nbsp;=&nbsp;oWindow
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oView&nbsp;=&nbsp;oView
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oModel&nbsp;=&nbsp;oModel
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><b>END</b>	
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::Cleanup</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;Free&nbsp;memory&nbsp;used&nbsp;by&nbsp;the&nbsp;object.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_3');">+Code:</a></br><div class="code_text" id="code_3"><code><b>PRO</b>&nbsp;SelectMap::Cleanup
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>OBJ_DESTROY</b>,&nbsp;[self.oWindow]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self->Clear
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self->EventAction::Cleanup
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::Clear</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free&nbsp;memory&nbsp;used&nbsp;by&nbsp;the&nbsp;object.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_4');">+Code:</a></br><div class="code_text" id="code_4"><code><b>PRO</b>&nbsp;SelectMap::Clear
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;When&nbsp;destroy&nbsp;de&nbsp;IDLgrView&nbsp;the&nbsp;IDLgrModel&nbsp;are&nbsp;destroyed&nbsp;with&nbsp;all
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;its&nbsp;contents,&nbsp;included&nbsp;the&nbsp;image&nbsp;and&nbsp;seleccion&nbsp;line.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>OBJ_DESTROY</b>,&nbsp;[self.oView,&nbsp;self.oPalette,&nbsp;self.oSelectLine]
+</br><b>END</b>	
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::SetPalette</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets&nbsp;a&nbsp;color&nbsp;palette&nbsp;used&nbsp;to&nbsp;show&nbsp;bachground&nbsp;image.&nbsp;Only&nbsp;takes
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efect&nbsp;if&nbsp;the&nbsp;background&nbsp;image&nbsp;is&nbsp;a&nbsp;X,Y&nbsp;array.
+</br></div><div class="tag_parameters"><b>PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;colors&nbsp;-&nbsp;256x3&nbsp;array&nbsp;values&nbsp;(RGB).
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_5');">+Code:</a></br><div class="code_text" id="code_5"><code><b>PRO</b>&nbsp;SelectMap::SetPalette,&nbsp;colors
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Destroy&nbsp;the&nbsp;last&nbsp;palette&nbsp;(if&nbsp;exists)
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>OBJ_DESTROY</b>,&nbsp;self.oPalette
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;oPalette&nbsp;=&nbsp;OBJ_NEW('IDLgrPalette',&nbsp;colors[*,0],&nbsp;colors[*,1],&nbsp;colors[*,2])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Save&nbsp;reference&nbsp;to&nbsp;the&nbsp;palette.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.oPalette&nbsp;=&nbsp;oPalette
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::SetMap</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets&nbsp;a&nbsp;background&nbsp;image.&nbsp;The&nbsp;image&nbsp;can&nbsp;be&nbsp;a&nbsp;(x,y)&nbsp;array&nbsp;that
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;colored&nbsp;with&nbsp;the&nbsp;specified&nbsp;palette&nbsp;or&nbsp;may&nbsp;be&nbsp;a
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(3,x,y),&nbsp;(x,3,y)&nbsp;or&nbsp;(x,y,3)&nbsp;array&nbsp;(like&nbsp;an&nbsp;'jpeg'&nbsp;image).
+</br></div><div class="tag_parameters"><b>PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data_map&nbsp;-&nbsp;Array&nbsp;2D&nbsp;or&nbsp;3D&nbsp;with&nbsp;the&nbsp;image&nbsp;to&nbsp;show.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_6');">+Code:</a></br><div class="code_text" id="code_6"><code><b>PRO</b>&nbsp;SelectMap::SetMap,&nbsp;data_map
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Destroy&nbsp;previeus&nbsp;objects.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>OBJ_DESTROY</b>,&nbsp;[self.oImage,&nbsp;self.oSelectLine]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Get&nbsp;dimension&nbsp;of&nbsp;the&nbsp;image&nbsp;and&nbsp;calcula&nbsp;the&nbsp;normalization&nbsp;factors
+</b></i></br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;depending&nbsp;on&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;image.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;sizes&nbsp;=&nbsp;<b>SIZE</b>(data_map,&nbsp;/DIMENSIONS)
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>N_ELEMENTS</b>(sizes)&nbsp;<b>EQ</b>&nbsp;3&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Image&nbsp;3,X,Y
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;sizes[0]&nbsp;<b>LE</b>&nbsp;4&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsize&nbsp;=&nbsp;sizes[1]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ysize&nbsp;=&nbsp;sizes[2]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;xsize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;ysize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Image&nbsp;X,3,Y
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;sizes[1]&nbsp;<b>LE</b>&nbsp;4&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsize&nbsp;=&nbsp;sizes[0]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ysize&nbsp;=&nbsp;sizes[2]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;xsize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;ysize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Image&nbsp;X,Y,3&nbsp;
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;sizes[2]&nbsp;<b>LE</b>&nbsp;4&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsize&nbsp;=&nbsp;sizes[0]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ysize&nbsp;=&nbsp;sizes[1]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;xsize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;ysize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;<b>ELSE</b>&nbsp;<b>BEGIN</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Image&nbsp;X,Y
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsize&nbsp;=&nbsp;sizes[0]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ysize&nbsp;=&nbsp;sizes[1]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;xsize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yconv&nbsp;=&nbsp;NORMALIZE([0,&nbsp;ysize-1],&nbsp;Position=[0,1])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDELSE</b>
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Save&nbsp;the&nbsp;dimensions&nbsp;of&nbsp;the&nbsp;image.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.map_size&nbsp;=&nbsp;[xsize,&nbsp;ysize]
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Create&nbsp;the&nbsp;image&nbsp;as&nbsp;a&nbsp;texture&nbsp;of&nbsp;polygon.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;oImage&nbsp;=&nbsp;OBJ_NEW('IDLgrImage',&nbsp;data_map,&nbsp;PALETTE=self.oPalette,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XCOORD_CONV=xconv,&nbsp;YCOORD_CONV=yconv)
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Create&nbsp;the&nbsp;selection&nbsp;line&nbsp;object
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;self.selectionType&nbsp;<b>EQ</b>&nbsp;'LINE'&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect_line&nbsp;=&nbsp;[2,&nbsp;0,&nbsp;1]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oSelectLine&nbsp;=&nbsp;OBJ_NEW('IDLgrPolyline',&nbsp;self.line_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POLYLINES=connect_line,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[150,150,150],&nbsp;THICK=2,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HIDE=self.bHideSelection,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XCOORD_CONV=xconv,&nbsp;YCOORD_CONV=yconv)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;<b>ELSE</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect_line&nbsp;=&nbsp;[4,&nbsp;0,&nbsp;1,&nbsp;2,&nbsp;3]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oSelectLine&nbsp;=&nbsp;OBJ_NEW('IDLgrPolyline',&nbsp;self.square_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POLYLINES=connect_line,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[150,150,150],&nbsp;THICK=2,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HIDE=self.bHideSelection,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XCOORD_CONV=xconv,&nbsp;YCOORD_CONV=yconv)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDELSE</b>&nbsp;
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Save&nbsp;object&nbsp;references
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.oModel->Add,&nbsp;oImage
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oModel->Add,&nbsp;oSelectLine
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oImage&nbsp;=&nbsp;oImage
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine&nbsp;=&nbsp;oSelectLine
+</br>
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::Draw</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws&nbsp;the&nbsp;object.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_7');">+Code:</a></br><div class="code_text" id="code_7"><code><b>PRO</b>&nbsp;SelectMap::Draw
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.oWindow->Draw,&nbsp;self.oView
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::GetProperty</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;Get&nbsp;the&nbsp;the&nbsp;properties&nbsp;of&nbsp;the&nbsp;object.
+</br></div><div class="tag_parameters"><b>KEYWORD PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;-&nbsp;ID&nbsp;of&nbsp;the&nbsp;WIDGET_BASE&nbsp;over&nbsp;the&nbsp;object&nbsp;are&nbsp;created.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_8');">+Code:</a></br><div class="code_text" id="code_8"><code>&nbsp;<b>PRO</b>&nbsp;SelectMap::GetProperty,&nbsp;ID=id
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;=&nbsp;self.base_id
+</br>&nbsp;<b>END</b>	
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::SetProperty</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;Sets&nbsp;the&nbsp;properties&nbsp;of&nbsp;the&nbsp;object.
+</br></div><div class="tag_parameters"><b>KEYWORD PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hide_selection&nbsp;-&nbsp;Show/hide&nbsp;the&nbsp;selection&nbsp;line.
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dynamic_selection&nbsp;-&nbsp;If&nbsp;true,&nbsp;SELECTION&nbsp;events&nbsp;are&nbsp;emited&nbsp;while&nbsp;a
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selecction&nbsp;is&nbsp;doing.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_9');">+Code:</a></br><div class="code_text" id="code_9"><code><b>PRO</b>&nbsp;SelectMap::SetProperty,&nbsp;$
+</br>&nbsp;&nbsp;SELECTION_TYPE=selection_type,&nbsp;$
+</br>&nbsp;&nbsp;DYNAMIC_SELECTION=dynamic_selection,&nbsp;$
+</br>&nbsp;&nbsp;HIDE_SELECTION=hide_selection
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;selection_type&nbsp;<b>EQ</b>&nbsp;'LINE'&nbsp;<b>OR</b>&nbsp;selection_type&nbsp;<b>EQ</b>&nbsp;'SQUARE'&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.selectionType&nbsp;=&nbsp;selection_type
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>N_ELEMENTS</b>(dynamic_selection)&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.bDynamicSelection&nbsp;=&nbsp;dynamic_selection
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>N_ELEMENTS</b>(hide_selection)&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.bHideSelection&nbsp;=&nbsp;hide_selection
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;HIDE=hide_selection
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;<b>END</b>	
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap_EventHandler</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object's&nbsp;event&nbsp;handler.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_10');">+Code:</a></br><div class="code_text" id="code_10"><code><b>PRO</b>&nbsp;SelectMap::EventHandler,&nbsp;event
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Expose&nbsp;Event
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;event.type&nbsp;<b>EQ</b>&nbsp;4&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->Draw
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Mouse&nbsp;down&nbsp;button
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;(event.type&nbsp;<b>EQ</b>&nbsp;0)&nbsp;<b>AND</b>&nbsp;(event.press&nbsp;<b>EQ</b>&nbsp;1)&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>NOT</b>&nbsp;self.bHideSelection&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Set&nbsp;that&nbsp;a&nbsp;selection&nbsp;is&nbsp;doing
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.bSelecting&nbsp;=&nbsp;1
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Update&nbsp;the&nbsp;line&nbsp;coordenates
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateLineSelection,&nbsp;event,&nbsp;/ALL
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateSquareSelection,&nbsp;event,&nbsp;/ALL
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;self.selectionType&nbsp;<b>EQ</b>&nbsp;'LINE'&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect_line&nbsp;=&nbsp;[2,&nbsp;0,&nbsp;1]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.line_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[255,255,0],&nbsp;POLYLINE=connect_line
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;<b>ELSE</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect_line&nbsp;=&nbsp;[4,&nbsp;0,&nbsp;1,&nbsp;2,&nbsp;3]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.square_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[255,255,0],&nbsp;POLYLINE=connect_line&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDELSE</b>&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Mouse&nbsp;up&nbsp;button
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;(event.type&nbsp;<b>EQ</b>&nbsp;1)&nbsp;&nbsp;<b>AND</b>&nbsp;(event.release&nbsp;<b>EQ</b>&nbsp;1)<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Set&nbsp;that&nbsp;the&nbsp;selection&nbsp;are&nbsp;finished
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.bSelecting&nbsp;=&nbsp;0
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Update&nbsp;the&nbsp;line&nbsp;corrdenates.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateLineSelection,&nbsp;event
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateSquareSelection,&nbsp;event
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;self.selectionType&nbsp;<b>EQ</b>&nbsp;'LINE'&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.line_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[255,255,255]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;<b>ELSE</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.square_map_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR=[255,255,255]&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDELSE</b>&nbsp;
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Generate&nbsp;a&nbsp;'SELECTION'&nbsp;event.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->Draw
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->EmitEvent,&nbsp;'SELECTION',&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EVENT_STRUCT={line_sel:&nbsp;self.line_sel,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_map_sel:&nbsp;self.line_map_sel}
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Mouse&nbsp;move
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;(event.type&nbsp;<b>EQ</b>&nbsp;2)&nbsp;&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;If&nbsp;a&nbsp;selection&nbsp;is&nbsp;doing&nbsp;actualize&nbsp;the&nbsp;coordenates.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;self.bSelecting&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateLineSelection,&nbsp;event&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->UpdateSquareSelection,&nbsp;event
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;self.selectionType&nbsp;<b>EQ</b>&nbsp;'LINE'&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.line_map_sel
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>&nbsp;<b>ELSE</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oSelectLine->SetProperty,&nbsp;DATA=self.square_map_sel&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDELSE</b>&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->Draw
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Generate&nbsp;a&nbsp;'MOTION'&nbsp;event.
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values&nbsp;=&nbsp;[event.x,&nbsp;event.y]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;convert&nbsp;=&nbsp;self->ConvertValuesW2M(values)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self->EmitEvent,&nbsp;'MOTION',&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EVENT_STRUCT={&nbsp;point_sel:&nbsp;values,&nbsp;$
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point_map_sel:&nbsp;convert&nbsp;}
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::UpdateLineSelection</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get&nbsp;the&nbsp;actual&nbsp;coordenate&nbsp;points&nbsp;and&nbsp;convert&nbsp;respect&nbsp;the&nbsp;image
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size.
+</br></div><div class="tag_parameters"><b>KEYWORD PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;-&nbsp;If&nbsp;set&nbsp;specify&nbsp;that&nbsp;the&nbsp;two&nbsp;points&nbsp;(origin,&nbsp;final)&nbsp;of
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;selection&nbsp;line&nbsp;must&nbsp;to&nbsp;be&nbsp;initialize.&nbsp;If&nbsp;not&nbsp;set,
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;the&nbsp;final&nbsp;point&nbsp;is&nbsp;converted.
+</br></div><b>NOTE:</b>&nbsp;The&nbsp;0&nbsp;and&nbsp;2&nbsp;points&nbsp;of&nbsp;the&nbsp;square&nbsp;are&nbsp;the&nbsp;initial&nbsp;and&nbsp;final</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points&nbsp;respectively.
+</br></div><div class="code"><a href="#" onClick="changeVisibility('code_11');">+Code:</a></br><div class="code_text" id="code_11"><code><b>PRO</b>&nbsp;SelectMap::UpdateLineSelection,&nbsp;event,&nbsp;ALL=all
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;xpoint&nbsp;=&nbsp;(event.x&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[0]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;ypoint&nbsp;=&nbsp;(event.y&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[1]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>KEYWORD_SET</b>(all)&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.line_sel[*,0]&nbsp;=&nbsp;[xpoint,&nbsp;ypoint]&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.line_map_sel[*,0]&nbsp;=&nbsp;self->ConvertValuesW2M(self.line_sel[*,0])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.line_sel[*,1]&nbsp;=&nbsp;[xpoint,&nbsp;ypoint]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.line_map_sel[*,1]&nbsp;=&nbsp;self->ConvertValuesW2M(self.line_sel[*,1])
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::UpdateSquareSelection</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get&nbsp;the&nbsp;actual&nbsp;coordenate&nbsp;points&nbsp;and&nbsp;convert&nbsp;respect&nbsp;the&nbsp;image
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size.
+</br></div><div class="tag_parameters"><b>KEYWORD PARAMETERS:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;-&nbsp;If&nbsp;set&nbsp;specify&nbsp;that&nbsp;the&nbsp;two&nbsp;points&nbsp;(origin,&nbsp;final)&nbsp;of
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;selection&nbsp;line&nbsp;must&nbsp;to&nbsp;be&nbsp;initialize.&nbsp;If&nbsp;not&nbsp;set,
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;the&nbsp;final&nbsp;point&nbsp;is&nbsp;converted.
+</br></div><b>NOTE:</b>&nbsp;The&nbsp;0&nbsp;and&nbsp;2&nbsp;points&nbsp;of&nbsp;the&nbsp;square&nbsp;are&nbsp;the&nbsp;initial&nbsp;and&nbsp;final</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points&nbsp;respectively.
+</br></div><div class="code"><a href="#" onClick="changeVisibility('code_12');">+Code:</a></br><div class="code_text" id="code_12"><code><b>PRO</b>&nbsp;SelectMap::UpdateSquareSelection,&nbsp;event,&nbsp;ALL=all
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;xpoint&nbsp;=&nbsp;(event.x&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[0]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;ypoint&nbsp;=&nbsp;(event.y&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[1]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IF</b>&nbsp;<b>KEYWORD_SET</b>(all)&nbsp;<b>THEN</b>&nbsp;<b>BEGIN</b>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;Initial&nbsp;point
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.square_sel[*,0]&nbsp;=&nbsp;[xpoint,&nbsp;ypoint]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.square_map_sel[*,0]&nbsp;=&nbsp;self->ConvertValuesW2M([xpoint,&nbsp;ypoint])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>ENDIF</b>
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Final&nbsp;point
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_sel[*,2]&nbsp;=&nbsp;[xpoint,&nbsp;ypoint]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_map_sel[*,2]&nbsp;=&nbsp;self->ConvertValuesW2M([xpoint,&nbsp;ypoint])
+</br>
+</br><i><b>&nbsp;&nbsp;&nbsp;&nbsp;;;Other&nbsp;points
+</b></i></br>&nbsp;&nbsp;&nbsp;&nbsp;xinit&nbsp;=&nbsp;self.square_sel[0,0]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;yinit&nbsp;=&nbsp;self.square_sel[1,0]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;=&nbsp;xinit&nbsp;-&nbsp;xpoint
+</br>&nbsp;&nbsp;&nbsp;&nbsp;height&nbsp;=&nbsp;yinit&nbsp;-&nbsp;ypoint
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_sel[*,1]&nbsp;=&nbsp;[(xinit&nbsp;+&nbsp;width),&nbsp;ypoint]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_map_sel[*,1]&nbsp;=&nbsp;self->ConvertValuesW2M([xpoint,&nbsp;ypoint])
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_sel[*,3]&nbsp;=&nbsp;[xpoint,&nbsp;(ypoint&nbsp;+&nbsp;height)]
+</br>&nbsp;&nbsp;&nbsp;&nbsp;self.square_map_sel[*,3]&nbsp;=&nbsp;self->ConvertValuesW2M([xpoint,&nbsp;ypoint])
+</br>
+</br>
+</br><b>END</b>
+</br>
+</br>
+</br></code></div></div><div class="comment"><div class="tag_name"><b>NAME:</b>&nbsp;SelectMap::ConvertValuesW2M</br></div><div class="tag_description"><b>DESCRIPTION:</b></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert&nbsp;a&nbsp;pair&nbsp;of&nbsp;values&nbsp;from&nbsp;widget&nbsp;size&nbsp;relative&nbsp;coordenatos
+</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;the&nbsp;image&nbsp;relativa&nbsp;size&nbsp;coordenates.
+</br></div></div><div class="code"><a href="#" onClick="changeVisibility('code_13');">+Code:</a></br><div class="code_text" id="code_13"><code><b>FUNCTION</b>&nbsp;SelectMap::ConvertValuesW2M,&nbsp;values
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;values[0]&nbsp;=&nbsp;(values[0]&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[0]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;values[1]&nbsp;=&nbsp;(values[1]&nbsp;>&nbsp;0)&nbsp;<&nbsp;(self.size[1]-1)
+</br>
+</br>&nbsp;&nbsp;&nbsp;&nbsp;convert&nbsp;=&nbsp;values
+</br>&nbsp;&nbsp;&nbsp;&nbsp;convert[0]&nbsp;=&nbsp;values[0]&nbsp;*&nbsp;(self.map_size[0]-1)&nbsp;/&nbsp;(self.size[0]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;convert[1]&nbsp;=&nbsp;values[1]&nbsp;*&nbsp;(self.map_size[1]-1)&nbsp;/&nbsp;(self.size[1]-1)
+</br>&nbsp;&nbsp;&nbsp;&nbsp;
+</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>RETURN</b>,&nbsp;convert
+</br><b>END</b>
+</br>
+</br>
+</br>
+</br></code></div></div><div class="final">&middot; Created by the PerlScript documentation generator for IDL &middot; <br> &middot; <i>Thu Dec  2 16:01:50 2004</i> &middot;</div></body></html>
Index: /trunk/Documentation/perldoc_idl/SelectMap__define.pro
===================================================================
--- /trunk/Documentation/perldoc_idl/SelectMap__define.pro	(revision 61)
+++ /trunk/Documentation/perldoc_idl/SelectMap__define.pro	(revision 61)
@@ -0,0 +1,541 @@
+;+---------------------------------------------------------------------------
+; CLASSNAME: SelectMap
+;
+; AUTHOR: 
+;       Antonio Santiago Perez <santiago@grahi.upc.edu>
+;                              (http://asantiago.gentelibre.org)
+;
+; DESCRIPTION: 
+;       Show a background image and make line selection. The
+;       coordenates of initial/final points of the line seleccion are
+;       returned normalized respect widget and image size.
+;
+; METHODS:
+;	
+;
+; HISTORY:
+;
+;       Mon Nov 15 17:44:54 2004, Antonio Santiago
+;       <santiago@grahi.upc.edu>
+;
+;----------------------------------------------------------------------------
+PRO SelectMap__define
+    
+    struct = { SelectMap, $
+      INHERITS EventAction, $
+      parent_id: 0L, $          ;Parent widget
+      base_id: 0L, $            ;WIDGET_BASE of the object.
+      widget_id: 0L, $          ;WIDGET_DRAW inside widget_base.
+      
+      oWindow: OBJ_NEW(), $     ;The window
+      oView: OBJ_NEW(), $       ;The view
+      oModel: OBJ_NEW(), $      ;The model
+      
+      oImage: OBJ_NEW(), $      ;Background image
+      oPalette: OBJ_NEW(), $    ;Palette for the image
+      oSelectLine: OBJ_NEW(), $ ;Selection line
+
+      size: [0., 0.], $         ;Widget draw size
+      map_size: [0., 0.], $     ;Image size
+      
+      ;;Line selection
+      line_sel: [[0.,0.], [0.,0.]], $ ;Initial/final poinst of the
+                                ;selected line with coordenates respect
+                                ;widget_draw size.
+      line_map_sel: [[0.,0.], [0.,0.]], $ ;Initial/final points of the
+                                ;selected line with coordenates respect
+                                ;image size.
+      ;;Square selection
+      square_sel: [[0.,0.], [0.,0.], $ ;Initial/final poinst of the
+                   [0.,0.], [0.,0.]], $ ;selected square with
+                                ;coordenates respect
+                                ;widget_draw size.
+      square_map_sel: [[0.,0.], [0.,0.], $ ;Initial/final points of the
+                       [0.,0.], [0.,0.]], $ ;selected square with
+                                ;coordenates respect
+                                ;image size.
+
+      selectionType: '', $      ;Specifies the selection type: LINE/SQUARE
+      bSelecting: 0B, $         ;Are we making a selection?
+      bHideSelection: 0B, $     ;Is visible the selection line?
+      bDynamicSelection: 0B $   ;Emit SELECTION signals when we are
+                                ;making the selection?
+      }
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::Init
+;
+; DESCRIPTION:
+;       Creates an instance of 'SelectMap' class.
+;
+; PARAMETERS:
+;       parent - Parents widget ID.
+;
+; EXTRA PARAMETERS:
+;       extra - Extra KEYWORD with options to be passed to the
+;               widget_draw.
+;
+;----------------------------------------------------------------------------
+FUNCTION SelectMap::Init, parent, _EXTRA=extra
+
+    ;;Initilize superclass
+    result = self->EventAction::Init()
+
+    IF NOT KEYWORD_SET(parent) THEN RETURN, 0
+
+    ;;Create widget and object hieriarchy.
+    wBase = WIDGET_BASE(parent)
+    wDraw = WIDGET_DRAW(wBase, GRAPHICS_LEVEL=2, /EXPOSE_EVENTS, $
+                        /BUTTON_EVENTS, /MOTION_EVENTS, _EXTRA=extra, $
+                        UVALUE={class_name: 'SelectMap', object: self, $
+                                handler: 'EventHandler'})
+    
+    self.parent_id = parent
+    self.base_id = wBase
+    self.widget_id = wDraw
+
+    ;;Register the 'event' of the class
+    self->AddEvent, 'SELECTION'
+    self->AddEvent, 'MOTION'
+    
+    self->Initialize
+    
+    RETURN, 1
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::Initialize
+;
+; DESCRIPTION:
+;       Initialize the state of the object. If it is executed when the
+;       object is running the object's state goes back to the same as
+;       the creation state. All possible used memory are free.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::Initialize
+
+    ;;Free memory usage
+    self->Clear
+
+    ;;Realize the WIDGET_BASE and get the IDLgrWindow object from,
+    ;;WIDGET_DRAW
+    WIDGET_CONTROL, self.base_id , /REALIZE
+    WIDGET_CONTROL, self.widget_id, GET_VALUE=oWindow	
+    oWindow->SetProperty, QUALITY=0
+    
+    oView = OBJ_NEW('IDLgrView', ZCLIP=[0.2,-0.2], $
+      VIEWPLANE_RECT=[0,0,1,1], COLOR=[50,50,70])		
+    oModel = OBJ_NEW('IDLgrModel')	
+    oLight = OBJ_NEW('IDLgrLight', TYPE=1, LOCATION=[0,0,12], $
+      INTENSITY=0.95)
+
+    ;;Initialize attributes
+    geom = WIDGET_INFO(self.widget_id, /GEOMETRY)
+    self.size = [geom.xsize, geom.ysize]
+    self.map_size = [0., 0.]
+    self.line_sel = [[0.,0.], [0.,0.]]
+    self.line_map_sel = [[0.,0.], [0.,0.]]
+    self.selectionType = 'SQUARE'
+    self.bHideSelection = 0	;Hide selection
+    self.bDynamicSelection = 0  ;No dynamic selection
+    self.bSelecting = 0
+
+    ;;Save references to the objects
+    oView->Add, oModel	
+    oModel->Add, oLight
+
+    self.oWindow = oWindow
+    self.oView = oView
+    self.oModel = oModel
+    
+END	
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::Cleanup
+;
+; DESCRIPTION:
+;	Free memory used by the object.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::Cleanup
+
+    OBJ_DESTROY, [self.oWindow]
+    
+    self->Clear
+
+    self->EventAction::Cleanup
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::Clear
+;
+; DESCRIPTION:
+;       Free memory used by the object.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::Clear
+    ;;When destroy de IDLgrView the IDLgrModel are destroyed with all
+    ;;its contents, included the image and seleccion line.
+    OBJ_DESTROY, [self.oView, self.oPalette, self.oSelectLine]
+END	
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::SetPalette
+;
+; DESCRIPTION:
+;       Sets a color palette used to show bachground image. Only takes
+;       efect if the background image is a X,Y array.
+;
+; PARAMETERS:
+;	colors - 256x3 array values (RGB).
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::SetPalette, colors
+    
+    ;;Destroy the last palette (if exists)
+    OBJ_DESTROY, self.oPalette
+    
+    oPalette = OBJ_NEW('IDLgrPalette', colors[*,0], colors[*,1], colors[*,2])
+    
+    ;;Save reference to the palette.
+    self.oPalette = oPalette
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::SetMap
+;
+; DESCRIPTION:
+; 	Sets a background image. The image can be a (x,y) array that
+; 	will be colored with the specified palette or may be a
+; 	(3,x,y), (x,3,y) or (x,y,3) array (like an 'jpeg' image).
+;
+; PARAMETERS:
+; 	data_map - Array 2D or 3D with the image to show.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::SetMap, data_map
+    
+    ;;Destroy previeus objects.
+    OBJ_DESTROY, [self.oImage, self.oSelectLine]
+    
+    ;;Get dimension of the image and calcula the normalization factors
+    ;;depending on the type of the image.
+    sizes = SIZE(data_map, /DIMENSIONS)
+
+    IF N_ELEMENTS(sizes) EQ 3 THEN BEGIN
+        ;;Image 3,X,Y
+        IF sizes[0] LE 4 THEN BEGIN
+            xsize = sizes[1]
+            ysize = sizes[2]
+            xconv = NORMALIZE([0, xsize-1], Position=[0,1])
+            yconv = NORMALIZE([0, ysize-1], Position=[0,1])
+        ENDIF
+        ;;Image X,3,Y
+        IF sizes[1] LE 4 THEN BEGIN
+            xsize = sizes[0]
+            ysize = sizes[2]
+            xconv = NORMALIZE([0, xsize-1], Position=[0,1])
+            yconv = NORMALIZE([0, ysize-1], Position=[0,1])
+        ENDIF
+        ;;Image X,Y,3 
+        IF sizes[2] LE 4 THEN BEGIN
+            xsize = sizes[0]
+            ysize = sizes[1]
+            xconv = NORMALIZE([0, xsize-1], Position=[0,1])
+            yconv = NORMALIZE([0, ysize-1], Position=[0,1])
+        ENDIF
+    ENDIF ELSE BEGIN
+        ;;Image X,Y
+        xsize = sizes[0]
+        ysize = sizes[1]
+        xconv = NORMALIZE([0, xsize-1], Position=[0,1])
+        yconv = NORMALIZE([0, ysize-1], Position=[0,1])
+    ENDELSE
+
+    ;;Save the dimensions of the image.
+    self.map_size = [xsize, ysize]
+
+    ;;Create the image as a texture of polygon.
+    oImage = OBJ_NEW('IDLgrImage', data_map, PALETTE=self.oPalette, $
+      XCOORD_CONV=xconv, YCOORD_CONV=yconv)
+
+    ;;Create the selection line object
+    IF self.selectionType EQ 'LINE' THEN BEGIN
+        connect_line = [2, 0, 1]
+        oSelectLine = OBJ_NEW('IDLgrPolyline', self.line_map_sel, $
+                              POLYLINES=connect_line, $
+                              COLOR=[150,150,150], THICK=2, $
+                              HIDE=self.bHideSelection, $
+                              XCOORD_CONV=xconv, YCOORD_CONV=yconv)        
+    ENDIF ELSE BEGIN
+        connect_line = [4, 0, 1, 2, 3]
+        oSelectLine = OBJ_NEW('IDLgrPolyline', self.square_map_sel, $
+                              POLYLINES=connect_line, $
+                              COLOR=[150,150,150], THICK=2, $
+                              HIDE=self.bHideSelection, $
+                              XCOORD_CONV=xconv, YCOORD_CONV=yconv)        
+    ENDELSE 
+
+    ;;Save object references
+    self.oModel->Add, oImage
+    self.oModel->Add, oSelectLine
+    self.oImage = oImage
+    self.oSelectLine = oSelectLine
+
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::Draw
+;
+; DESCRIPTION:
+;         Draws the object.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::Draw
+    self.oWindow->Draw, self.oView
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::GetProperty
+;
+; DESCRIPTION:
+;	Get the the properties of the object.
+;
+; KEYWORD PARAMETERS:
+;      id - ID of the WIDGET_BASE over the object are created.
+;
+;----------------------------------------------------------------------------
+ PRO SelectMap::GetProperty, ID=id
+
+     id = self.base_id
+ END	
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::SetProperty
+;
+; DESCRIPTION:
+;	Sets the properties of the object.
+;
+; KEYWORD PARAMETERS:
+;       hide_selection - Show/hide the selection line.
+;       dynamic_selection - If true, SELECTION events are emited while a
+;                           selecction is doing.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::SetProperty, $
+  SELECTION_TYPE=selection_type, $
+  DYNAMIC_SELECTION=dynamic_selection, $
+  HIDE_SELECTION=hide_selection
+        
+    IF selection_type EQ 'LINE' OR selection_type EQ 'SQUARE' THEN BEGIN
+        self.selectionType = selection_type
+    ENDIF
+
+    IF N_ELEMENTS(dynamic_selection) THEN BEGIN
+        self.bDynamicSelection = dynamic_selection
+    ENDIF
+
+    IF N_ELEMENTS(hide_selection) THEN BEGIN
+        self.bHideSelection = hide_selection
+        self.oSelectLine->SetProperty, HIDE=hide_selection
+    ENDIF
+    
+ END	
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap_EventHandler
+;
+; DESCRIPTION:
+;       Object's event handler.
+;	
+;----------------------------------------------------------------------------
+PRO SelectMap::EventHandler, event
+
+    ;;Expose Event
+    IF event.type EQ 4 THEN BEGIN
+        self->Draw
+    ENDIF
+    
+    ;;Mouse down button
+    IF (event.type EQ 0) AND (event.press EQ 1) THEN BEGIN
+        IF NOT self.bHideSelection THEN BEGIN
+            ;;Set that a selection is doing
+            self.bSelecting = 1
+
+            ;;Update the line coordenates
+            self->UpdateLineSelection, event, /ALL
+            self->UpdateSquareSelection, event, /ALL
+            IF self.selectionType EQ 'LINE' THEN BEGIN
+                connect_line = [2, 0, 1]
+                self.oSelectLine->SetProperty, DATA=self.line_map_sel, $
+                  COLOR=[255,255,0], POLYLINE=connect_line
+            ENDIF ELSE BEGIN
+                connect_line = [4, 0, 1, 2, 3]
+                self.oSelectLine->SetProperty, DATA=self.square_map_sel, $
+                  COLOR=[255,255,0], POLYLINE=connect_line            
+            ENDELSE 
+        ENDIF     
+           
+    ENDIF
+    
+    ;;Mouse up button
+    IF (event.type EQ 1)  AND (event.release EQ 1)THEN BEGIN
+
+        ;;Set that the selection are finished
+        self.bSelecting = 0
+
+        ;;Update the line corrdenates.
+        self->UpdateLineSelection, event
+        self->UpdateSquareSelection, event
+            IF self.selectionType EQ 'LINE' THEN BEGIN
+                self.oSelectLine->SetProperty, DATA=self.line_map_sel, $
+                  COLOR=[255,255,255]
+            ENDIF ELSE BEGIN
+                self.oSelectLine->SetProperty, DATA=self.square_map_sel, $
+                  COLOR=[255,255,255]  
+            ENDELSE 
+
+        ;;Generate a 'SELECTION' event.
+        self->Draw
+        self->EmitEvent, 'SELECTION', $
+          EVENT_STRUCT={line_sel: self.line_sel, $
+                        line_map_sel: self.line_map_sel}
+    ENDIF
+    
+    ;;Mouse move
+    IF (event.type EQ 2)  THEN BEGIN
+        ;;If a selection is doing actualize the coordenates.
+        IF self.bSelecting THEN BEGIN          
+            self->UpdateLineSelection, event           
+            self->UpdateSquareSelection, event
+            IF self.selectionType EQ 'LINE' THEN BEGIN
+                self.oSelectLine->SetProperty, DATA=self.line_map_sel
+            ENDIF ELSE BEGIN
+                self.oSelectLine->SetProperty, DATA=self.square_map_sel    
+            ENDELSE 
+            
+            self->Draw
+        ENDIF
+
+        ;;Generate a 'MOTION' event.
+        values = [event.x, event.y]
+        convert = self->ConvertValuesW2M(values)
+        self->EmitEvent, 'MOTION', $
+          EVENT_STRUCT={ point_sel: values, $
+                         point_map_sel: convert }
+    ENDIF
+    
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::UpdateLineSelection
+;
+; DESCRIPTION:
+;       Get the actual coordenate points and convert respect the image
+;       size.
+;	
+; KEYWORD PARAMETERS:
+;       all - If set specify that the two points (origin, final) of
+;             the selection line must to be initialize. If not set,
+;             only the final point is converted.
+;
+; NOTE: The 0 and 2 points of the square are the initial and final
+;       points respectively.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::UpdateLineSelection, event, ALL=all
+
+    xpoint = (event.x > 0) < (self.size[0]-1)
+    ypoint = (event.y > 0) < (self.size[1]-1)
+    
+    IF KEYWORD_SET(all) THEN BEGIN
+        self.line_sel[*,0] = [xpoint, ypoint]    
+        self.line_map_sel[*,0] = self->ConvertValuesW2M(self.line_sel[*,0])
+    ENDIF
+
+    self.line_sel[*,1] = [xpoint, ypoint]
+    self.line_map_sel[*,1] = self->ConvertValuesW2M(self.line_sel[*,1])
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::UpdateSquareSelection
+;
+; DESCRIPTION:
+;       Get the actual coordenate points and convert respect the image
+;       size.
+;	
+; KEYWORD PARAMETERS:
+;       all - If set specify that the two points (origin, final) of
+;             the selection line must to be initialize. If not set,
+;             only the final point is converted.
+;
+; NOTE: The 0 and 2 points of the square are the initial and final
+;       points respectively.
+;
+;----------------------------------------------------------------------------
+PRO SelectMap::UpdateSquareSelection, event, ALL=all
+
+    xpoint = (event.x > 0) < (self.size[0]-1)
+    ypoint = (event.y > 0) < (self.size[1]-1)
+    
+    IF KEYWORD_SET(all) THEN BEGIN
+        ;;Initial point
+        self.square_sel[*,0] = [xpoint, ypoint]
+        self.square_map_sel[*,0] = self->ConvertValuesW2M([xpoint, ypoint])
+    ENDIF
+
+    ;;Final point
+    self.square_sel[*,2] = [xpoint, ypoint]
+    self.square_map_sel[*,2] = self->ConvertValuesW2M([xpoint, ypoint])
+
+    ;;Other points
+    xinit = self.square_sel[0,0]
+    yinit = self.square_sel[1,0]
+    width = xinit - xpoint
+    height = yinit - ypoint
+
+    self.square_sel[*,1] = [(xinit + width), ypoint]
+    self.square_map_sel[*,1] = self->ConvertValuesW2M([xpoint, ypoint])
+    
+    self.square_sel[*,3] = [xpoint, (ypoint + height)]
+    self.square_map_sel[*,3] = self->ConvertValuesW2M([xpoint, ypoint])
+
+
+END
+
+
+;+---------------------------------------------------------------------------
+; NAME: SelectMap::ConvertValuesW2M
+;
+; DESCRIPTION:
+;       Convert a pair of values from widget size relative coordenatos
+;       to the image relativa size coordenates.
+;	
+;----------------------------------------------------------------------------
+FUNCTION SelectMap::ConvertValuesW2M, values
+
+    values[0] = (values[0] > 0) < (self.size[0]-1)
+    values[1] = (values[1] > 0) < (self.size[1]-1)
+
+    convert = values
+    convert[0] = values[0] * (self.map_size[0]-1) / (self.size[0]-1)
+    convert[1] = values[1] * (self.map_size[1]-1) / (self.size[1]-1)
+    
+    RETURN, convert
+END
+
+
+
Index: /trunk/Documentation/perldoc_idl/doc.pl
===================================================================
--- /trunk/Documentation/perldoc_idl/doc.pl	(revision 61)
+++ /trunk/Documentation/perldoc_idl/doc.pl	(revision 61)
@@ -0,0 +1,754 @@
+#!/bin/perl
+
+# PerlScript IDL documentation generator.
+# Author: 
+#   Antonio Santiago
+#
+# Description:
+#   The IDL comments must be written between ';+' and ';-':
+#   ;+ ----------
+#   ; Your comment
+#   ;- ----------
+#
+
+use strict;
+use warnings;
+use English;
+
+my $filename;
+my $b_close_tag = 0;
+
+my @comment_tags = (
+		    'CLASSNAME', 
+		    'NAME', 
+		    'AUTHOR', 
+		    'PURPOSE', 
+		    'DESCRIPTION', 
+		    'METHODS', 
+		    'MODIFICATION HISTORY', 
+		    'HISTORY', 
+		    'PARAMETERS', 
+		    'EXTRA PARAMETERS', 
+		    'KEYWORD PARAMETERS', 
+		    'NOTE');    
+
+my @idl_label = (
+                'AND',
+                'NOT',
+                'OR',
+                'XOR',
+                'EQ',
+                'GT',
+                'LT',
+                'LE',
+                'GE',
+                'NE',
+                'MOD',
+                'PRO',
+                'FUNCTION',
+		'RETURN',
+                'IF',
+                'THEN',
+                'ELSE',
+                'ENDIF',
+                'BEGIN',
+                'END',
+                'ENDELSE',
+                'CASE',
+                'OF',
+                'ENDCASE',
+                'SWITCH',
+                'ENDSWITCH',
+                'FOR',
+                'DO',
+                'ENDFOR',
+                'REPEAT',
+                'UNTIL',
+                'ENDREP',
+                'BREAK',
+                'CONTINUE',
+                'GOTO',
+                'COMPILE_OPT',
+                'FORWARD_FUNCTION',
+                'COMMON',
+		'_EXTRA',
+		'_REF_EXTRA'
+		 );
+
+my @idl_keyword = (
+                'AXIS',
+                'BEEP',
+                'BLAS_AXPY',
+                'BREAKPOINT',
+                'BYTEORDER',
+                'CATCH',
+                'CD',
+                'CHOLDC',
+                'CLOSE',
+                'COLOR_CONVERT',
+                'CONSTRAINED_MIN',
+                'CONTOUR',
+                'COPY_LUN',
+                'CPU',
+                'CURSOR',
+                'DDE_EXECUTE',
+                'DECODE_GIF',
+                'DECODE_PACKBITS',
+                'DEFINE_KEY',
+                'DEFINE_MSGBLK',
+                'DEFSYSV',
+                'DELVAR',
+                'DEVICE',
+                'DLM_LOAD',
+                'DLM_REGISTER',
+                'DRAW_ROI',
+                'DUMP',
+                'EMPTY',
+                'ENABLE_SYSRTN',
+                'ENCODE_GIF',
+                'ERASE',
+                'EXIT',
+                'FILE_CHMOD',
+                'FILE_COPY',
+                'FILE_DELETE',
+                'FILE_MKDIR',
+                'FILE_MOVE',
+                'FLUSH',
+                'FORRD',
+                'FORWRT',
+                'FREE_LUN',
+                'FWIDENT_ACQUIRE',
+                'FWIDENT_GC',
+                'FWIDENT_RELEASE',
+                'GET_LUN',
+                'GRID_INPUT',
+                'HANDLE_FREE',
+                'HANDLE_MOVE',
+                'HANDLE_VALUE',
+                'HEAP_FREE',
+                'HEAP_GC',
+                'HEAP_NOSAVE',
+                'HELP',
+                'IDLFWSAVEABLERESTOREARRAY',
+                'IMAGE_STATISTICS',
+                'INTERVAL_VOLUME',
+                'ISOCONTOUR',
+                'ISOSURFACE',
+                'JOURNAL',
+                'LA_CHOLDC',
+                'LA_LUDC',
+                'LA_SVD',
+                'LA_TRIDC',
+                'LA_TRIQL',
+                'LA_TRIRED',
+                'LINKIMAGE',
+                'LUBKSB',
+                'LUDC',
+                'LUDCMP',
+                'MAKE_DLL',
+                'MAP_CLIP_SET',
+                'MAP_PROJ_GCTP_FORINIT',
+                'MAP_PROJ_GCTP_REVINIT',
+                'MESSAGE',
+                'MPROVE',
+                'MRQMIN',
+                'NR__SVDFIT',
+                'NR_CHOLDC',
+                'NR_DFPMIN',
+                'NR_POWELL',
+                'NR_TQLI',
+                'NR_TRED2',
+                'OBJ_DESTROY',
+                'ON_ERROR',
+                'ONLINE_HELP',
+                'OPENR',
+                'OPENU',
+                'OPENW',
+                'OPLOT',
+                'OUTP',
+                'OUTPW',
+                'PARTICLE_TRACE',
+                'PATH_CACHE',
+                'PLOT',
+                'PLOT_IO',
+                'PLOT_OI',
+                'PLOT_OO',
+                'PLOTS',
+                'POINT_LUN',
+                'POLYFILL',
+                'POWELL',
+                'PRINT',
+                'PRINTF',
+                'PROFILER',
+                'PTR_FREE',
+                'QHULL',
+                'QUERY_EVENT_MASK',
+                'READ',
+                'READ_JPEG',
+                'READF',
+                'READS',
+                'READU',
+                'REGISTER_CURSOR',
+                'REPLICATE_INPLACE',
+                'RESOLVE_ROUTINE',
+                'RESTORE',
+                'RIEMANN',
+                'SAVE',
+                'SET_PLOT',
+                'SET_SHADING',
+                'SETENV',
+                'SHADE_SURF',
+                'SHADE_VOLUME',
+                'SHMMAP',
+                'SHMUNMAP',
+                'SKIP_LUN',
+                'SOCKET',
+                'SPAWN',
+                'STRPUT',
+                'STRUCT_ASSIGN',
+                'STRUCT_HIDE',
+                'SURFACE',
+                'SVBKSB',
+                'SVD',
+                'SVDC',
+                'TQLI',
+                'TRED2',
+                'TRIANGULATE',
+                'TRIDAG',
+                'TRIQL',
+                'TRIQL_NOVEC',
+                'TRIRED',
+                'TRUNCATE_LUN',
+                'TV',
+                'TVCRS',
+                'TVDELETE',
+                'TVLCT',
+                'TVRDC',
+                'TVSCL',
+                'TVSET',
+                'TVSHOW',
+                'TVWINDOW',
+                'USERSYM',
+                'WAIT',
+                'WDELETE',
+                'WIDGET_CONTROL',
+                'WIDGET_DISPLAYCONTEXTMENU',
+                'WIDGET_OLH',
+                'WIDGET_PROCESS_EVENTS',
+                'WIDGET_SET_RESOURCE',
+                'WINDOW',
+                'WRITE_JPEG',
+                'WRITE_PNG',
+                'WRITE_TIFF',
+                'WRITEU',
+                'WSET',
+                'WSHOW',
+                'XYOUTS',
+                'ZROOTS'
+		   );
+
+my @idl_function = (
+                'ABS',
+                'ACOS',
+                'ALOG',
+                'ALOG10',
+                'ARG_PRESENT',
+                'ARRAY_EQUAL',
+                'ASIN',
+                'ASSOC',
+                'ATAN',
+                'BESELI',
+                'BESELJ',
+                'BESELK',
+                'BESELY',
+                'BINDGEN',
+                'BROYDEN',
+                'BYTARR',
+                'BYTE',
+                'BYTSCL',
+                'CALL_EXTERNAL',
+                'CALL_VMS',
+                'CEIL',
+                'CHECK_MATH',
+                'CHOLSOL',
+                'CINDGEN',
+                'COLOR_QUAN',
+                'COMPLEX',
+                'COMPLEXARR',
+                'COMPUTE_MESH_NORMALS',
+                'CONJ',
+                'CONVERT_COORD',
+                'CONVOL',
+                'COS',
+                'COSH',
+                'CREATE_STRUCT',
+                'DB_EXISTS',
+                'DBLARR',
+                'DCINDGEN',
+                'DCOMPLEX',
+                'DCOMPLEXARR',
+                'DIAG_MATRIX',
+                'DIALOG_DBCONNECT',
+                'DIALOG_MESSAGE',
+                'DIALOG_PICKFILE',
+                'DIALOG_PRINTERSETUP',
+                'DIALOG_PRINTJOB',
+                'DILATE',
+                'DINDGEN',
+                'DOUBLE',
+                'ELMHES',
+                'ERF',
+                'ERFC',
+                'ERFCX',
+                'ERODE',
+                'ERRORF',
+                'EXECUTE',
+                'EXP',
+                'EXPAND_PATH',
+                'EXPINT',
+                'FFT',
+                'FFTOOLKIT_INFO',
+                'FILE_BASENAME',
+                'FILE_DIRNAME',
+                'FILE_EXPAND_PATH',
+                'FILE_INFO',
+                'FILE_LINES',
+                'FILE_SAME',
+                'FILE_SEARCH',
+                'FILE_TEST',
+                'FINDFILE',
+                'FINDGEN',
+                'FINITE',
+                'FIX',
+                'FLOAT',
+                'FLOOR',
+                'FLTARR',
+                'FORMAT_AXIS_VALUES',
+                'FSTAT',
+                'FULSTR',
+                'FZ_ROOTS',
+                'GAUSSINT',
+                'GET_DRIVE_LIST',
+                'GET_FWIDENT',
+                'GET_KBRD',
+                'GET_LOGIN_INFO',
+                'GETENV',
+                'GRID3',
+                'GRID_TPS',
+                'GRIDDATA',
+                'HISTOGRAM',
+                'HOUGH',
+                'HQR',
+                'IDL_IGAMMA',
+                'IDL_VALIDNAME',
+                'IMAGINARY',
+                'INDGEN',
+                'INP',
+                'INPW',
+                'INTARR',
+                'INTERPOLATE',
+                'INVERT',
+                'IPTOOLKIT_INFO',
+                'ISADXF',
+                'ISHFT',
+                'KEYWORD_SET',
+                'LON64ARR',
+                'LONARR',
+                'LONG',
+                'LONG64',
+                'LSODE',
+                'LUMPROVE',
+                'LUSOL',
+                'MACHAR',
+                'MAKE_ARRAY',
+                'MAKE_EVENT_MASK',
+                'MAP_PROJ_FORWARD',
+                'MAP_PROJ_INVERSE',
+                'MATRIX_MULTIPLY',
+                'MAX',
+                'MEDIAN',
+                'MEMORY',
+                'MESH_CLIP',
+                'MESH_DECIMATE',
+                'MESH_ISSOLID',
+                'MESH_MERGE',
+                'MESH_NUMTRIANGLES',
+                'MESH_SMOOTH',
+                'MESH_SURFACEAREA',
+                'MESH_VALIDATE',
+                'MESH_VOLUME',
+                'MIN',
+                'MORPH_DISTANCE',
+                'N_ELEMENTS',
+                'N_PARAMS',
+                'N_TAGS',
+                'OBJ_CLASS',
+                'OBJ_HASMETHOD',
+                'OBJ_ISA',
+                'OBJ_NEW',
+                'OBJ_VALID',
+                'OBJARR',
+                'POLY_2D',
+                'POLYFILLV',
+                'POLYSHADE',
+                'PRODUCT',
+                'PTR_NEW',
+                'PTR_VALID',
+                'PTRARR',
+                'QUERY_JPEG',
+                'QUERY_PNG',
+                'QUERY_TIFF',
+                'RADON',
+                'RANDOMN',
+                'RANDOMU',
+                'READ_PNG',
+                'READ_TIFF',
+                'REBIN',
+                'RECALL_COMMANDS',
+                'REFORM',
+                'REPLICATE',
+                'ROTATE',
+                'ROUND',
+                'ROUTINE_INFO',
+                'ROUTINE_NAMES',
+                'SHIFT',
+                'SHMDEBUG',
+                'SHMVAR',
+                'SIMPLEX',
+                'SIN',
+                'SINDGEN',
+                'SINH',
+                'SIZE',
+                'SMOOTH',
+                'SOBEL',
+                'SORT',
+                'SPL_INIT',
+                'SPL_INTERP',
+                'SPRSAB',
+                'SPRSAX',
+                'SPRSIN',
+                'SPRSTP',
+                'SQRT',
+                'STRARR',
+                'STRCMP',
+                'STRCOMPRESS',
+                'STREGEX',
+                'STRING',
+                'STRJOIN',
+                'STRLEN',
+                'STRLOWCASE',
+                'STRMATCH',
+                'STRMESSAGE',
+                'STRMID',
+                'STRPOS',
+                'STRTOK',
+                'STRTRIM',
+                'STRUPCASE',
+                'SVSOL',
+                'SYSTIME',
+                'TAG_NAMES',
+                'TAN',
+                'TANH',
+                'TEMPORARY',
+                'TETRA_CLIP',
+                'TETRA_SURFACE',
+                'TETRA_VOLUME',
+                'THIN',
+                'TOTAL',
+                'TRANSPOSE',
+                'TRIGRID',
+                'TRISOL',
+                'TVRD',
+                'UINDGEN',
+                'UINT',
+                'UINTARR',
+                'UL64INDGEN',
+                'ULINDGEN',
+                'ULON64ARR',
+                'ULONARR',
+                'ULONG',
+                'ULONG64',
+                'VALUE_LOCATE',
+                'VAX_FLOAT',
+                'VOIGT',
+                'VOXEL_PROJ',
+                'W32_GETSYSCOLOR',
+                'WATERSHED',
+                'WHERE',
+                'WIDGET_ACTIVEX',
+                'WIDGET_BASE',
+                'WIDGET_BUTTON',
+                'WIDGET_COMBOBOX',
+                'WIDGET_DRAW',
+                'WIDGET_DROPLIST',
+                'WIDGET_EVENT',
+                'WIDGET_GET_RESOURCE',
+                'WIDGET_INFO',
+                'WIDGET_LABEL',
+                'WIDGET_LIST',
+                'WIDGET_MESSAGE',
+                'WIDGET_PROPERTYSHEET',
+                'WIDGET_SLIDER',
+                'WIDGET_STUB',
+                'WIDGET_TAB',
+                'WIDGET_TABLE',
+                'WIDGET_TEXT',
+                'WIDGET_TREE',
+                'WMENU',
+                'WTN',
+                'WV_DWT',
+                'WV_PWT'
+		   );
+
+
+#Para cada fichero PRO especificado generamos su documentacion
+foreach $filename (@ARGV){
+    if( $filename =~ /(.+)\.pro$/){
+     
+	my $newfile = $1.".html";
+	#Creamos ficheros entrada y salida
+	open FILE_IN, "< $filename" or die "Couldn't open `$filename'";
+	open FILE_OUT, "> $newfile" or die "Couldn't open `$newfile'";
+	
+	my $file_out = \*FILE_OUT;
+	my $b_comment = 0;
+	my $b_code = 0;
+	my $line;
+	my $code_num=0;
+
+	head($file_out, $filename);
+	
+	while($line=<FILE_IN>){          
+	    #Comprobamos su es la linea de inicio de un comentario
+	    if($line =~ /^;\+/){ 
+		$b_comment = 1; 
+		$b_code = 0;
+		print $file_out '</code></div></div>'; #Cerramos seccion de codigo		
+		print $file_out '<div class="comment">'; #Abrimos seccion commentarios
+		next; 
+	    }
+
+	    #Comprobamos si es la linea de finalizacion de un comentario
+	    if($line =~ /^;\-$/){ 
+		$b_comment = 0; 
+		$b_code = 1;
+		#Cerramos tag en caso de haber alguno abierto
+		if( $b_close_tag == 1 ){ 
+		    print $file_out '</div>'; 
+		    $b_close_tag = 0; 
+		}
+		print $file_out '</div>'; #Cerramos seccion comentarios
+		print $file_out '<div class="code"><a href="#" onClick="changeVisibility(\'code_'.$code_num.'\');">+Code:</a></br><div class="code_text" id="code_'.$code_num.'"><code>'; #Abrimos seccion codigo 
+		$code_num++;
+		next; 
+	    }
+	    
+	    #Si estamos dentro de una descripcion
+	    if($b_comment == 1){ 
+		$line =~ s/^;//; #Eliminamos ';' inicial
+
+		parse_comment($file_out, $line);
+	    }
+	       
+	    #Si estamos dentro del codigo
+	    if($b_code == 1){ 
+		parse_idl($file_out, $line); 
+	    }
+	}	    	    
+	
+	#Finalizamos documento
+	if( $b_code == 1){
+	    $b_code = 0; 
+	    print $file_out '</code></div></div>'; #Cerramos seccion de codigo
+	}
+	if( $b_comment == 1){
+	    $b_comment = 0;
+	    print $file_out '</div>'; #Cerramos seccion comentarios
+	}
+
+	final($file_out);
+    }
+    
+    close FILE_OUT;
+    close FILE_IN;
+}
+
+#Comprueba si un tag es correcto (definido y dentro del hash de tags).
+sub correct_tag {
+
+    my $tag = shift;
+    my $key;
+
+    if( defined($tag) ){
+	$tag =~ s/(\s|\:)//; #Eliminamos espacios y ':'.
+	foreach $key (@comment_tags){	
+	    if( $tag =~ /$key/ ) { return 1}		
+	}
+    }
+   
+    return 0;
+}
+
+#Parse las cabeceras de comentarios
+sub parse_comment {
+
+    my $file_out = shift;
+    my $line = shift;
+    my ($tag, $rest);
+
+    if( $line =~ /^\s+$/){ return; } #Miramos que nosea una linea vacia
+
+    $line =~ /^\s*(.*?)\:(.*)/;
+    
+    if ( correct_tag($1) == 1 ) {
+
+	$tag = $1;	
+	$tag =~ s/(\:)//; #Eliminamos espacios y ':'.
+	$rest = $2;
+
+	if( $tag =~ 'NAME'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_name">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'AUTHOR'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_author">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'MODIFICATION HISTORY'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_history">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'HISTORY'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_history">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag =~ 'PARAMETERS'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_parameters">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'PURPOSE'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_description">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'DESCRIPTION'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_description">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	elsif( $tag eq 'METHODS'){
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out '<div class="tag_methods">';
+	    print $file_out "<b>$tag:</b>";
+	    $b_close_tag = 1;
+	}
+	else{
+	    if( $b_close_tag == 1 ){ print $file_out '</div>'; $b_close_tag = 0; }
+	    print $file_out "<b>$tag:</b>";
+	}
+
+	$rest =~ s/ /\&nbsp\;/g; #Substituimos espacios en blanco
+	print $file_out $rest;
+	print $file_out "</br>";
+    }
+    else {
+	$line =~ s/\t/&nbsp;&nbsp;&nbsp;&nbsp;/g;
+	$line =~ s/ /&nbsp;/g; #Substituimos espacios en blanco
+	$line =~ s/\<(.*?)\>/\<a href="mailto:$1"\>&lt;$1&gt;\<\/a\>/g;
+
+	print $file_out $line."</br>";
+    }       
+}
+
+#Parsea el contenido de codio realzando las instrucciones IDL
+sub parse_idl{
+
+    my $file_out = shift;
+    my $line = shift;
+    my $tag;
+
+    if( $line =~ /^\s*\;/ ){ 
+	#Es un comentario. No hacemos nada
+	$line = "<i><b>".$line."</b></i>";
+    }
+    else{
+	#Es codigo IDL
+	if( $line =~ /(.+)(\;.*)/ ){ $line = $1; }
+
+	#Miramos si es un label
+	foreach $tag (@idl_label){
+	    $line =~ s/\b$tag\b/\<b\>$tag\<\/b\>/ig;
+	}
+
+	#Miramos si es un keyword
+	foreach $tag (@idl_keyword){
+	    $line =~ s/\b$tag\b/\<b\>$tag\<\/b\>/ig;
+	}
+
+	#Miramos si es un function
+	foreach $tag (@idl_function){
+	    $line =~ s/\b$tag\(\b/\<b\>$tag\<\/b\>\(/ig;
+	}
+
+	if(defined($2)){ $line = $line."<i><b>".$2."</b></i>"; }
+    }
+
+    $line =~ s/ /&nbsp;/g; #Substituimos espacios en blanco
+
+    print $file_out $line."</br>";
+}
+
+
+#Escribe el codigo HTML de inicio de documento
+sub head {
+
+    my $file_out = shift;
+    my $filename = shift;
+
+    print $file_out '<html>'."\n";
+    print $file_out '<head>'."\n";
+    print $file_out '<title>GRAHI Documentation Project (GDP): '.$filename.'</title>'."\n";
+	
+    print $file_out '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
+    print $file_out '<meta name="author" content="Antonio Santiago" />'."\n";
+    print $file_out '<meta name="generator" content="PerlScript IDL documentation generator" />'."\n";
+    print $file_out '<link rel="stylesheet" type="text/css" href="style.css">'."\n";
+
+    print $file_out '<script language="javascript" type="text/javascript">'."\n";
+    print $file_out 'function changeVisibility(elemId){'."\n";
+    print $file_out 'var elem = document.getElementById(elemId).style;'."\n";
+    print $file_out 'if(elem.display==\'block\') elem.display=\'none\';'."\n";
+    print $file_out 'else elem.display=\'block\';'."\n";
+    print $file_out '}'."\n";
+    print $file_out '</script>'."\n";
+
+    print $file_out '</head>'."\n";
+
+    print $file_out '<body>'."\n";
+
+    print $file_out '<div class="head">GRAHI Documentation Project (GDP)</div>';
+    print $file_out '<div class="descrip">Filename: <b>'.$filename.'</b></div>'."\n";
+}
+
+#Finaliza el documento HTML
+sub final {
+
+    my $file_out = shift;
+
+    print $file_out '<div class="final">&middot; Created by the PerlScript documentation generator for IDL &middot; <br> &middot; <i>'. localtime().'</i> &middot;</div>';
+    print $file_out '</body>';
+    print $file_out '</html>';
+}
+
Index: /trunk/Documentation/perldoc_idl/style.css
===================================================================
--- /trunk/Documentation/perldoc_idl/style.css	(revision 61)
+++ /trunk/Documentation/perldoc_idl/style.css	(revision 61)
@@ -0,0 +1,116 @@
+body { 
+  background: white; 
+  color: black; 
+  font-family: lucida, helvetica, sans-serif; 
+  font-size: 10pt;
+}
+
+.head{
+  background: #efefef;
+  font-size: 18pt;
+  color: grey;
+  padding: 4pt 4pt 4pt 4pt;
+  text-align: center;
+}
+
+.descrip{
+  font-size: 14;
+  color: grey;
+  text-align: center;
+  padding: 4pt 4pt 4pt 4pt;
+  margin: 4pt 4pt 4pt 4pt;
+}
+
+.final{
+  border-top: 1pt solid;
+  padding-top: 4pt;
+  font-size: 12pt;
+  color: grey;
+  text-align: center;
+}
+
+.comment
+{
+  background: #efefef;
+  border: solid 1pt #aaaaaa;
+  padding: 5pt;
+  margin: 5pt 10pt 1pt 10pt;
+}
+
+.tag_name
+{
+  background: #dedede;
+  border: solid 1pt #bcbcbc;
+  padding: 2pt;
+  margin: 1pt;
+}
+
+.tag_description
+{
+  background: #c0ffc8;
+  border: solid 1pt #bfeeb7;
+  padding: 2pt;
+  margin: 1pt;
+}
+
+.tag_author
+{
+  background: #c0d0ff;
+  border: solid 1pt #dfefee;
+  padding: 2pt;
+  margin: 1pt;
+}
+
+.tag_parameters
+{
+  background: #e0d0ff;
+  border: solid 1pt #dfefee;
+  padding: 2pt;
+  margin: 0pt;
+}
+
+.tag_history
+{
+  background: #e0d0c0;
+  border: solid 1pt #dfefbf;
+  padding: 2pt;
+  margin: 1pt;
+}
+
+.tag_methods
+{
+  background: #ffcc33;
+  border: solid 1pt #cc9933;
+  padding: 2pt;
+  margin: 1pt;
+}
+
+.code
+{
+  background: #eeeeff;
+  border: solid 1pt #aaaaff;
+  padding: 5pt;
+  margin: 0pt 10pt 20pt 10pt;
+}
+
+.code_text{
+  display: none;
+  margin: 10pt 0pt 0pt 0pt;
+}
+
+a
+{
+  text-decoration: none;
+}
+
+a:hover
+{
+  text-decoration: underline;
+  color: #FF0000;
+}
+
+a:visited 
+{
+  text-decoration: underline;
+  color: #550000;
+}
