Name = $Name; $this->Selected = $Selected; $this->CssClass = $CssClass; $this->Pushed["value"] = array(); $this->Pushed["text"] = array(); } // Añade un nuevo campo a la lista function AddItem ( $Value , $Text ) { array_push ( $this->Pushed["value"] , $Value ); array_push ( $this->Pushed["text"] , $Text ); } // Rellena el droplistbox a partir del contenido de un objeto SQLSelect // El primer campo del select sera el value y el segundo el text function DataBind ( $obj ) { while ( $rs = $obj->Rowset() ) { $this->AddItem ( $rs[0] , $rs[1] ); } } // Retorna el value de un text dado function GetValue ( $Text ) { $i = 0; $fin = count ( $this->Pushed["text"] ) - 1; while ( $i <= $fin && $Text <> $this->Pushed["text"][$i] ) { $i++; } if ( $i > $fin ) return ""; else return $this->Pushed["value"][$i]; } // Retorna un text de un value dado function GetText ( $Value ) { $i = 0; $fin = count ( $this->Pushed["value"] ) - 1; while ( $i <= $fin && $Value <> $this->Pushed["value"][$i] ) { $i++; } if ( $i > $fin ) return ""; else return $this->Pushed["text"][$i]; } // Cuenta el número de campos que hay en la lista function Count () { return count ( $this->Pushed["value"] ); } // Pinta la lista function Draw () { echo ""; } } // Fin de la clase ?>