#ifndef CODE_LISTVIEW_CXX
#define CODE_LISTVIEW_CXX

/*-----------------------------------------------------------------------
 * Xclasses code file
 * ($Id: listview.cxx,v 1.2 1998/07/29 23:02:22 schmitzj Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *-----------------------------------------------------------------------
 */

#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "types.h"
#include <Xclasses/listview.h>

listview::listview(): multilistview()
{
	Name("listview");
	column_spec specs[1];
	specs[0].flags=CSF_SELECTABLE|CSF_USEWEIGHT|CSF_USESHORTCUT;
	specs[0].weight=100;
	Columns(1,specs);
}
listview::~listview()
{
}
void listview::Replace(int nr,char *t)
{
	char *b[1];
	b[0]=t;
	multilistview::Replace(nr,b);
}
void listview::AddAtBegin(char *t)
{
	AddAtBegin(t,NULL);
}
void listview::AddAtBegin(char *t,void *data)
{
	char *b[1];
	b[0]=t;
	multilistview::AddAtBegin(b,data);
}
void listview::AddAtEnd(char *t)
{
	AddAtEnd(t,NULL);
}
void listview::AddAtEnd(char *t,void *data)
{
	char *b[1];
	b[0]=t;
	multilistview::AddAtEnd(b,data);
}
void listview::AddBefore(int nr,char *t)
{
	AddBefore(nr,t,NULL);
}
void listview::AddBefore(int nr,char *t,void *data)
{
	char *b[1];
	b[0]=t;
	multilistview::AddBefore(nr,b,data);
}
void listview::SetHook(int (*hook)(struct hook_data*),void *userdata)
{
	column_spec spec;
	spec.flags=CSF_HOOK;
	spec.hookclass=NULL;
	spec.hook=hook;
	spec.userdata=userdata;
	ColumnConfigure(1,&spec);
}
void listview::SetHook(callable *cl,int (callable::*hook)(struct hook_data*),void *userdata)
{
	column_spec spec;
	spec.flags=CSF_HOOK;
	spec.hookclass=cl;
	spec.objhook=hook;
	spec.userdata=userdata;
	ColumnConfigure(1,&spec);
}

#endif
