From f34c8d617cbe8ae426e7a1e280dfa0aaf5d11a6d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 28 Apr 2008 13:51:58 +0000 Subject: [PATCH] Add Table widget Bugfixes in List --- source/list.cpp | 5 +- source/panel.cpp | 2 + source/table.cpp | 145 +++++++++++++++++++++++++++++++++++++++++++++++ source/table.h | 58 +++++++++++++++++++ 4 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 source/table.cpp create mode 100644 source/table.h diff --git a/source/list.cpp b/source/list.cpp index 722e296..8c0d789 100644 --- a/source/list.cpp +++ b/source/list.cpp @@ -71,6 +71,8 @@ void List::clear() { items.clear(); sel_index=-1; + + recalculate_parameters(); } void List::set_selected_index(int i) @@ -261,7 +263,8 @@ void List::recalculate_parameters() void List::slider_value_changed(double value) { - first=items.size()-n_visible-static_cast(value); + if(items.size()>n_visible) + first=items.size()-n_visible-static_cast(value); } diff --git a/source/panel.cpp b/source/panel.cpp index f17439a..4d0d5d1 100644 --- a/source/panel.cpp +++ b/source/panel.cpp @@ -15,6 +15,7 @@ Distributed under the LGPL #include "list.h" #include "panel.h" #include "part.h" +#include "table.h" #include "toggle.h" #include "vslider.h" @@ -233,6 +234,7 @@ Panel::Loader::Loader(Panel &p, map &m): add("label", &Loader::child