-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#include <msp/gl/immediate.h>
#include <msp/gl/matrix.h>
#include <msp/gl/transform.h>
void List::insert(unsigned i, const string &v)
{
if(i>items.size())
- throw InvalidParameterValue("Index out of range");
+ throw out_of_range("List::insert");
items.insert(items.begin()+i, v);
check_view_range();
void List::remove(unsigned i)
{
if(i>items.size())
- throw InvalidParameterValue("Index out of range");
+ throw out_of_range("List::remove");
items.erase(items.begin()+i);
if(sel_index>static_cast<int>(i))
signal_item_selected.emit(sel_index, items[sel_index]);
}
else
- throw InvalidParameterValue("Index out of range");
+ throw out_of_range("List::set_selected_index");
}
const string &List::get_selected() const
{
if(sel_index<0)
- throw InvalidState("No selection");
+ throw logic_error("sel_index<0");
return items[sel_index];
}