From c34e820240e514b983adfc07f632f463a9022356 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 1 Jul 2003 12:39:49 +0000 Subject: added default themeitem handlers for integer and string --- src/FbTk/Theme.cc | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc index 82bda06..2037431 100644 --- a/src/FbTk/Theme.cc +++ b/src/FbTk/Theme.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Theme.cc,v 1.7 2003/06/15 21:02:41 fluxgen Exp $ +// $Id: Theme.cc,v 1.8 2003/07/01 12:39:49 fluxgen Exp $ #include "Theme.hh" @@ -43,7 +43,34 @@ using namespace std; namespace FbTk { -// create default handlers for Color, Font, and Texture +// create default handlers for Color, Font, Texture, int and string +template <> +void FbTk::ThemeItem::load() { } + +template <> +void FbTk::ThemeItem::setDefaultValue() { + *(*this) = ""; +} + +template <> +void FbTk::ThemeItem::setFromString(const char *str) { + *(*this) = (str ? str : ""); +} + +template <> +void FbTk::ThemeItem::load() { } + +template <> +void FbTk::ThemeItem::setDefaultValue() { + *(*this) = 0; +} + +template <> +void FbTk::ThemeItem::setFromString(const char *str) { + if (str == 0) + return; + sscanf(str, "%d", &m_value); +} template <> void ThemeItem::setDefaultValue() { -- cgit v0.11.2